Draw and audit a figure
renderDraws and audits a diagram in one call, validating input and layout, then writing SVG, HTML and a receipt with file paths and warnings. Each error includes a fix so you can adjust and rerun.
Instructions
Draw one figure and audit it in a single call. Validates the input, lays it out, writes OUT.svg, OUT.html and a receipt (OUT.graph.json) side by side, then checks the drawing. Returns one JSON line: ok, the file paths, a layout outline and any warnings. When ok is false, each error has a fix: change the spec or options and call render again. Overwrites files at the same out path. Use validate to check an input without drawing, and audit for an SVG this tool did not just draw.
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": {
"type": "<type>"
},
"name": "render"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Output path ending .html (default diagonaldiagrams-out.html). The .svg and the receipt are written beside it. | |
| data | No | CSV, GeoJSON or Mermaid text, inline. Give exactly one of spec, scene, data or path. | |
| path | No | A spec, scene, CSV or Mermaid file on disk, instead of inline input. | |
| spec | No | The figure as a JSON object, inline, in the shape `describe <type>` prints. Give exactly one of spec, scene, data or path. | |
| type | Yes | Figure type: mermaid (data is Mermaid text), flow, arch, seq, schema, iso (3D layer stack), bar, line, scatter, geo, or any chart type that describe lists. | |
| scene | No | A v2 scene, inline: {"preset": "flow", "nodes": [...], "edges": [...], "groups": [...]}; type names its preset. Give exactly one of spec, scene, data or path. | |
| options | No | CLI flags without dashes, e.g. {"x": "month", "y": "signups", "group": "product", "title": "...", "highlight": ["Atlas"]}. describe lists them. Diagrams also take "style": a stylesheet object (or a list of them), "font": "Inter", and "fit": where the figure goes, "slide" (default), "page" or "column" (a narrow docs or notes column); describe style lists properties and selectors. |