Edit Canvas
edit_canvasEdit a .canvas file by adding, updating, or removing nodes and edges atomically. If any operation fails, the file remains unchanged.
Instructions
Edit a stored .canvas file: add, update, and/or remove nodes and edges in one atomic write. Operations apply in order — add_nodes, update_nodes, add_edges, update_edges, remove_edge_ids, remove_node_ids — and removing a node also removes its connected edges. If any operation fails the file is left unchanged. Returns the updated canvas.
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": {
"filename": "<filename>"
},
"name": "edit_canvas"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| add_nodes | No | ||
| update_nodes | No | ||
| remove_node_ids | No | ||
| add_edges | No | ||
| update_edges | No | ||
| remove_edge_ids | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the written .canvas file | |
| node_count | Yes | Number of nodes written | |
| edge_count | Yes | Number of edges written | |
| canvas | Yes | The full canvas document, for inline UI rendering |