user_list
List all users in Crafty Controller with details like username, permissions, and creation date. Use the ids_only parameter to retrieve just user IDs.
Instructions
List all Crafty Controller users. Returns user_id, username, enabled, superuser, lang, and creation date.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids_only | No | If true, returns only user IDs for a minimal response |
Implementation Reference
- src/tools/users.ts:15-24 (handler)The handler function for the 'user_list' tool.
async ({ ids_only }) => { try { const path = ids_only ? "/users?ids=true" : "/users"; const data = await client.get(path); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true }; } } - src/tools/users.ts:6-14 (registration)Registration of the 'user_list' tool with its schema and handler.
server.tool( "user_list", "List all Crafty Controller users. Returns user_id, username, enabled, superuser, lang, and creation date.", { ids_only: z .boolean() .optional() .describe("If true, returns only user IDs for a minimal response"), },