Skip to main content
Glama
amotivv

cloudflare-browser-rendering-mcp

summarize_content

Extract concise summaries of web content to optimize context for large language models, enabling efficient content processing directly from Cloudflare Browser Rendering.

Instructions

Summarizes web content for more concise LLM context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxLengthNoMaximum length of the summary
urlYesURL to summarize

Implementation Reference

  • Main handler function that executes the summarize_content tool logic. Validates input, provides mock summary (intended to fetch, process, and summarize real content in production).
      private async handleSummarizeContent(args: any) {
        // Validate arguments
        if (typeof args !== 'object' || args === null || typeof args.url !== 'string') {
          throw new McpError(ErrorCode.InvalidParams, 'Invalid arguments for summarize_content');
        }
    
        const { url, maxLength = 500 } = args;
    
        try {
          // In a real implementation, you would:
          // 1. Fetch the page content using Cloudflare Browser Rendering
          // 2. Process the content for LLM
          // 3. Call an LLM API to summarize the content
          
          // For this simulation, we'll return a mock summary
          const mockSummary = `
    # Browser Rendering API Summary
    
    Cloudflare Browser Rendering is a serverless headless browser service for Cloudflare Workers that enables:
    
    1. Rendering JavaScript-heavy websites
    2. Taking screenshots and generating PDFs
    3. Extracting structured data
    4. Automating browser interactions
    
    It offers two main interfaces:
    
    - **REST API**: Simple endpoints for common tasks
    - **Workers Binding API**: Advanced integration with Puppeteer
    
    The service runs within Cloudflare's network, providing low-latency access to browser capabilities without managing infrastructure.
          `.trim();
          
          // Truncate if necessary
          const truncatedSummary = mockSummary.length > maxLength
            ? mockSummary.substring(0, maxLength) + '...'
            : mockSummary;
          
          return {
            content: [
              {
                type: 'text',
                text: truncatedSummary,
              },
            ],
          };
        } catch (error) {
          console.error('[Error] Error summarizing content:', error);
          return {
            content: [
              {
                type: 'text',
                text: `Error summarizing content: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
  • Input schema definition for the summarize_content tool, registered in the ListTools handler.
      name: 'summarize_content',
      description: 'Summarizes web content for more concise LLM context',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'URL to summarize',
          },
          maxLength: {
            type: 'number',
            description: 'Maximum length of the summary',
          },
        },
        required: ['url'],
      },
    },
  • src/server.ts:192-194 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement.
    case 'summarize_content':
      console.error(`[API] Summarizing content from: ${args?.url}`);
      return await this.handleSummarizeContent(args);
  • Supporting summarizeContent method in ContentProcessor class (mock implementation, not directly used by the tool handler but imported).
      summarizeContent(content: string, maxLength: number = 500): string {
        // In a real implementation, you would call an LLM API here
        console.error('[API] Simulating content summarization...');
        
        // For this simulation, we'll return a mock summary
        const mockSummary = `
    # Browser Rendering API Summary
    
    Cloudflare Browser Rendering is a serverless headless browser service for Cloudflare Workers that enables:
    
    1. Rendering JavaScript-heavy websites
    2. Taking screenshots and generating PDFs
    3. Extracting structured data
    4. Automating browser interactions
    
    It offers two main interfaces:
    
    - **REST API**: Simple endpoints for common tasks
    - **Workers Binding API**: Advanced integration with Puppeteer
    
    The service runs within Cloudflare's network, providing low-latency access to browser capabilities without managing infrastructure.
        `.trim();
        
        // Truncate if necessary
        return mockSummary.length > maxLength
          ? mockSummary.substring(0, maxLength) + '...'
          : mockSummary;
      }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'summarizes web content' but doesn't describe how it works (e.g., extraction method, processing time, error handling), what limitations exist (e.g., supported content types, rate limits), or what the output looks like. This leaves significant gaps in understanding the tool's behavior.

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 clear goal, making it appropriately sized and well-structured for quick understanding.

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 summarizing web content, no annotations, and no output schema, the description is incomplete. It doesn't explain the return format, potential errors, or behavioral traits like content processing methods. For a tool with 2 parameters and significant operational implications, more context is needed.

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, clearly documenting both parameters ('url' and 'maxLength'). The description adds no additional parameter semantics beyond what the schema provides, such as format details for 'url' or typical values for 'maxLength'. 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 ('summarizes') and resource ('web content'), and it provides the goal ('for more concise LLM context'). However, it doesn't explicitly differentiate from sibling tools like 'extract_structured_content' or 'fetch_page', which might have overlapping 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 provides no guidance on when to use this tool versus alternatives like 'extract_structured_content' or 'fetch_page'. It doesn't mention prerequisites, exclusions, or specific contexts where this summarization tool is preferred over other content-handling siblings.

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-mcp'

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