get_user
Retrieve specific user details from BookStack by providing a user ID to access account information and profile data.
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)Handler logic for the 'get_user' tool within handleSearchAndUserTool switch statement. Parses the 'id' from input arguments, fetches the user using BookStackClient.getUser, 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)Tool object definition in createSearchAndUserTools, providing the name, description, and inputSchema for 'get_user' tool, which requires a numeric 'id' parameter.{ 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-59 (registration)Registration of 'get_user' tool: includes tools from createSearchAndUserTools (which defines 'get_user') in the allTools array, returned by the list_tools handler.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:103-122 (registration)Lists 'get_user' in searchUserToolNames array used to route tool calls to handleSearchAndUserTool dispatcher.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", ];
- src/lib/bookstack-client.ts:287-290 (helper)BookStackClient helper method that retrieves user details by ID via the BookStack API endpoint `/users/{id}`.async getUser(id: number): Promise<User> { const response: AxiosResponse<User> = await this.api.get(`/users/${id}`); return response.data; }