LibrePortal/containers/rocketchat/tools/rocketchat.tools.json
librelad 4b6b05db81 fix(rocketchat): correct the roles call, satisfy the password policy, add enable
Three things running the tools against a live instance exposed:

- roles.addUserToRole takes roleId + username and nothing else. Passing roleName
  fails schema validation with "must NOT have additional properties", and
  roleId + userId is refused for a missing username. Set admin was broken in
  both directions.

- Rocket.Chat enables a password policy by default demanding lower, upper, digit
  AND special at 14+ characters, while generateRandomPassword is alphanumeric.
  Reset failed with "does not meet the server's password policy". Notably
  users.create does NOT enforce the policy, which is why creating an account
  worked and resetting the same account's password did not — an inconsistency
  worth knowing about rather than guessing at. Generated passwords now carry one
  character from each class appended, leaving the generated entropy untouched.

- Deactivation had no counterpart, so "reversible from Admin → Users" was only
  true if you left the WebUI. Adds an Enable tool, matching Stoat's.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 21:39:42 +01:00

121 lines
2.9 KiB
JSON

{
"tools": [
{
"id": "create_account",
"category": "users",
"label": "Create User Account",
"description": "Add a Rocket.Chat user. Tick \"Make admin\" for full rights.",
"icon": "👤",
"fields": [
{
"name": "email",
"label": "Email",
"type": "text",
"placeholder": "user@example.com",
"required": true
},
{
"name": "username",
"label": "Username",
"type": "text",
"placeholder": "Leave blank to derive from the email"
},
{
"name": "password",
"label": "Password",
"type": "password",
"placeholder": "Leave blank to generate"
},
{
"name": "admin",
"label": "Make admin",
"type": "checkbox",
"default": false
}
]
},
{
"id": "list_users",
"category": "users",
"label": "List Users",
"description": "Every account, with roles and whether it is deactivated.",
"icon": "📋",
"fields": []
},
{
"id": "reset_password",
"category": "users",
"label": "Reset User Password",
"description": "Set a new password for an existing user.",
"icon": "🔑",
"fields": [
{
"name": "user",
"label": "Username or email",
"type": "text",
"required": true
},
{
"name": "password",
"label": "New password",
"type": "password",
"placeholder": "Leave blank to generate"
}
]
},
{
"id": "set_admin",
"category": "users",
"label": "Set Admin Status",
"description": "Grant or revoke the admin role.",
"icon": "👑",
"fields": [
{
"name": "user",
"label": "Username or email",
"type": "text",
"required": true
},
{
"name": "admin",
"label": "Make admin",
"type": "checkbox",
"default": false
}
]
},
{
"id": "deactivate_user",
"category": "users",
"label": "Deactivate User Account",
"description": "Revoke access without deleting messages. Reversible from Admin → Users.",
"icon": "🚫",
"destructive": true,
"confirm": "The user will be signed out and unable to log in.",
"fields": [
{
"name": "user",
"label": "Username or email",
"type": "text",
"required": true
}
]
},
{
"id": "enable_user",
"category": "users",
"label": "Enable User Account",
"description": "Undo a deactivation and let the account sign in again.",
"icon": "✅",
"fields": [
{
"name": "user",
"label": "Username or email",
"type": "text",
"required": true
}
]
}
]
}