Skip to main content
Glama
ttpears

BookStack MCP Server

by ttpears

List Chapters

get_chapters

Retrieve chapter listings from BookStack documentation, with options to filter by specific book ID and manage pagination for organized content navigation.

Instructions

List chapters, optionally filtered by book

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
book_idNoFilter by book ID
offsetNoPagination offset
countNoNumber of results to return

Implementation Reference

  • The implementation of the getChapters method which fetches chapters from the API.
    async getChapters(bookId?: number, offset = 0, count = 50): Promise<any> {
      const params: any = { offset, count };
      if (bookId) params.filter = JSON.stringify({ book_id: bookId });
    
      const response = await this.client.get('/chapters', { params });
      const data = response.data;
    
      return {
        ...data,
        data: await Promise.all(data.data.map((chapter: Chapter) => this.enhanceChapterResponse(chapter)))
      };
    }
  • src/index.ts:196-213 (registration)
    Registration of the 'get_chapters' tool and the request handler.
    server.registerTool(
      "get_chapters",
      {
        title: "List Chapters",
        description: "List chapters, optionally filtered by book",
        inputSchema: {
          book_id: z.coerce.number().optional().describe("Filter by book ID"),
          offset: z.coerce.number().default(0).describe("Pagination offset"),
          count: z.coerce.number().default(50).describe("Number of results to return")
        }
      },
      async (args) => {
        const chapters = await client.getChapters(args.book_id, args.offset, args.count);
        return {
          content: [{ type: "text", text: JSON.stringify(chapters, null, 2) }]
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose whether this is a read-only operation, pagination behavior (implied by offset/count but not explained), rate limits, authentication needs, or what the return format looks like (since no output schema exists).

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 wasted words. It's front-loaded with the core purpose and includes the key optional filtering feature. Every word earns its place.

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?

For a list tool with 3 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'chapters' means in this context, how results are ordered, what fields are returned, or error conditions. The agent must rely entirely on the schema for parameter details and guess at behavior.

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?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds minimal value by mentioning 'optionally filtered by book', which aligns with the book_id parameter but doesn't provide additional context beyond what the schema already states.

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 verb 'List' and resource 'chapters', with optional filtering by book. It distinguishes from sibling tools like get_chapter (singular) and get_books, but doesn't explicitly differentiate from get_pages or search_content which might overlap in functionality.

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 mentions optional filtering by book, but provides no guidance on when to use this tool versus alternatives like get_chapter (for a specific chapter), get_pages (for pages within chapters), or search_content (for more complex queries). No prerequisites, exclusions, or context for selection are provided.

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