Skip to main content
Glama

fetch_html_to_markdown

Read-onlyIdempotent

Fetch a URL, strip scripts, styles, navigation, and footers, then convert the remaining HTML into clean Markdown for feeding web pages to LLMs at lower token cost.

Instructions

GET a URL, decode the HTML, and convert to clean markdown (headings, lists, links, code fences). Scripts, styles, iframes, nav, footer, and aside elements are stripped. Intended for feeding web pages into an LLM cheaply -- markdown is usually 3-8x smaller than raw HTML. Follows redirects, respects size/timeout limits, and blocks private-host requests by default.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "fetch_html_to_markdown"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesURL to fetch
max_bytesNoMax response size in bytes (default 5MiB)
timeout_msNoTimeout in ms for the request, covering DNS, every redirect hop and the body (default 10000); the HTML-to-markdown step gets its own budget of the same length
user_agentNoUser-Agent override
max_redirectsNoMax redirect hops (default 5)
allow_private_hostsNoAllow loopback / private / link-local targets for this call (default false). Refused unless the server operator launched fetch-mcp with FETCH_MCP_ALLOW_PRIVATE_HOSTS=1 -- SSRF protection stays on by default either way.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.6
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Timeout in ms for the request, covering DNS, every redirect hop and the body (default 10000)"New value: +"Timeout in ms for the request, covering DNS, every redirect hop and the body (default 10000); the HTML-to-markdown step gets its own budget of the same length"
  2. Changed2 schema fields changedv0.8.0
    • changedInput schema / properties / allow_private_hosts / description
      Previous value: -"Allow loopback / private / link-local addresses (default false)"New value: +"Allow loopback / private / link-local targets for this call (default false). Refused unless the server operator launched fetch-mcp with FETCH_MCP_ALLOW_PRIVATE_HOSTS=1 -- SSRF protection stays on by default either way."
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Request timeout in ms (default 10000)"New value: +"Timeout in ms for the request, covering DNS, every redirect hop and the body (default 10000)"
  3. First observedv0.6.1

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare this a safe, read-only, idempotent, open-world operation, so the description is free to add the behavior that matters: which elements are stripped (scripts, styles, iframes, nav, footer, aside), redirect following, size/timeout enforcement, and default SSRF blocking of private hosts. That is exactly the non-obvious operational context an agent needs before calling.

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?

Three sentences, front-loaded with the action, then the transformation details, then the operational constraints. Every clause carries information the agent cannot get from the schema or annotations.

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?

With no output schema and six parameters, the description adequately covers inputs, transformation behavior, and safety limits. It does not state what happens on non-HTML content types, HTTP error statuses, or whether the markdown is returned verbatim or wrapped in metadata, which are the remaining gaps for a fetch tool.

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 every parameter including the FETCH_MCP_ALLOW_PRIVATE_HOSTS environment caveat is already documented. The description only restates that size/timeout limits and private-host blocking exist, adding no syntax or defaults beyond the schema, which is the expected baseline-3 case.

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 names a specific verb chain (GET, decode, convert) and an explicit output format (clean markdown with headings, lists, links, code fences), which distinguishes it from the text-producing sibling fetch_html_to_text by output shape. It never names a sibling directly, so the differentiation is implicit rather than stated.

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?

"Intended for feeding web pages into an LLM cheaply" gives a clear use context with a stated benefit (3-8x smaller than raw HTML). It does not say when to prefer http_get, fetch_reader, or fetch_html_to_text instead, so the agent must infer the boundary from the format keyword.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.