Skip to main content
Glama

edit_drawio_svg

Modify an existing .drawio.svg diagram by adding, removing, or updating nodes, edges, and groups, keeping current positions or recomputing layout with ELK.

Instructions

Edit an existing .drawio.svg file by adding, removing, or updating nodes, edges, and groups. Use numeric IDs from read_drawio_svg to reference existing elements (e.g. remove_nodes: ["15"], update_nodes: [{id: "15", ...}]). For add operations, use temporary IDs to establish relationships within the same call (e.g. add_nodes: [{id: "new", ...}], add_edges: [{source: "15", target: "new"}]). By default (layout_mode: "preserve"), existing node and group positions are kept exactly as-is; only newly added elements are placed automatically outside the existing layout. Use layout_mode: "recompute" to fully recompute layout with ELK. Icons of existing (unchanged) nodes are preserved automatically — no need to pass icon data. To replace an icon on an existing node, use update_nodes with icon_path. Removing a group does not delete its child nodes — they become top-level nodes. All add/update operations support style_overrides for CSS-equivalent per-element visual customization: add_nodes/update_nodes (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.); add_edges/update_edges (stroke_color, stroke_width, stroke_dashed, font_color, font_size, opacity, etc.); add_groups/update_groups (fill_color, stroke_color, stroke_width, stroke_dashed, rounded, corner_radius=border-radius%, font_color, font_size, font_bold, opacity, text_align, shadow, etc.). update_edges also supports label, style (solid/dashed), connector, and arrow changes — identified by source+target pair. style_overrides from read_drawio_svg can be passed back to preserve or selectively override existing styles. IMPORTANT: style_overrides in update_nodes/update_edges/update_groups are MERGED with existing styles — only specified properties are changed, unspecified properties are preserved. You do NOT need to re-specify all existing style_overrides when making a partial update.

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": "edit_drawio_svg"
  }
}

Input Schema

NameRequiredDescriptionDefault
layoutNoOptional layout options. Applies to recompute mode; spacing also used for new-element placement in preserve mode.
add_edgesNoEdges to add.
add_nodesNoNodes to add to the diagram.
file_pathYesAbsolute path to the .drawio.svg file to edit.
add_groupsNoGroups to add.
layout_modeNo"preserve" (default): keep existing node/group positions exactly; place only new elements outside. "recompute": fully recompute layout with ELK (ignores existing positions).
remove_edgesNoEdges to remove, identified by source+target pair.
remove_nodesNoIDs of nodes to remove. All edges touching these nodes are also removed.
update_edgesNoUpdate label, style, connector, arrow, or visual style of existing edges, identified by source+target pair. style_overrides are merged with existing styles.
update_nodesNoUpdate label, highlight, icon, or style of existing nodes.
remove_groupsNoIDs of groups to remove. Child nodes are NOT deleted — they become top-level.
update_groupsNoUpdate label, style, children, or visual style of existing groups.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses that layout_mode="preserve" keeps existing positions, that removing a group promotes children to top level, that icons of unchanged nodes are preserved, and that style_overrides are merged rather than replaced. It stops short of stating save/overwrite semantics, failure behavior for a missing file, or whether removal is reversible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded and logically ordered, but a large fraction of the text is a per-element enumeration of style_overrides properties (fill_color=background-color, stroke_color=border-color, ...) that duplicates the schema's own property descriptions almost verbatim. Cutting those lists would lose no information and would sharpen the paragraph.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter mutation tool with nested objects and no output schema, the description covers the critical semantics (ID referencing, layout modes, merge behavior, group removal). The one notable gap is what the call returns — e.g., whether newly added nodes get assigned real IDs the agent can reference later.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds real meaning above that by explaining ID sourcing, temporary-ID relationships, the merge-not-replace semantics of style_overrides, and that update_edges is keyed by source+target pairs. The long CSS-equivalent enumerations largely restate what the schema already documents per property.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (edit) and resource (.drawio.svg file) plus the exact operations supported (adding, removing, updating nodes, edges, groups). The word "existing" and the emphasis on editing cleanly separates it from create_drawio_svg and read_drawio_svg.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: numeric IDs must come from read_drawio_svg, temporary IDs are for add operations within a single call, and layout_mode defaults to "preserve" with "recompute" as the alternative. It even names sibling-derived workflow steps rather than leaving them to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools