Skip to main content
Glama

list_roles

Retrieve a paginated listing of user roles from the BookStack wiki system to manage permissions and access control.

Instructions

Get a listing of roles in the system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of items per page
pageNoPage number for pagination
sortNoSort parameter

Implementation Reference

  • Handler implementation for the 'list_roles' tool. Parses input arguments using PaginationSchema, calls 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); }
  • Schema definition for the 'list_roles' tool, including name, description, and inputSchema for pagination parameters.
    { 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:56-59 (registration)
    'list_roles' tool is registered in the MCP server's tool list via inclusion of createSearchAndUserTools() output in allTools, used by ListToolsRequestHandler.
    const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
  • src/index.ts:102-129 (registration)
    'list_roles' is listed in searchUserToolNames array; calls to it are routed to handleSearchAndUserTool in the MCP CallToolRequestHandler.
    // Search and user tools 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 { throw new Error(`Unknown tool: ${name}`);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lautarobarba/bookstack_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server