Skip to main content
Glama
MyBlockcities

MCP Server Template for Cursor IDE

mcp_fetch

Fetch website content for analysis or integration by providing a URL to retrieve HTML and text data.

Instructions

Fetches a website and returns its content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to fetch

Implementation Reference

  • Core handler function that implements the mcp_fetch tool logic by fetching website content via httpx and handling errors.
    async def fetch_website(
        url: str,
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        headers = {
            "User-Agent": "MCP Test Server (github.com/modelcontextprotocol/python-sdk)"
        }
        try:
            timeout = httpx.Timeout(10.0, connect=5.0)
            async with httpx.AsyncClient(
                follow_redirects=True, 
                headers=headers,
                timeout=timeout
            ) as client:
                response = await client.get(url)
                response.raise_for_status()
                return [types.TextContent(type="text", text=response.text)]
        except httpx.TimeoutException:
            return [types.TextContent(
                type="text",
                text="Error: Request timed out while trying to fetch the website."
            )]
        except httpx.HTTPStatusError as e:
            return [types.TextContent(
                type="text",
                text=(f"Error: HTTP {e.response.status_code} "
                      "error while fetching the website.")
            )]
        except Exception as e:
            return [types.TextContent(
                type="text",
                text=f"Error: Failed to fetch website: {str(e)}"
            )]
  • Dispatch logic in the call_tool handler that invokes fetch_website for mcp_fetch.
    if name == "mcp_fetch":
        if "url" not in arguments:
            return [types.TextContent(
                type="text",
                text="Error: Missing required argument 'url'"
            )]
        return await fetch_website(arguments["url"])
  • Tool registration including name, description, and input schema for mcp_fetch.
    types.Tool(
        name="mcp_fetch",
        description="Fetches a website and returns its content",
        inputSchema={
            "type": "object",
            "required": ["url"],
            "properties": {
                "url": {
                    "type": "string",
                    "description": "URL to fetch",
                }
            },
        },
  • Input schema definition for the mcp_fetch tool.
    types.Tool(
        name="mcp_fetch",
        description="Fetches a website and returns its content",
        inputSchema={
            "type": "object",
            "required": ["url"],
            "properties": {
                "url": {
                    "type": "string",
                    "description": "URL to fetch",
                }
            },
        },
Behavior2/5

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

With no annotations provided, the description carries full burden but only states basic functionality. It doesn't disclose important behavioral traits like error handling, rate limits, authentication needs, content type handling, or what 'returns its content' specifically means (HTML, text, metadata).

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 - just 7 words that directly convey the core functionality. Every word earns its place with zero wasted text, making it perfectly front-loaded and efficient.

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?

For a tool that fetches websites with no annotations and no output schema, the description is insufficient. It doesn't explain what 'content' means, how errors are handled, what formats are supported, or any limitations. The agent would have to guess about important behavioral aspects.

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 description doesn't add any parameter information beyond what's already in the schema (which has 100% coverage). The schema fully documents the single 'url' parameter, so the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't need to.

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 action ('fetches') and resource ('a website'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'mood' (which appears unrelated), so it doesn't fully achieve sibling distinction.

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 or any contextual prerequisites. It simply states what the tool does without indicating appropriate use cases or limitations.

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/MyBlockcities/mcp-server-heroku'

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