Skip to main content
Glama

html_to_markdown

Strip unnecessary elements from web pages or raw HTML to produce clean Markdown. Saves tokens by preserving only headings, lists, links, code blocks, and emphasis.

Instructions

Convert a URL or raw HTML string into clean Markdown. Strips navigation, ads, scripts, and boilerplate; preserves headings, lists, links, code blocks, and emphasis. Use instead of loading raw HTML into context — saves 85–98% of tokens compared to the original page. Accepts either a URL (fetched server-side) or an html parameter with raw HTML.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to fetch and convert (http:// or https://).
htmlNoRaw HTML string to convert directly (alternative to url).
maxCharsNoMax characters of Markdown to return (default 12000, max 50000).
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 discloses that the tool strips navigation, ads, scripts, etc., and saves tokens. However, it omits behavioral details such as error handling (e.g., invalid URLs), rate limits, or whether the tool is purely read-only. These gaps reduce transparency.

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 three sentences, front-loaded with the core purpose, and every sentence adds essential information. There is no redundancy or filler.

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 lack of output schema and annotations, the description covers the main functionality and use case reasonably well. It explains the input options and token savings. However, it does not specify the output format (Markdown string) or mention potential limitations (e.g., maximum input size).

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 baseline is 3. The description adds value by stating that the 'url' parameter is fetched server-side and 'maxChars' has a default of 12000 and max of 50000, which is not in the schema. It also explains the dual parameter option ('url' vs 'html') clearly.

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 tool converts URL or raw HTML to Markdown, with specific verbs ('convert', 'strips', 'preserves') and resource ('URL or raw HTML string'). It distinguishes itself from loading raw HTML by highlighting token savings (85–98%). This is precise and actionable.

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 explicitly recommends using this tool instead of loading raw HTML to save tokens, which is a clear usage guideline. However, it does not explicitly mention when not to use it or compare it to sibling tools like fetch_extract or webpage_metadata, leaving some ambiguity for an AI agent.

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/icosaedro-git/toolsnap-mcp'

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