get_shelf
Retrieve details of a specific shelf and its books from BookStack wiki instances using 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 logic for the 'get_shelf' tool: parses the shelf ID from arguments and calls the BookStack client's getShelf method, then formats the API response.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)Input schema definition for the 'get_shelf' tool, specifying the required 'id' parameter as a number.{ 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)Core helper function in BookStackClient that performs the API GET request to retrieve a 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)Registration of content tools (including 'get_shelf') into the MCP server's allTools list, which is returned in listTools handler.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];