Edit Canvas
canvas.editAdd, connect, or remove nodes and edges on a canvas. Insert text or file nodes at coordinates, link nodes with directed edges, and delete nodes to remove all connections.
Instructions
Mutate a canvas: add a node, add an edge, or remove a node. The op field selects the mutation. add-node needs nodeType (text for inline markdown or file for an embedded note), content, x, y (plus optional width/height). add-edge needs fromNode and toNode ids (plus optional label). remove-node needs nodeId — removing a node also removes every edge incident to it (destructive). Returns a standard mutation envelope.
Operates on the session-active vault (see vault.current — selectable via vault.select) unless an explicit vaultPath argument is passed, which always wins.
Examples:
Example 1 — Add a text node to a canvas:
{
"op": "add-node",
"filePath": "Boards/map.canvas",
"nodeType": "text",
"content": "Research question",
"x": 0,
"y": 0,
"width": 280,
"height": 80
}Example 2 — Connect two existing nodes with a labelled edge:
{
"op": "add-edge",
"filePath": "Boards/map.canvas",
"fromNode": "n1",
"toNode": "n2",
"label": "depends on"
}Example 3 — Remove a node and all its edges:
{
"op": "remove-node",
"filePath": "Boards/map.canvas",
"nodeId": "n3"
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changed | Yes | True if the tool altered vault state on this call; false if it was a no-op. | |
| target | Yes | The path or identifier the tool acted on. | |
| summary | Yes | Short human-readable summary of what happened. |