get_user
Retrieve user details from a BookStack wiki by providing a user ID. This tool enables user administration and access management within the platform.
Instructions
Get details of a specific user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | User ID |
Implementation Reference
- src/tools/search-user-tools.ts:363-367 (handler)The execution handler for the 'get_user' tool. Parses the input 'id' to integer, calls BookStackClient.getUser(id), and formats the response using formatApiResponse.case "get_user": { const id = parseInteger(args.id); const result = await client.getUser(id); return formatApiResponse(result); }
- src/tools/search-user-tools.ts:50-60 (schema)The Tool object definition for 'get_user', including name, description, and inputSchema that requires a numeric 'id'.{ name: "get_user", description: "Get details of a specific user", inputSchema: { type: "object", properties: { id: { type: "number", description: "User ID" }, }, required: ["id"], }, },
- src/index.ts:56-66 (registration)Registers the tool schemas by including createSearchAndUserTools() (which defines 'get_user') in the allTools array, returned by the MCP listTools handler.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ]; // List tools handler server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
- src/index.ts:103-128 (registration)Routes execution of 'get_user' tool calls: listed in searchUserToolNames array and dispatched to handleSearchAndUserTool via the MCP callTool 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 {
- src/lib/bookstack-client.ts:287-290 (helper)BookStackClient.getUser(id) method: performs API GET request to /users/{id} and returns the User object.async getUser(id: number): Promise<User> { const response: AxiosResponse<User> = await this.api.get(`/users/${id}`); return response.data; }