Skip to main content
Glama
cryppadotta
by cryppadotta

search_pages

Find wiki pages by entering keywords to locate relevant information quickly.

Instructions

Search for pages in the wiki using keywords

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query string
limitNoMaximum number of results to return (default: 10, max: 50)

Implementation Reference

  • MCP tool call handler for 'search_pages': extracts parameters, calls wikiClient.searchPages, formats results into JSON response with total hits and page details.
    case "search_pages": {
      const { query, limit = 10 } = request.params.arguments as {
        query: string;
        limit?: number;
      };
      const result = await wikiClient.searchPages(query, Math.min(limit, 50));
    
      // Format search results in a readable way
      const pages = result.query.search.map((page: any) => ({
        title: page.title,
        snippet: page.snippet,
        size: page.size,
        wordCount: page.wordcount,
        timestamp: page.timestamp
      }));
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                totalHits: result.query.searchinfo.totalhits,
                pages
              },
              null,
              2
            )
          }
        ]
      };
    }
  • MediaWikiClient.searchPages method: performs the actual MediaWiki API search query using makeApiCall.
    async searchPages(query: string, limit: number = 10): Promise<any> {
      return this.makeApiCall({
        action: "query",
        list: "search",
        srsearch: query,
        srlimit: limit,
        srinfo: "totalhits",
        srprop: "size|wordcount|timestamp|snippet"
      });
    }
  • Tool object definition with name 'search_pages', description, and inputSchema specifying query (required) and optional limit.
    const SEARCH_PAGES_TOOL: Tool = {
      name: "search_pages",
      description: "Search for pages in the wiki using keywords",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Search query string"
          },
          limit: {
            type: "number",
            description:
              "Maximum number of results to return (default: 10, max: 50)",
            default: 10
          }
        },
        required: ["query"]
      }
    };
  • index.ts:597-607 (registration)
    Registers SEARCH_PAGES_TOOL in the MCP server's listTools response, making it discoverable.
    // Register the tools
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        SEARCH_PAGES_TOOL,
        READ_PAGE_TOOL,
        CREATE_PAGE_TOOL,
        UPDATE_PAGE_TOOL,
        GET_PAGE_HISTORY_TOOL,
        GET_CATEGORIES_TOOL
      ]
    }));
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. The description only states the basic action ('search for pages') without covering key behavioral traits such as whether this is a read-only operation, how results are sorted or ranked, if there are rate limits, authentication requirements, or what the return format looks like. For a search tool with zero annotation coverage, 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 that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every part earning its place by conveying the core functionality. There is zero waste or redundancy.

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 of a search operation, lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns (e.g., page titles, snippets, IDs), how results are structured, or any behavioral aspects like pagination or error handling. The description alone is insufficient for an agent to fully understand how to use this tool effectively in context.

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 input schema has 100% description coverage, with clear documentation for both parameters ('query' and 'limit'), including defaults and constraints. The description adds no additional parameter semantics beyond what the schema provides, such as explaining search syntax or result types. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 as 'Search for pages in the wiki using keywords', which includes a specific verb ('search'), resource ('pages in the wiki'), and method ('using keywords'). However, it doesn't explicitly distinguish this search tool from potential sibling alternatives like 'read_page' or 'get_categories', which could also involve finding content. The description is clear but lacks sibling differentiation.

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 when to prefer 'search_pages' over 'read_page' for finding specific content, or how it relates to 'get_categories' for browsing. There are no exclusions, prerequisites, or context provided, leaving the agent to infer usage from the tool name alone.

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/cryppadotta/mcp-wizzypedia'

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