Skip to main content
Glama

fetch_html_to_markdown

Read-onlyIdempotent

Fetch a URL, decode HTML, and convert it to clean markdown for LLM use. Strips scripts, styles, nav, and footer while preserving headings, lists, links, and code.

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.

Input Schema

TableJSON 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)
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. 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)"
  2. First observedv0.6.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, and non-destructive behavior. The description adds valuable context beyond that: stripping of scripts/styles/nav/footer elements, redirect following, size/timeout limits, and default private-host blocking. It enriches the agent's mental model without contradicting annotations.

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 with no wasted words. The core action is front-loaded, followed by stripping behavior, use case, and safety characteristics. Every sentence contributes meaningful information.

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?

For a tool with 6 params and no output schema, the description covers the key behavior: input URL, output markdown, stripping rules, limits, and security. It doesn't detail error handling or edge cases, but the essential call semantics are clear. Slightly more on failure modes would push it to 5.

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 coverage is 100%, so the baseline is 3. The description's mention of 'size/timeout limits' and 'blocks private-host requests' aligns with parameters but adds no new syntax or format details beyond the schema. It does not compensate for anything missing, which is fine given full schema coverage.

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 verb 'GET', the resource 'a URL', and the outcome 'convert to clean markdown', which distinguishes it from raw fetch tools. However, it does not explicitly differentiate from the sibling fetch_html_to_text, leaving the boundary between markdown and text extraction implicit.

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

Usage Guidelines3/5

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

It provides a clear intended use ('feeding web pages into an LLM cheaply') and explains the size benefit, which signals when to use it. But it does not mention when NOT to use it or name alternatives like fetch_html_to_text, so the guidance is implied rather than explicit.

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