modify_diagram
Modify an existing Excalidraw diagram iteratively: add or remove nodes, update labels, rewire connections, or update a typed diagram's spec—without recreating the whole diagram.
Instructions
Modify an existing Excalidraw diagram created by this tool.
Supports iterative editing: add components, remove nodes, update labels, and rewire connections - without recreating the entire diagram.
IMPORTANT: Call get_diagram_info first to understand the current diagram state before making modifications.
For typed diagrams (sequence, pyramid, bar, swimlane, ...) there is a single operation:
{"op": "update_spec", "patch": {"tiers": [...], "title": "New title"}}The patch is deep-merged into the stored spec and the diagram re-rendered. Lists are replaced wholesale, so send the complete list to change one entry. The node/connection operations below apply to architecture and flowchart diagrams only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| theme | No | Color theme for re-rendering. Default: "default" | default |
| file_path | Yes | Path to the existing .excalidraw file. | |
| operations | Yes | Ordered list of operations. Each dict has: - op: "add_node" | "remove_node" | "update_node" | "add_connection" | "remove_connection" For add_node: - id (str): New node identifier - label (str): Display text - component_type (str, optional): Technology for auto-styling - shape (str, optional): Shape override - near (str, optional): Place near this existing node id For remove_node: - id (str): Node to remove (also removes its connections) For update_node: - id (str): Node to update - label (str, optional): New label - component_type (str, optional): New component type For add_connection: - from_id (str): Source node id - to_id (str): Target node id - label (str, optional): Edge label For remove_connection: - from_id (str): Source node id - to_id (str): Target node id |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |