canvas_build
tools/call
Draw a whole diagram: from Mermaid text (flowchart, sequence or class diagram), or from nodes ({ key, shape, text, link, color }) and edges ({ from, to, label, style }) by key. It is laid out (top to bottom by default) and drawn in a new frame right of everything on the board, or in place of the contents of replaceFrame. Shapes: process, decision, terminal, document, data, database, sticky, text. At most 500 nodes and 1000 edges, with durable bounded saves and explicit progress. replaceFrame needs capacity for the new elements while retaining the old drawing during preparation.
Scopes
read:projectswrite:projects
A project canvas also needs its project to be readable, and for writes writable (Edit tasks, not archived) by the key's person. A workspace canvas is readable when its person owns it or it is shared with the workspace, and writable when its person owns it or holds Edit tasks on a shared one.
Inputs
- canvasIdstringRequired
- mermaidstring
- Mermaid text. Give either mermaid or nodes.
- nodesobject[]
- edgesobject[]
- framestring
- Name of the new frame (default Diagram).
- replaceFramestring
- A frame's id: its contents are deleted and the diagram drawn in their place.
- direction"TB" | "LR" | "BT" | "RL"
- layout"layered" | "tree" | "grid"
- baseSeqinteger
- idempotencyKeystringRequired
- Unique retry key; a retry with the same key returns the first result and writes nothing.
- jobAction"status" | "cancel"
- Repeat the original tool and full input with the same idempotencyKey, adding status to recover progress or cancel to stop running work. Recovery adds no logical admission or usage. Incomplete preparation stays fenced to its action owner and expires if abandoned. Cancellation retains earlier writes for human Revert.
Returns
Frozen caller-key mapping and truthful durable preparation/job progress. jobId is null until job creation; preparing is not execution or completion. Repeat original input with its idempotencyKey to continue without another logical charge; jobAction status only reads. Cancellation while preparing remains original-owner fenced; running-job cancellation retains earlier writes for Revert. A call returns content[0].text with the JSON result and structuredContent.result with the same value.
Listed when
The key has read:projects and Canvas is open for the workspace; the tools that write need write:projects too.