Skip to main content
Glama
amotivv

Web Content MCP Server

summarize_content

Generate concise summaries of web content directly from URLs, optimizing for LLM context by specifying maximum summary length.

Instructions

Summarizes web content for more concise LLM context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxLengthNoMaximum length of the summary
urlYesURL to summarize

Implementation Reference

  • Primary handler for executing the 'summarize_content' tool. Validates parameters, simulates content fetching and summarization, returns mock summary as text content.
      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 summarizing content:', error);
          return {
            content: [
              {
                type: 'text',
                text: `Error summarizing content: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
  • src/server.ts:119-136 (registration)
    Registration of the 'summarize_content' tool in the ListToolsRequestSchema handler, including name, description, and input schema definition.
    {
      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'],
      },
    },
  • Input schema definition for the 'summarize_content' tool, specifying required 'url' and optional 'maxLength' parameters.
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: 'URL to summarize',
        },
        maxLength: {
          type: 'number',
          description: 'Maximum length of the summary',
        },
      },
      required: ['url'],
    },
  • Helper method in ContentProcessor class for summarizing content. Provides identical mock summary logic, though not directly called by the tool handler.
      summarizeContent(content: string, maxLength: number = 500): string {
        // In a real implementation, you would call an LLM API here
        console.log('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 mentions the tool 'summarizes web content' but fails to describe key behaviors such as how the summarization is performed (e.g., algorithm, quality), potential rate limits, error handling, or what the output looks like. This leaves significant gaps in understanding the tool's operation.

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 any redundant information. It is appropriately sized and front-loaded, making it easy to understand at a glance.

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 lack of annotations and output schema, the description is incomplete. It doesn't address the tool's behavior, output format, or error conditions, which are crucial for a tool that processes web content. The high schema coverage helps with parameters, but overall context is insufficient for effective use.

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 schema description coverage is 100%, so the schema already documents both parameters ('url' and 'maxLength') adequately. The description adds no additional meaning beyond what the schema provides, such as explaining the units for 'maxLength' or constraints on the 'url'. 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 with a specific verb ('summarizes') and resource ('web content'), and it provides the intended outcome ('for more concise LLM context'). However, it doesn't explicitly differentiate from sibling tools like 'extract_structured_content' or 'fetch_page', which might also process web content in different ways.

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 choose summarization over extraction or fetching, nor does it specify any prerequisites or exclusions for usage, leaving the agent to infer context 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

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