Skip to main content
Glama
hj1003862396

Next AI Draw.io MCP Server

by hj1003862396

edit_diagram

Add, update, or delete cells in the current draw.io diagram by their unique IDs. Execute multiple operations in one call.

Instructions

Edit the current diagram by ID-based operations (update/add/delete cells).

⚠️ REQUIRED: You MUST call get_diagram BEFORE this tool! This fetches the latest state from the browser including any manual user edits. Skipping get_diagram WILL cause user's changes to be LOST.

Workflow:

  1. Call get_diagram to see current cell IDs and structure

  2. Use the returned XML to construct your edit operations

  3. Call edit_diagram with your operations

Operations:

  • add: Add a new cell. Provide cell_id (new unique id) and new_xml.

  • update: Replace an existing cell by its id. Provide cell_id and complete new_xml.

  • delete: Remove a cell by its id. Only cell_id is needed.

For add/update, new_xml must be a complete mxCell element including mxGeometry.

Example - Add a rectangle: {"operations": [{"operation": "add", "cell_id": "rect-1", "new_xml": "<mxCell id="rect-1" value="Hello" style="rounded=0;" vertex="1" parent="1"><mxGeometry x="100" y="100" width="120" height="60" as="geometry"/>"}]}

Example - Update a cell: {"operations": [{"operation": "update", "cell_id": "3", "new_xml": "<mxCell id="3" value="New Label" style="rounded=1;" vertex="1" parent="1"><mxGeometry x="100" y="100" width="120" height="60" as="geometry"/>"}]}

Example - Delete a cell: {"operations": [{"operation": "delete", "cell_id": "rect-1"}]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationsYesArray of operations to apply
Behavior5/5

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

With no annotations provided, the description carries full transparency burden. It discloses a critical behavioral trait: skipping get_diagram WILL cause user's changes to be LOST. It also explains that new_xml must be a complete mxCell element including mxGeometry, and clarifies requirements for each operation (e.g., delete only needs cell_id). This goes beyond the schema and provides essential side-effect awareness.

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

Conciseness5/5

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

The description is well-structured with clear sections: warning, workflow, operations, and examples. Despite its length, every part contributes necessary information—no filler or redundancy. The warning is prominent, and the examples are efficient.

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

Completeness5/5

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

Given the tool's complexity (three operations, XML structure, prerequisite dependency), the description is thoroughly complete. It covers the required get_diagram call, operation semantics, exact XML format, and illustrative examples. No output schema exists, but for a mutation tool the return value is not essential; the description fully equips an agent to use it correctly.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds substantial meaning: it explains the three operation enum values, that new_xml is required for add/update, that cell_id must be unique for add, and provides full valid XML examples. This goes well beyond the schema's bare property descriptions and gives the agent precise construction guidance.

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?

The description opens with a specific verb+resource+scope: 'Edit the current diagram by ID-based operations (update/add/delete cells).' It clearly distinguishes itself from sibling tools by focusing on the current diagram and the ID-based nature, while get_diagram is for fetching and create_new_diagram for creating new diagrams.

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?

The description explicitly states a mandatory prerequisite: '⚠️ REQUIRED: You MUST call get_diagram BEFORE this tool!' and provides a step-by-step workflow. It also includes detailed operation semantics and three concrete examples covering each operation type, making usage conditions explicit and actionable.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hj1003862396/draw-flow-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server