list_shelves
Retrieve a paginated list of shelves available to the user in BookStack, supporting sorting and page navigation.
Instructions
Get a listing of shelves visible to the user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| count | No | Number of items per page | |
| sort | No | Sort parameter |
Implementation Reference
- src/tools/content-tools.ts:733-737 (handler)Executes the list_shelves tool by parsing pagination parameters and fetching shelves from BookStackClient.case "list_shelves": { const params = PaginationSchema.parse(args); const result = await client.getShelves(params); return formatApiResponse(result.data, result.total); }
- src/tools/content-tools.ts:424-435 (schema)Defines the input schema and metadata for the list_shelves tool.{ name: "list_shelves", description: "Get a listing of shelves visible to the user", inputSchema: { type: "object", properties: { page: { type: "number", description: "Page number for pagination" }, count: { type: "number", description: "Number of items per page" }, sort: { type: "string", description: "Sort parameter" }, }, }, },
- src/index.ts:124-130 (registration)Routes execution of list_shelves (included in contentToolNames) to the content tools handler.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else { throw new Error(`Unknown tool: ${name}`); }
- src/index.ts:56-59 (registration)Registers the list_shelves tool schema by including it from createContentTools in the MCP server's tool list.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];