render_diagram
Render ASCII/Unicode box diagrams as SVG or web pages while keeping every character in its exact cell; use it to convert text diagrams into visuals and resolve reported alignment hints.
Instructions
Render an ASCII/Unicode box diagram as SVG (or a web page), keeping every character in its exact cell. Writes output_path and returns a JSON report: read 'status' (ok | warnings | self_check_failed | bad_input) and 'summary'. For warnings, apply each 'hint' (it names the row/col to fix) and render again. Pick 'preset' from where the diagram is going. Run check_diagram first on a new diagram.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"diagram": "<diagram>"
},
"name": "render_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fold | No | With interactive: start with nodes at this depth folded | |
| font | No | Font family to try first, e.g. JetBrains Mono | |
| boxes | No | Per box name: {link, tooltip, tint}. Links work on a web page or <object>, not in <img> | |
| color | No | Tint boxes by group and colour the arrows | |
| names | No | Put data-name on each box, for the page's own CSS or scripts | |
| style | No | ||
| theme | No | ||
| title | No | Accessible title stored in the output | |
| width | No | Scale the output to this width in pixels | |
| accent | No | Accent colour for arrows and animation, e.g. #0969da | |
| preset | No | readme: GitHub/docs, animated, follows dark mode · slides · chat · print · dark · page: a web page that reveals as you scroll (needs a .html path) | |
| repair | No | Fix typical misalignment first (ragged walls, drifting connectors, short arrows); the fixed text is in report.repair.text | |
| square | No | Square box corners | |
| tokens | No | Look tuning: ink, bg, accent, neutral, hover, glow (#hex), hues, branch ([[#hex, #hex], ...]), stroke, font_size, flow_speed, flow_rest; colours under light/dark apply to one theme | |
| animate | No | ||
| diagram | Yes | The diagram as plain text with real line breaks (a markdown code block is fine). Boxes: +--+ / | | / +--+ or ┌─┐ │ │ └─┘. Arrows end in v ^ < > or ▼ ▲ ▶ ◀ touching (or one space from) the box they point at. | |
| describe | No | Also return boxes and edges (which box each arrow connects) | |
| portable | No | One <text> per character, for design tools such as Inkscape or Figma (browsers don't need it) | |
| highlight | No | Box names to keep bright, with the lines between them; the rest dims. Names are box titles, as check_diagram reports them | |
| interactive | No | Trees and mind maps fold when clicked (in a browser; as an image it is the full drawing) | |
| output_path | No | File to write: .svg, or .html for a web page. Prefer an absolute path. Omit to get the markup back. |