Skip to main content
Glama
ttpears

BookStack MCP Server

by ttpears

Search Pages

search_pages

Find pages in BookStack by search query, optionally filtering results to specific books for targeted documentation discovery.

Instructions

Search specifically for pages with optional book filtering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for pages
book_idNoFilter results to pages within a specific book
countNoNumber of results to return
offsetNoPagination offset

Implementation Reference

  • The actual implementation of the search_pages tool logic.
    async searchPages(query: string, options?: {
      bookId?: number;
      count?: number;
      offset?: number;
    }): Promise<any> {
      let searchQuery = `{type:page} ${query}`.trim();
    
      // Add book filtering if specified
      if (options?.bookId) {
        searchQuery = `{book_id:${options.bookId}} ${searchQuery}`;
      }
    
      const params: any = { query: searchQuery };
      if (options?.count) params.count = Math.min(options.count, 500);
      if (options?.offset) params.offset = options.offset;
    
      const response = await this.client.get('/search', { params });
      const results = response.data.data || response.data;
    
      return await this.enhanceSearchResults(results, query);
    }
  • src/index.ts:84-106 (registration)
    The registration of the search_pages tool in the MCP server.
    server.registerTool(
      "search_pages",
      {
        title: "Search Pages",
        description: "Search specifically for pages with optional book filtering",
        inputSchema: {
          query: z.string().describe("Search query for pages"),
          book_id: z.coerce.number().optional().describe("Filter results to pages within a specific book"),
          count: z.coerce.number().max(500).optional().describe("Number of results to return"),
          offset: z.coerce.number().optional().describe("Pagination offset")
        }
      },
      async (args) => {
        const results = await client.searchPages(args.query, {
          bookId: args.book_id,
          count: args.count,
          offset: args.offset
        });
        return {
          content: [{ type: "text", text: JSON.stringify(results, 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 only states the basic action ('search') without mentioning permissions, rate limits, pagination behavior (implied by 'offset' but not explained), or what happens on errors. For a search tool with 4 parameters and no annotations, this is a significant gap in transparency.

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 front-loaded with the core purpose and includes a key constraint ('optional book filtering'), making it easy to parse quickly. 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?

Given the tool's complexity (4 parameters, no output schema, no annotations), the description is incomplete. It lacks details on return values, error handling, and behavioral traits. While the schema covers parameters well, the overall context for safe and effective use is insufficient, especially for a search operation that might involve pagination and filtering.

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 the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by implying that 'book_id' is for filtering, but it doesn't provide additional context like search syntax or result ordering. This meets the baseline for high schema coverage.

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: 'Search specifically for pages with optional book filtering'. It specifies the verb ('search'), resource ('pages'), and scope ('with optional book filtering'), making the intent unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'search_content' or 'get_pages', which prevents a perfect score.

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 minimal guidance: it mentions 'optional book filtering' but doesn't explain when to use this tool versus alternatives like 'search_content' or 'get_pages'. There's no context about prerequisites, exclusions, or specific scenarios where this tool is preferred, leaving the agent with insufficient direction.

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