Skip to main content
Glama
sidney

web-to-markdown-mcp

by sidney

fetch_url_as_markdown

Fetches a URL and extracts the main content as clean Markdown, using headless Chromium for JavaScript-rendered or bot-protected sites.

Instructions

Fetch a URL and return the main content as Markdown.

First tries a plain HTTP request with an Accept: text/markdown header. If the server responds with Content-Type: text/markdown (e.g. Cloudflare Markdown for Agents sites), the body is returned immediately without launching a browser.

Otherwise, uses patchright (a Playwright fork with anti-detection patches) to drive real Chromium, which clears most Cloudflare bot challenges and renders JavaScript-required pages. A single headless Chromium instance is kept alive across calls so subsequent fetches avoid the browser cold-start cost (~2-5s). After navigation, polls the page DOM and runs trafilatura, returning as soon as the extracted Markdown stabilizes across two consecutive polls — typically within a few hundred milliseconds of the DOM being built, regardless of whether trackers, ads, and analytics are still loading in the background.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to fetch.
wait_untilNoWhen the navigation step is considered complete. "domcontentloaded" (default) returns when the HTML is parsed and the DOM is built. "load" waits for all subresources (images, scripts, stylesheets) — slower and rarely needed since content-stabilization polling runs after this. "networkidle" waits for network to quiet — best for SPAs but sometimes hangs on pages with persistent connections. "commit" returns as soon as the response starts.domcontentloaded
timeout_msNoNavigation timeout in milliseconds. Default 60000. This is the budget for the navigation step only; content extraction has its own separate budget (poll_budget_ms).
headlessNoWhether to run Chromium headless. Default True. Set to False to use a visible browser window — slower and pops a Chromium window on screen, but clears bot-detection challenges (Cloudflare, etc.) that block headless mode. If a fetch returns "ERROR: navigation timed out" or "ERROR: no extractable content" on a site that likely has bot protection, retry with headless=False. Requires a display, so headless=False fails on servers without a graphical environment unless a virtual display like Xvfb is configured.
poll_budget_msNoMaximum time after navigation to wait for content extraction to stabilize. Default 5000. Increase for slow SPAs that progressively render content over many seconds, or when using headless=False on bot-protected sites where the challenge takes time to resolve — 10000-15000 is reasonable for the latter.
poll_interval_msNoHow often to re-attempt extraction during polling. Default 250.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully discloses behavioral traits: two-phase fetch with plain HTTP then headless Chromium, browser reuse to avoid cold starts, polling for content stabilization, and the headless=False option for bot challenges. No contradictions.

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 detailed yet efficient, front-loading the main purpose and then elaborating on the process. Every sentence provides useful information without redundancy.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (so return values are covered elsewhere), the description covers all relevant aspects: parameter interactions, performance characteristics, error situations, and behavior under different conditions. It is fully adequate for an AI agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema alone documents each parameter well. The description adds value by explaining the relationship between timeout_ms and poll_budget_ms, as well as the purpose of wait_until options in the context of the extraction process.

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 'Fetch a URL and return the main content as Markdown,' specifying the verb and resource. No sibling tools exist, so differentiation is not needed, and the purpose is unambiguous.

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

Usage Guidelines4/5

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

The description explains the two-phase fetching strategy and provides concrete guidance for handling bot-protected sites (retry with headless=False). It does not explicitly state when not to use the tool, but the context is clear enough for an AI agent to understand typical 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/sidney/web-to-markdown-mcp'

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