Update layers
canvas-update_nodesBatch property patches, one undoable transaction — the surgical alternative to resending HTML. Each patch is a partial SceneNode; editable keys: name, x, y, w, h, rotation, opacity, fills, strokes, effects, radius {tl,tr,br,bl}, blendMode, clipsContent, layout (auto-layout; null removes it), layoutAbsolute, sizingH/sizingV (fixed|hug|fill), constraintH/constraintV, text {content, fontFamily, fontSize, fontWeight, lineHeight, letterSpacing, align, valign, autoResize, …}, points, innerRadius, svgPath, locked, hidden, flipH, flipV. Object fields (text, radius, layout, padding, margin) merge into the node's current value, so a patch names only what changes; arrays (fills, strokes, effects) replace. E.g. {"text":{"content":"Line one\nLine two"}} keeps the font; {"fills":[{"type":"image","assetId":"","mode":"fill"}]}. Structural fields (id, parentId, children, type) are rejected; nodes inside instances are rejected, and so is an instance's own size and look (w, h, fills, strokes, effects, radius, layout, clipsContent), which follow its master — edit the master. Invalid values are dropped and reported. Returns updated, rejected and the bounds of the updated nodes after layout; unmeasured lists any the canvas did not lay out (on another page, or far outside the view): those keep the model's sizes, which a hugging text or auto-layout frame there may not match until it is shown.
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": {
"sessionId": "<sessionId>",
"edits": "<edits>"
},
"name": "canvas-update_nodes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes | One entry per node | |
| sessionId | Yes | The artifact's id (its sessionId), from canvas-get_open or workspace-list_artifacts. |