Skip to main content
Glama

HTML to Markdown

ai_html_to_markdown
Read-onlyIdempotent

Convert HTML to clean Markdown for reading or feeding to a model, with optional main-article extraction, CSS selector targeting, absolute links and file output. Runs locally; nothing is uploaded.

Instructions

Convert HTML to clean Markdown for reading or feeding to a model: headings, lists, links, images, code blocks, GitHub-style tables and strikethrough. Give the HTML inline ("html") or as a file ("path": local path or base64). Optional "readable" keeps only the main article (Mozilla Readability, falls back to the whole body), "selector" converts only matching elements, "baseUrl" makes relative links absolute, "includeLinks": false drops link URLs and images. Scripts, styles and forms are removed. Inline Markdown is cut at maxChars (default 200k) with a note; give "output" to save the whole thing to a .md file. Runs locally; nothing is uploaded.

Input Schema

NameRequiredDescriptionDefault
htmlNoThe HTML text. Give this or "path".
pathNoAn .html file instead of "html": local path or base64.
outputNoWrite the Markdown to this file (or folder ending in "/") and return its path instead of the inline text.
baseUrlNoURL the HTML came from, to make relative links and images absolute.
maxCharsNoCut the inline Markdown after this many characters, with a note (a file written with "output" is never cut). Default 200000.
readableNoKeep only the main content (article text), dropping navigation, ads and footers.
selectorNoCSS selector: convert only the matching elements (e.g. "main", "article .post").
includeLinksNoKeep links and images. False turns links into plain text and drops images.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already mark this as read-only, idempotent, and not open-world, but the description adds important behavior beyond them: scripts/styles/forms are removed, 'readable' falls back to the whole body, inline output is truncated at maxChars with a note, file output is never cut, and processing runs locally with nothing uploaded.

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 one dense but well-structured paragraph that front-loads the purpose, then covers input modes, transformation options, truncation behavior, and privacy. Every sentence serves the caller; no filler is present.

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?

For an 8-parameter conversion tool with no output schema, the description is complete enough: it explains input sources, output-file versus inline behavior, truncation, content filtering, link handling, and local execution. An agent has what it needs to invoke the tool correctly.

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 the schema already documents all eight parameters in detail. The description mostly restates those parameter meanings and adds only marginal semantics such as the Readability fallback; therefore the baseline of 3 is appropriate.

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 states a specific verb and resource: convert HTML to clean Markdown, with concrete output elements such as headings, lists, links, tables, and code blocks. It is immediately distinguishable from sibling conversion tools like ai_pdf_to_markdown and ai_docx_to_markdown by source format.

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?

It gives clear usage context ('for reading or feeding to a model') and explains input modes (inline 'html' vs 'path'), plus when to use options like 'readable' and 'selector'. It does not explicitly compare against sibling conversion tools or state when not to use this tool, so it stops short of a 5.

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

Deploy Server

Other Tools