Skip to main content
Glama
kouui

DuckDuckGo Web Search MCP Server

by kouui

fetch

Convert web page HTML content to clean markdown format for easier reading and processing. Use this tool to extract and transform webpage text from any URL.

Instructions

scrape the html content and return the markdown format using jina api.

Args:
    url: The search query string

Returns:
    text : html in markdown format 

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Implementation Reference

  • main.py:155-170 (handler)
    The handler function for the 'fetch' MCP tool. Validates input URL, fetches content using the helper fetch_url, and returns markdown text.
    async def fetch(url: str):
        """
        scrape the html content and return the markdown format using jina api.
    
        Args:
            url: The search query string
    
        Returns:
            text : html in markdown format 
        """
        if not isinstance(url, str):
            raise ValueError("Query must be a non-empty string")
        
        text = await fetch_url(url)
        
        return text
  • main.py:154-154 (registration)
    MCP decorator registering the 'fetch' function as a tool.
    @mcp.tool()
  • Docstring providing input (url: str) and output (markdown text) schema for the fetch tool.
    """
    scrape the html content and return the markdown format using jina api.
    
    Args:
        url: The search query string
    
    Returns:
        text : html in markdown format 
    """
  • main.py:59-80 (helper)
    Helper function implementing the core fetching logic: uses Jina AI for HTML to markdown conversion with timeout fallback to raw HTML parsing.
    async def fetch_url(url: str):
        jina_timeout = 15.0
        raw_html_timeout = 5.0
        url = f"https://r.jina.ai/{url}"
        async with httpx.AsyncClient() as client:
            try:
                print(f"fetching result from\n{url}")
                response = await client.get(url, timeout=jina_timeout)
                """ using jina api to convert html to markdown """
                text = response.text
                return text
            except httpx.TimeoutException:
                try:
                    print("Jina API timed out, fetching raw HTML...")
                    response = await client.get(url, timeout=raw_html_timeout)
                    """ using raw html """
                    soup = BeautifulSoup(response.text, "html.parser")
                    text = soup.get_text()
                    return text
                except httpx.TimeoutException:
                    return "Timeout error"
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 using the Jina API and the transformation to markdown format, but doesn't disclose important behavioral traits: rate limits, authentication requirements, error handling, whether this makes external network calls, or what happens with invalid URLs. For a tool that performs web scraping with an external API, this is a significant gap.

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

Conciseness3/5

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

The description is brief but has structural issues. The first sentence is clear, but the 'Args:' and 'Returns:' sections use inconsistent formatting and terminology ('search query string' for a URL parameter). While concise, it could be more effectively structured with clearer separation of concerns.

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 no annotations, no output schema, and a tool that performs web scraping via an external API, the description is incomplete. It doesn't address important contextual aspects: error conditions, rate limits, authentication, what types of URLs are supported, or the structure/limitations of the returned markdown. For a tool with external dependencies and potential complexity, this is inadequate.

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 adds minimal parameter semantics beyond the schema. With 0% schema description coverage, the description states 'url: The search query string' which is somewhat confusing (calling it a 'search query string' when it's clearly a URL parameter). It doesn't explain URL format requirements, validation, or provide examples. The baseline would be lower given the coverage gap, but it does at least identify the parameter's purpose.

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 the html content and return the markdown format using jina api.' It specifies the verb (scrape/return), resource (html content), and transformation (to markdown format). However, it doesn't explicitly differentiate from its sibling tool 'search_and_fetch' - we can infer it's a direct fetch while the sibling might search first, but this isn't stated.

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 about when to use this tool versus alternatives. The description doesn't mention the sibling tool 'search_and_fetch' or explain when direct fetching is appropriate versus searching and fetching. There's no context about prerequisites, limitations, or appropriate use cases.

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/kouui/web-search-duckduckgo'

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