create_drawio_svg
Generate an editable .drawio.svg diagram from a JSON description, with automatic layout and icon resolution. Use the single file in draw.io or embed it as SVG in Markdown.
Instructions
Generate a .drawio.svg file from a diagram description. The file works in two ways simultaneously: (1) editable in draw.io / VS Code draw.io extension, (2) embeddable as SVG in Markdown design documents with . This single-file format prevents inconsistency between the source diagram and its SVG export. Layout is computed automatically via elkjs — no need to specify coordinates. Icons can be provided as local file paths; if omitted, a fallback icon is searched automatically. Each element supports style_overrides for CSS-equivalent visual customization: nodes[].style_overrides (fill_color=background-color, stroke_color=border-color, stroke_width=border-width, stroke_dashed=border-style:dashed, font_bold=font-weight:bold, font_size=font-size, font_color=color, opacity=opacity, rounded=border-radius, shadow=box-shadow, text_align=text-align, etc.); edges[].style_overrides (stroke_color, stroke_width, stroke_dashed, font_color, font_size, font_bold, opacity, etc.); groups[].style_overrides (fill_color, stroke_color, stroke_width, stroke_dashed, rounded, corner_radius=border-radius%, font_color, font_size, font_bold, opacity, text_align, shadow, etc.).
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": {
"nodes": "<nodes>",
"output_path": "<output_path>"
},
"name": "create_drawio_svg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | No | Connections between nodes. | |
| nodes | Yes | List of nodes (components) in the diagram. | |
| groups | No | Optional grouping containers (e.g. network boundaries, system domains). | |
| layout | No | Optional layout configuration. | |
| output_path | Yes | Absolute path where the .drawio.svg file should be saved. |