convert_diagram
Make Mermaid diagrams portable. Takes HTML containing blocks (or a raw Mermaid source) and returns the same document with every diagram pre-rendered to inline SVG and the Mermaid CDN runtime stripped. A CDN-backed diagram only renders if the reader can fetch and run the runtime; inline SVG needs neither, so the output survives offline readers, email clients, Notion/Confluence (which strip ), and PDF export. Rendering happens on our infrastructure; diagram content is not sent to any third party.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "convert_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | No | HTML document or fragment containing <div class="mermaid"> blocks. Mutually exclusive with mermaid_source. | |
| theme | No | Mermaid theme. Default "default". | |
| background | No | "transparent" (default), "white", or a hex color. | |
| output_format | No | Default "html". "svg" returns the raw inline SVG and requires mermaid_source. | |
| mermaid_source | No | A single raw Mermaid diagram source. Mutually exclusive with html. | |
| inject_lightbox | No | Add click-to-enlarge overlay CSS+JS for small-text diagrams. Default false. |