Skip to main content
Glama
tahaswx

Serper Search and Scrape MCP Server

by tahaswx

scrape

Extract webpage content including text, metadata, and optional markdown formatting from any URL to gather structured information for analysis or processing.

Instructions

Tool to scrape a webpage and retrieve the text and, optionally, the markdown content. It will retrieve also the JSON-LD metadata and the head metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the webpage to scrape.
includeMarkdownNoWhether to include markdown content.

Implementation Reference

  • The scrape method in SerperSearchTools class is the primary handler that executes the scrape tool logic, delegating to the SerperClient and handling errors.
    async scrape(params: IScrapeParams): Promise<IScrapeResult> {
      try {
        const result = await this.serperClient.scrape(params);
        return result;
      } catch (error) {
        throw new Error(`SearchTool: failed to scrape. ${error}`);
      }
    }
  • The MCP tool call handler for 'scrape' - extracts URL and includeMarkdown parameters from the request, calls searchTools.scrape(), and returns the JSON result.
    case "scrape": {
      const url = request.params.arguments?.url as string;
      const includeMarkdown = request.params.arguments
        ?.includeMarkdown as boolean;
      const result = await searchTools.scrape({ url, includeMarkdown });
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • src/index.ts:143-162 (registration)
    Registration of the 'scrape' tool with its name, description, and inputSchema defining url (required) and includeMarkdown (optional boolean) parameters.
    {
      name: "scrape",
      description:
        "Tool to scrape a webpage and retrieve the text and, optionally, the markdown content. It will retrieve also the JSON-LD metadata and the head metadata.",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "The URL of the webpage to scrape.",
          },
          includeMarkdown: {
            type: "boolean",
            description: "Whether to include markdown content.",
            default: false,
          },
        },
        required: ["url"],
      },
    },
  • IScrapeParams interface defines the input schema with url (string) and optional includeMarkdown (boolean) for the scrape tool.
     * Scrape parameters for Serper API.
     */
    export interface IScrapeParams {
      url: string;
      includeMarkdown?: boolean;
    }
  • IScrapeResult interface defines the output schema with text, optional markdown, metadata, jsonld, and credits fields returned by the scrape operation.
     * Represents the result of a scrape operation from the Serper API.
     */
    export interface IScrapeResult {
      text: string;
      markdown?: string;
      metadata?: Record<string, string>;
      jsonld?: Record<string, any>;
      credits?: number;
    }
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 states the tool retrieves content and metadata, but doesn't cover important behavioral aspects such as rate limits, authentication needs, error handling, or performance characteristics (e.g., timeouts). For a web scraping tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves in practice.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, stating the core functionality in the first sentence. It uses two sentences efficiently to cover outputs and metadata. There's no wasted text, but it could be slightly more structured (e.g., separating primary and secondary outputs).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (web scraping with metadata), no annotations, and no output schema, the description is minimally adequate. It covers what the tool does and outputs but lacks details on behavioral traits, error cases, or return format specifics. With 100% schema coverage, it meets basic needs but doesn't fully compensate for the lack of annotations and output schema.

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 both parameters ('url' and 'includeMarkdown') with clear descriptions. The description adds no additional meaning beyond what the schema provides—it mentions retrieving markdown content optionally but doesn't elaborate on parameter usage or constraints. 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: 'scrape a webpage and retrieve the text and, optionally, the markdown content' plus metadata extraction. It specifies the verb ('scrape'), resource ('webpage'), and outputs (text, markdown, JSON-LD, head metadata). However, it doesn't explicitly differentiate from the sibling tool 'google_search', which likely serves a different search function rather than direct webpage scraping.

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 mentions what the tool does but doesn't specify scenarios for its use, prerequisites, or comparisons to the sibling 'google_search' tool. There's an implied usage for extracting content from a webpage, but no explicit when/when-not instructions or alternative recommendations.

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/tahaswx/mcp-server-serper'

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