read_drawio_svg
Reads an existing .drawio.svg file and returns structured JSON with nodes, edges, groups, and layout, so you can inspect diagram components, connections, and styles for editing or rebuilding.
Instructions
Read an existing .drawio.svg file and return its diagram as structured JSON (nodes, edges, groups, layout). To understand the diagram content — e.g. what components exist, how they are connected, and which group they belong to — read the returned JSON directly: nodes[].label: component names; edges[].source / .target / .label: connectivity and protocol; groups[].label / .children: logical boundaries (VNet, resource group, etc.). Visual styles are returned as style_overrides on each element (e.g. nodes[].style_overrides.fill_color, edges[].style_overrides.stroke_color, groups[].style_overrides.font_size). These CSS-equivalent properties (fill_color=background-color, stroke_width=border-width, font_bold=font-weight:bold, opacity=opacity, etc.) enable full round-trip: read style_overrides → pass them back to edit_drawio_svg to preserve or modify styling. Typical workflows: (1) read_drawio_svg → edit_drawio_svg: targeted add/remove/update; node icons and styles are preserved automatically. (2) read_drawio_svg → create_drawio_svg: full rebuild; icons are NOT carried over from the file, specify them via icon_path or icon_data_uri. Node/group IDs are draw.io internal numeric IDs (e.g. "2", "15"). Edge source/target also use these numeric IDs. These IDs are stable across preserve-mode edits; use them in edit_drawio_svg to reference existing elements. Icon data is NOT included in the response (use has_icon flag to see which nodes have icons). Note: layout is automatically recomputed when regenerating.
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": {
"file_path": "<file_path>"
},
"name": "read_drawio_svg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the .drawio.svg file to read. |