get_role
Retrieve detailed information about a specific BookStack role, including its permissions and access levels, by providing the role ID.
Instructions
Get details of a specific role including permissions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Role ID |
Implementation Reference
- src/tools/search-user-tools.ts:428-432 (handler)The handler function that executes the 'get_role' tool logic: parses the 'id' argument, calls the BookStack client's getRole method, and formats the result as an API response.case "get_role": { const id = parseInteger(args.id); const result = await client.getRole(id); return formatApiResponse(result); }
- The tool metadata definition including name, description, and input schema specifying a required numeric 'id' parameter for validation.{ name: "get_role", description: "Get details of a specific role including permissions", inputSchema: { type: "object", properties: { id: { type: "number", description: "Role ID" }, }, required: ["id"], }, },
- src/index.ts:56-66 (registration)Registers the 'get_role' tool (via createSearchAndUserTools) in the allTools array, which is returned by the list tools handler to MCP clients.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ]; // List tools handler server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
- src/lib/bookstack-client.ts:315-318 (helper)Supporting utility in BookStackClient that makes the HTTP GET request to fetch role details by ID from the BookStack API.async getRole(id: number): Promise<Role> { const response: AxiosResponse<Role> = await this.api.get(`/roles/${id}`); return response.data; }