Skip to main content
Glama
ttpears

BookStack MCP Server

by ttpears

List Shelves

get_shelves

Retrieve and manage book shelf collections in BookStack with filtering, sorting, and pagination controls.

Instructions

List available book shelves (collections) with filtering and sorting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
offsetNoPagination offset
countNoNumber of results to return
sortNoSort field
filterNoFilter criteria

Implementation Reference

  • The handler method in the Bookstack client that performs the actual API call to fetch shelves.
    async getShelves(options?: {
      offset?: number;
      count?: number;
      sort?: string;
      filter?: Record<string, any>;
    }): Promise<ListResponse<Shelf>> {
      const params: any = {
        offset: options?.offset || 0,
        count: Math.min(options?.count || 50, 500)
      };
      
      if (options?.sort) params.sort = options.sort;
      if (options?.filter) params.filter = JSON.stringify(options.filter);
      
      const response = await this.client.get('/shelves', { params });
      const data = response.data;
      
      return {
        ...data,
        data: data.data.map((shelf: Shelf) => this.enhanceShelfResponse(shelf))
      };
    }
  • src/index.ts:361-385 (registration)
    The MCP tool registration for 'get_shelves' which invokes the client's getShelves method.
    server.registerTool(
      "get_shelves",
      {
        title: "List Shelves",
        description: "List available book shelves (collections) with filtering and sorting",
        inputSchema: {
          offset: z.coerce.number().default(0).describe("Pagination offset"),
          count: z.coerce.number().max(500).default(50).describe("Number of results to return"),
          sort: z.string().optional().describe("Sort field"),
          filter: z.record(z.any()).optional().describe("Filter criteria")
        }
      },
      async (args) => {
        const shelves = await client.getShelves({
          offset: args.offset,
          count: args.count,
          sort: args.sort,
          filter: args.filter
        });
        return {
          content: [{ type: "text", text: JSON.stringify(shelves, null, 2) }]
        };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'filtering and sorting' but doesn't elaborate on how these work, what the response format looks like, whether there are rate limits, or if authentication is required. This is inadequate for a tool with 4 parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose and key features without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (4 parameters, no output schema, and no annotations), the description is incomplete. It lacks details on behavioral traits, response format, usage context relative to siblings, and doesn't compensate for the absence of annotations or output schema. This is a significant gap for a tool that likely returns structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all parameters (offset, count, sort, filter) with descriptions. The description adds marginal value by implying filtering and sorting capabilities, but doesn't provide additional syntax, format details, or examples beyond what the schema provides. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('List') and resource ('available book shelves (collections)'), and mentions capabilities ('filtering and sorting'). However, it doesn't explicitly distinguish this tool from its sibling 'get_shelf' (singular) or other list-like tools like 'get_books' or 'get_chapters', which would be needed for a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_shelf' (for single shelf retrieval), 'search_content', or 'search_pages' (which might overlap in functionality), nor does it specify prerequisites or exclusions for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ttpears/bookstack-mcp'

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