Skip to main content
Glama

html_to_markdown

Convert a URL or raw HTML into clean Markdown by stripping navigation, ads, and scripts while preserving headings, lists, and code blocks. Returns Markdown string, saving up to 98% tokens compared to raw HTML.

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. Provide exactly one of url or html — not both. Returns the Markdown string. Returns an error if the URL is unreachable. Has no side effects. Use instead of loading raw HTML into context — saves 85–98% of tokens. Do NOT use for JavaScript-rendered SPAs — use fetch_html or screenshot_url instead.

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).
Behavior5/5

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

Despite no annotations, the description fully discloses behavior: strips navigation, ads, etc., preserves key elements, has no side effects, returns Markdown string, and errors on unreachable URLs.

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?

Four focused sentences, no fluff. Front-loaded with purpose, then details in logical order. Every sentence adds value.

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?

Comprehensive for a tool with 3 params and no output schema: covers input constraints, output format, error handling, side effects, and alternative tools for different use cases.

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 already covers all parameters at 100% coverage. Description adds value by specifying mutual exclusivity of url and html, and the default and max for maxChars.

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 URLs or raw HTML to Markdown, with specific verb and resource. It also distinguishes from siblings like fetch_html and screenshot_url by noting not to use for JS-rendered SPAs.

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?

Explicitly says to provide exactly one of url or html, and gives clear guidance on when to use (saves tokens) and when not to use (JS-rendered SPAs) with alternatives provided.

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