{
  "tools": [
    {
      "id": "reset_password",
      "category": "users",
      "label": "Reset User Password",
      "description": "Reset an existing Nextcloud user's password. Leave the password field blank to generate a random one — it is shown in the task log.",
      "icon": "🔑",
      "fields": [
        {
          "name": "username",
          "label": "Username",
          "type": "text",
          "placeholder": "alice",
          "required": true
        },
        {
          "name": "password",
          "label": "New password (leave blank to generate)",
          "type": "password",
          "placeholder": "Leave blank for random"
        }
      ]
    },
    {
      "id": "create_account",
      "category": "users",
      "label": "Create User Account",
      "description": "Create a new Nextcloud user. Tick \"Make admin\" to add them to the admin group. Leave the password blank to generate a random one.",
      "icon": "👤",
      "fields": [
        {
          "name": "username",
          "label": "Username",
          "type": "text",
          "placeholder": "alice",
          "required": true
        },
        {
          "name": "display_name",
          "label": "Display name",
          "type": "text",
          "placeholder": "Alice Smith"
        },
        {
          "name": "password",
          "label": "Password (leave blank to generate)",
          "type": "password",
          "placeholder": "Leave blank for random"
        },
        {
          "name": "admin",
          "label": "Make admin",
          "type": "checkbox",
          "default": false
        }
      ]
    },
    {
      "id": "list_users",
      "category": "users",
      "label": "List Users",
      "description": "Show every Nextcloud user with their display name and admin flag.",
      "icon": "📋",
      "fields": []
    },
    {
      "id": "delete_user",
      "category": "users",
      "label": "Delete User Account",
      "description": "Permanently delete a user and all their files.",
      "icon": "🗑",
      "destructive": true,
      "confirm": "This cannot be undone. The user's files will be removed.",
      "fields": [
        {
          "name": "username",
          "label": "Username",
          "type": "text",
          "required": true
        }
      ]
    },
    {
      "id": "set_admin",
      "category": "users",
      "label": "Set Admin Status",
      "description": "Add a user to (or remove from) the admin group.",
      "icon": "👑",
      "fields": [
        {
          "name": "username",
          "label": "Username",
          "type": "text",
          "required": true
        },
        {
          "name": "admin",
          "label": "Make admin",
          "type": "checkbox",
          "default": false
        }
      ]
    },
    {
      "id": "toggle_maintenance",
      "category": "maintenance",
      "label": "Toggle Maintenance Mode",
      "description": "Lock all users out and show a maintenance notice — required before running upgrades or repairs from the CLI.",
      "icon": "🚧",
      "fields": [
        {
          "name": "enable",
          "label": "Enable maintenance mode",
          "type": "checkbox",
          "default": true
        }
      ]
    },
    {
      "id": "rescan_files",
      "category": "maintenance",
      "label": "Rescan Files",
      "description": "Re-index Nextcloud's file metadata. Run this after files were added or removed on disk outside Nextcloud (rsync, restore, manual copy). Leave the username blank to scan every user.",
      "icon": "🔄",
      "fields": [
        {
          "name": "username",
          "label": "Username (blank = all users)",
          "type": "text",
          "placeholder": "blank for all"
        }
      ]
    },
    {
      "id": "add_trusted_domain",
      "category": "system",
      "label": "Add Trusted Domain",
      "description": "Append a hostname to Nextcloud's trusted_domains list so requests to that host are accepted.",
      "icon": "🌐",
      "fields": [
        {
          "name": "domain",
          "label": "Domain",
          "type": "text",
          "placeholder": "cloud.example.org",
          "required": true
        }
      ]
    },
    {
      "id": "system_status",
      "category": "system",
      "label": "System Status",
      "description": "Show Nextcloud's version, install state, and maintenance flag.",
      "icon": "ℹ️",
      "fields": []
    },
    {
      "id": "tail_logs",
      "category": "system",
      "label": "Tail Logs",
      "description": "Show the most recent lines of nextcloud.log.",
      "icon": "📜",
      "fields": [
        {
          "name": "lines",
          "label": "Lines",
          "type": "number",
          "default": 100,
          "min": 10,
          "max": 1000
        }
      ]
    }
  ]
}
