Skip to main content
Glama
garylab

Serper MCP Server

by garylab

webpage_scrape

Extract webpage content by URL to retrieve text and optionally include markdown formatting for analysis or processing.

Instructions

Scrape webpage by url

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe url to scrape
includeMarkdownNoInclude markdown in the response (boolean value as string: 'true' or 'false')false

Implementation Reference

  • Core handler function for webpage_scrape tool. Posts the request to the scrape.serper.dev API endpoint.
    async def scape(request: WebpageRequest) -> Dict[str, Any]:
        url = "https://scrape.serper.dev"
        return await fetch_json(url, request)
  • Dispatch handler in call_tool for the webpage_scrape tool, validates input and invokes scape.
    if name == SerperTools.WEBPAGE_SCRAPE.value:
        request = WebpageRequest(**arguments)
        result = await scape(request)
        return [TextContent(text=json.dumps(result, indent=2), type="text")]
  • Pydantic schema for input validation of webpage_scrape tool.
    class WebpageRequest(BaseModel):
        url: str = Field(..., description="The url to scrape")
        includeMarkdown: Optional[str] = Field(
            "false",
            pattern=r"^(true|false)$",
            description="Include markdown in the response (boolean value as string: 'true' or 'false')",
        )
  • Registration of the webpage_scrape tool in the MCP list_tools handler.
    tools.append(Tool(
        name=SerperTools.WEBPAGE_SCRAPE,
        description="Scrape webpage by url",
        inputSchema=WebpageRequest.model_json_schema(),
    ))
  • Enum definition providing the tool name constant.
    WEBPAGE_SCRAPE = "webpage_scrape"
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. It mentions scraping but doesn't disclose behavioral traits such as rate limits, authentication needs, potential blocking by websites, output format, or error handling. This leaves significant gaps for a tool that interacts with external web resources.

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 extremely concise with 'Scrape webpage by url'—a single, front-loaded sentence that wastes no words. It efficiently conveys the core action without unnecessary elaboration.

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 web scraping (external interactions, potential failures) and lack of annotations or output schema, the description is incomplete. It doesn't address key aspects like response format, error cases, or limitations, making it inadequate for safe and effective use by an AI agent.

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). The description adds no additional meaning beyond what's in the schema, such as examples or usage nuances, but the baseline is 3 since the schema provides adequate parameter details.

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 'Scrape webpage by url' clearly states the verb ('scrape') and resource ('webpage'), specifying the action and target. However, it doesn't differentiate from sibling tools (all Google Search variants), which are distinct in purpose but not explicitly contrasted here.

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. With sibling tools like google_search for general queries, there's no mention of when scraping is preferred over searching, nor any context about prerequisites or exclusions.

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

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