Skip to main content
Glama
amotivv

Web Content MCP Server

search_documentation

Find specific information in Cloudflare documentation by entering a search query. This tool retrieves relevant content to assist with troubleshooting, implementation, or learning.

Instructions

Searches Cloudflare documentation and returns relevant content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of results to return
queryYesSearch query

Implementation Reference

  • Implementation of the search_documentation tool. Validates input, returns mock search results from Cloudflare documentation formatted as markdown.
    private async handleSearchDocumentation(args: any) {
      // Validate arguments
      if (typeof args !== 'object' || args === null || typeof args.query !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments for search_documentation');
      }
    
      const { query, maxResults = 3 } = args;
    
      try {
        // In a real implementation, you would:
        // 1. Use Cloudflare Browser Rendering to navigate to the docs
        // 2. Use the search functionality on the docs site
        // 3. Extract the search results
        
        // For this simulation, we'll return mock results
        const mockResults = [
          {
            title: 'Browser Rendering API Overview',
            url: 'https://developers.cloudflare.com/browser-rendering/',
            snippet: 'Cloudflare Browser Rendering is a serverless headless browser service that allows execution of browser actions within Cloudflare Workers.',
          },
          {
            title: 'REST API Reference',
            url: 'https://developers.cloudflare.com/browser-rendering/rest-api/',
            snippet: 'The REST API provides simple endpoints for common browser tasks like fetching content, taking screenshots, and generating PDFs.',
          },
          {
            title: 'Workers Binding API Reference',
            url: 'https://developers.cloudflare.com/browser-rendering/workers-binding/',
            snippet: 'For more advanced use cases, you can use the Workers Binding API with Puppeteer to automate browser interactions.',
          },
        ].slice(0, maxResults);
        
        // Format the results
        const formattedResults = mockResults.map(result => 
          `## [${result.title}](${result.url})\n${result.snippet}\n`
        ).join('\n');
        
        return {
          content: [
            {
              type: 'text',
              text: `# Search Results for "${query}"\n\n${formattedResults}`,
            },
          ],
        };
      } catch (error) {
        console.error('Error searching documentation:', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error searching documentation: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/server.ts:80-97 (registration)
    Registration of the search_documentation tool in the ListTools response, including its schema definition.
    {
      name: 'search_documentation',
      description: 'Searches Cloudflare documentation and returns relevant content',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query',
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return',
          },
        },
        required: ['query'],
      },
    },
  • Input schema definition for the search_documentation tool.
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Search query',
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of results to return',
        },
      },
      required: ['query'],
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'returns relevant content' but doesn't specify what 'relevant' means, whether results are ranked, if there's pagination, rate limits, authentication requirements, or what format/content is returned. This leaves significant behavioral aspects unclear.

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 states the core functionality without unnecessary words. It's appropriately sized and front-loaded with the essential information.

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 search tool with no annotations and no output schema, the description is inadequate. It doesn't explain what constitutes 'relevant content', how results are structured, whether there are limitations or constraints, or how this differs from sibling tools that also retrieve content.

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%, with both parameters clearly documented in the schema. The description doesn't add any meaningful parameter semantics beyond what the schema already provides, so it meets the baseline of 3 for high schema coverage without adding value.

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 action ('Searches') and target resource ('Cloudflare documentation'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'fetch_page' or 'extract_structured_content' which might also retrieve documentation content.

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?

No guidance is provided about when to use this tool versus alternatives like 'fetch_page' for direct retrieval or 'extract_structured_content' for processing. The description only states what it does, not when it's appropriate or what distinguishes it from sibling tools.

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

Related 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/amotivv/cloudflare-browser-rendering'

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