list_roles
Retrieve a paginated listing of user roles from the BookStack wiki system to manage permissions and access controls.
Instructions
Get a listing of roles in the system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| count | No | Number of items per page | |
| sort | No | Sort parameter |
Implementation Reference
- src/tools/search-user-tools.ts:422-426 (handler)Core execution logic for the 'list_roles' tool: parses pagination parameters from input, fetches roles using BookStackClient.getRoles(), and formats the paginated response.case "list_roles": { const params = PaginationSchema.parse(args); const result = await client.getRoles(params); return formatApiResponse(result.data, result.total); }
- Tool schema definition for 'list_roles', including name, description, and input schema for optional pagination and sorting parameters. Part of the tools array returned by createSearchAndUserTools().{ name: "list_roles", description: "Get a listing of roles in the system", inputSchema: { type: "object", properties: { page: { type: "number", description: "Page number for pagination" }, count: { type: "number", description: "Number of items per page" }, sort: { type: "string", description: "Sort parameter" }, }, }, },
- src/index.ts:103-128 (registration)Registers 'list_roles' by listing it in searchUserToolNames array and routing tool execution requests to handleSearchAndUserTool() in the main MCP server request handler.const searchUserToolNames = [ "search_all", "list_users", "get_user", "create_user", "update_user", "delete_user", "list_roles", "get_role", "create_role", "update_role", "delete_role", "list_attachments", "get_attachment", "delete_attachment", "list_images", "get_image", "update_image", "delete_image", ]; if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else {