Skip to main content
Glama
garylab

Serper MCP Server

by garylab

webpage_scrape

Retrieve content from any webpage by providing its URL, with optional markdown output.

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

  • The async handler function that executes the webpage_scrape tool logic. It calls the Serper scrape endpoint (https://scrape.serper.dev) with the WebpageRequest payload via fetch_json.
    async def scape(request: WebpageRequest) -> Dict[str, Any]:
        url = "https://scrape.serper.dev"
        return await fetch_json(url, request)
  • Pydantic schema/input validation for WebpageRequest. Defines 'url' (required) and 'includeMarkdown' (optional, default 'false').
    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 server's list_tools() function. Defines the tool name from SerperTools.WEBPAGE_SCRAPE enum and its input schema.
    tools.append(Tool(
        name=SerperTools.WEBPAGE_SCRAPE,
        description="Scrape webpage by url",
        inputSchema=WebpageRequest.model_json_schema(),
    ))
  • Tool call handler dispatching logic. When name matches 'webpage_scrape', it creates a WebpageRequest from arguments and calls the scape() core handler.
    if name == SerperTools.WEBPAGE_SCRAPE.value:
        request = WebpageRequest(**arguments)
        result = await scape(request)
        return [TextContent(text=json.dumps(result, indent=2), type="text")]
  • Enum definition mapping SERPER_WEBPAGE_SCRAPE to the string 'webpage_scrape', used for consistent tool name references.
    WEBPAGE_SCRAPE = "webpage_scrape"
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only states 'Scrape webpage by url' without mentioning what is scraped (e.g., text, full HTML), rate limits, authentication, or error handling. The includeMarkdown parameter hints at output format but is not explained in the description.

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 a single short sentence, efficiently conveying the core purpose without unnecessary words. It is appropriately frontloaded, but could benefit from slight expansion for clarity (e.g., 'extract content').

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 tool's simplicity (2 parameters, no output schema, no annotations), the description is incomplete. It does not describe the return format, any limits or constraints, or what constitutes a successful scrape. The optional 'includeMarkdown' parameter suggests Markdown output, but this is not confirmed.

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 coverage is 100%, with descriptions for both 'url' and 'includeMarkdown'. The description adds no additional meaning beyond the schema, meeting the baseline of 3. No extra context is provided for parameter usage or constraints.

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 action (scrape) and resource (webpage by url). It distinguishes from sibling tools, which are all Google search related. However, it could be more specific about what 'scrape' entails (e.g., extract content, metadata).

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 on when to use this tool versus alternatives. Siblings are search tools, but the description does not explicitly state when scraping is preferred over searching. No exclusions or context for use are given.

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