Markdown to HTML round-trip
Markdown to HTML and back - a round-trip conversion that proves fidelity and gives you both formats from one input.
3 tools run server-side in one request. You pay once, settle once, and get a single response - no orchestration, no per-step payments, and a partial-success envelope if any step fails. USDC over x402 on any supported chain.
When to use this pack
An agent has markdown content and needs HTML output (for email, CMS, or rendering), plus wants to verify the round-trip fidelity by converting back. Useful for content pipelines and format migration.
Tools in this pack
All 3 run inside the single $0.050 call above. Each is also callable on its own if you only need one part.
- Markdown to HTML POST /api/markdown-to-html Render CommonMark + GFM markdown to HTML.
- HTML to Markdown POST /api/html-to-markdown Convert an HTML fragment or document you already have into clean markdown. (To fetch + convert a live URL, use /api/extract.)
- Text diff POST /api/text-diff Line-by-line diff of two texts (LCS). Returns unified-style ops and change counts. Up to 2000 lines per side.
Workflow
- Convert markdown to HTML with markdown-to-html - produces clean semantic HTML.
- Convert the HTML back to markdown with html-to-markdown - verifies round-trip fidelity. Differences indicate formatting that doesn't survive the conversion.
- Diff the original markdown against the round-tripped markdown with text-diff - the diff IS the fidelity report: an empty diff means lossless, and every hunk is exactly the formatting that didn't survive the HTML round-trip.
Call it directly
Any x402 client pays the 402 and gets the whole workflow back in one response:
npx agent402-client call markdown-convert {"markdown":"# Hello\\n\\nThis is **bold** and _italic_."}
Run it in Claude
claude mcp add agent402 -s user -- npx -y agent402-mcp@latest
Then paste this prompt into Claude:
Round-trip markdown using Agent402: (1) markdown-to-html {markdown:"# Hello\n\nThis is **bold** and _italic_."} - get HTML. (2) html-to-markdown on the result - verify round-trip. (3) text-diff {a:<original>, b:<round-tripped>} - quantify what changed. Return {html, roundTripped, diff}.