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
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to fetch and convert (http:// or https://). | |
| html | No | Raw HTML string to convert directly (alternative to url). | |
| maxChars | No | Max characters of Markdown to return (default 12000, max 50000). |