Skip to main content
Glama

list_shelves

Retrieve a paginated list of shelves accessible to the user from a BookStack wiki instance, with options to sort results and control page size.

Instructions

Get a listing of shelves visible to the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of items per page
pageNoPage number for pagination
sortNoSort parameter

Implementation Reference

  • The handler function for the 'list_shelves' tool within handleContentTool. It validates input with PaginationSchema, calls the BookStackClient's getShelves method, and formats the paginated API response.
    case "list_shelves": { const params = PaginationSchema.parse(args); const result = await client.getShelves(params); return formatApiResponse(result.data, result.total); }
  • The input schema and metadata definition for the 'list_shelves' tool, returned by createContentTools for MCP tool listing.
    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" }, }, }, }, {
  • The BookStackClient method implementing the API call to list shelves, using the private 'get' helper for paginated GET request to /shelves endpoint.
    async getShelves(params?: PaginationParams): Promise<ApiResponse<Shelf[]>> { return this.get<Shelf>("/shelves", params); }
  • src/index.ts:124-127 (registration)
    Registration and dispatch logic in the MCP call tool handler, routing 'list_shelves' (included in contentToolNames) to handleContentTool.
    if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient);
  • src/index.ts:62-66 (registration)
    MCP list tools request handler registration, providing allTools which includes 'list_shelves' from createContentTools.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lautarobarba/bookstack_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server