Skip to main content
Glama
tatn

MCP Server Fetch Python

by tatn

get-markdown

Convert web page content to structured Markdown, preserving tables and definition lists. Ideal for extracting clean, readable text from HTML while maintaining document integrity.

Instructions

Converts web page content to well-formatted Markdown, preserving structural elements like tables and definition lists. Recommended as the default tool for web content extraction when a clean, readable text format is needed while maintaining document structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the target web page (ordinary HTML, etc.).

Implementation Reference

  • Handler logic for the 'get-markdown' tool: fetches rendered HTML via Playwright and converts it to Markdown using the MarkItDown library's HtmlConverter.
    elif name == "get-markdown":
        parsed_html = await get_parsed_html_string_by_playwright(url)
        result:_markitdown.DocumentConverterResult = _markitdown.HtmlConverter().convert_string(parsed_html)  # noqa: E501
        result_string = str(result.text_content)
  • Registration of the 'get-markdown' tool within the @server.list_tools() response, including its description and input schema.
    types.Tool(
         name="get-markdown",
         description="Converts web page content to well-formatted Markdown, preserving structural elements like tables and definition lists. Recommended as the default tool for web content extraction when a clean, readable text format is needed while maintaining document structure.",  # noqa: E501
         inputSchema={
             "type": "object",
             "properties": {
                 "url": {"type": "string", "description":"URL of the target web page (ordinary HTML, etc.)."}  # noqa: E501
             },
             "required": ["url"],
         },
     ),
  • Input JSON schema for the 'get-markdown' tool: an object requiring a 'url' string property.
    inputSchema={
        "type": "object",
        "properties": {
            "url": {"type": "string", "description":"URL of the target web page (ordinary HTML, etc.)."}  # noqa: E501
        },
        "required": ["url"],
    },
  • Helper function to retrieve fully rendered HTML content from a URL using Playwright headless browser, crucial for the get-markdown handler.
    async def get_parsed_html_string_by_playwright(url:str)->str:
        
        async with async_playwright() as p:
            browser = await p.chromium.launch()
            page = await browser.new_page()
            await page.goto(url)
            parsed_html = await page.content()
            await browser.close()
            return parsed_html
Behavior3/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 describes the tool's behavior ('preserving structural elements like tables and definition lists') and output format ('well-formatted Markdown'), but lacks details on error handling, rate limits, or authentication needs. It's adequate but has gaps in behavioral disclosure.

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?

Two sentences, zero waste: the first states the purpose and key features, the second provides usage guidance. It's front-loaded with the core functionality and efficiently structured without redundancy.

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

Completeness4/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 (single parameter, no output schema, no annotations), the description is mostly complete: it covers purpose, usage, and behavioral traits. However, it lacks details on output format specifics or error cases, leaving some gaps in context.

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 the 'url' parameter. The description adds context by specifying the type of web page ('ordinary HTML, etc.') and the goal of conversion, but doesn't provide additional syntax or format details beyond what the schema implies. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Converts web page content to well-formatted Markdown') and resource ('web page'), and distinguishes it from siblings by mentioning it's 'Recommended as the default tool for web content extraction' and preserves structural elements like tables and definition lists, unlike get-raw-text which likely doesn't preserve structure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly provides when to use ('Recommended as the default tool for web content extraction when a clean, readable text format is needed while maintaining document structure') and implies alternatives (siblings like get-raw-text for less structured extraction or get-rendered-html for HTML output), giving clear context for selection.

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

Related 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/tatn/mcp-server-fetch-python'

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