render_diagram
Convert Mermaid diagram code into a cropped PNG or SVG file, with optional chat preview. Supports sequence, flowchart, class, architecture, and ER diagrams in light or dark themes.
Instructions
Render an isolated Mermaid diagram (sequence, flowchart, class, architecture, ER) directly to a cropped PNG or SVG file with optional visual preview in chat.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| theme | No | Visual theme: "light" (GitHub Light) or "dark" (GitHub Dark). Default: "light" | |
| format | No | Output format: "png" (high-res auto-cropped image) or "svg" (vector XML). Default: "png" | |
| diagram | Yes | Raw Mermaid diagram definition code (e.g. "graph TD\nA-->B" or "sequenceDiagram...") | |
| outputDir | No | Directory where exported diagram file will be saved. Default: "./exports" | |
| outputName | No | Base filename for the diagram without extension. Default: "diagram-<timestamp>" | |
| includeBase64 | No | Whether to include base64 image data in MCP response for direct visual rendering in chat. Default: true |