get_shelf
Retrieve detailed information about a specific BookStack shelf, including its contained books, by providing the shelf ID.
Instructions
Get details of a specific shelf including its books
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Shelf ID |
Implementation Reference
- src/tools/content-tools.ts:739-743 (handler)Handler for the get_shelf tool: parses the input ID and calls BookStackClient.getShelf to retrieve shelf details.case "get_shelf": { const id = parseInteger(args.id); const result = await client.getShelf(id); return formatApiResponse(result); }
- src/tools/content-tools.ts:436-446 (schema)Tool definition including name, description, and input schema that requires a numeric 'id' for the shelf.{ name: "get_shelf", description: "Get details of a specific shelf including its books", inputSchema: { type: "object", properties: { id: { type: "number", description: "Shelf ID" }, }, required: ["id"], }, },
- src/lib/bookstack-client.ts:262-265 (helper)BookStackClient method that performs the API GET request to fetch the specific shelf by ID.async getShelf(id: number): Promise<Shelf> { const response: AxiosResponse<Shelf> = await this.api.get(`/shelves/${id}`); return response.data; }
- src/index.ts:56-59 (registration)Registers the get_shelf tool by including it in the allTools list via createContentTools for MCP server.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:124-126 (registration)Routes calls to get_shelf (listed in contentToolNames) to the content tools handler.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {