get_image
Retrieve specific image details from BookStack wiki by providing its ID for content management and reference.
Instructions
Get details of a specific image
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Image ID |
Implementation Reference
- src/tools/search-user-tools.ts:505-509 (handler)Handler logic for the 'get_image' MCP tool. Parses the input 'id', calls the BookStack client's getImage method, and returns a formatted API response.case "get_image": { const id = parseInteger(args.id); const result = await client.getImage(id); return formatApiResponse(result); }
- Tool definition including name, description, and input schema (requires 'id' as number) for the 'get_image' tool, returned by createSearchAndUserTools.{ name: "get_image", description: "Get details of a specific image", inputSchema: { type: "object", properties: { id: { type: "number", description: "Image ID" }, }, required: ["id"], }, },
- src/lib/bookstack-client.ts:371-376 (helper)Core implementation in BookStackClient that makes the HTTP GET request to /api/image-gallery/{id} to fetch image details.async getImage(id: number): Promise<ImageGallery> { const response: AxiosResponse<ImageGallery> = await this.api.get( `/image-gallery/${id}` ); return response.data; }
- src/index.ts:103-122 (registration)Registration of 'get_image' in the searchUserToolNames array, which determines dispatch to handleSearchAndUserTool in the MCP server's CallToolRequest 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", ];
- src/index.ts:56-59 (registration)Includes tools from createSearchAndUserTools (containing 'get_image' definition) into the allTools list returned by ListToolsRequest to the MCP server.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];