Duplicate layers
canvas-duplicate_nodesCopy layers or artboards already on the canvas, count times, each copy with its own patches — one undoable action, nothing to resend. Use it instead of canvas-read action=html + canvas-insert_html whenever a copy starts from something that exists (a template stamped once per title, a card repeated in a list). ids: artboards of one page or layers of one frame, copied together with their relative layout. patches: one object per copy, keyed by the SOURCE ids (from canvas-read action=outline), each value a partial patch as canvas-update_nodes takes it (text, radius, layout merge; fills replace), e.g. [{"":{"text":{"content":"Hermes"}},"":{"fills":[{"type":"image","assetId":"","mode":"fill"}]},"":{"name":"Cover / Hermes"}}, …]. Placement: at page level the copies go right of everything on the page, so none covers an artboard, in one row unless perRow wraps them into a grid; inside a frame they go next to the source (an auto-layout frame flows them after its last child). x/y set the first copy's top-left (world at page level, parent-local inside a parent), dx/dy the step between copies and between rows. pageId puts the copies on another page without moving the user's view; parentId puts them into another frame. Returns copies [{rootIds, idMap (source id → this copy's id, for the roots and every patched layer), bounds after layout}] and the patch entries it rejected; 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 (copies placed right of everything are often there; canvas-read action=screenshot renders them as they are). Not for HTML pages (artboards flagged live-page) or their layers: canvas-read action=html + canvas-insert_html copies a page. Layers inside an instance cannot be patched, nor an instance's own size and look — edit the master.
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>",
"ids": "<ids>"
},
"name": "canvas-duplicate_nodes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | First copy's left (world at page level, parent-local inside a parent) | |
| y | No | First copy's top | |
| dx | No | Step between copies in a row (default: the copied block's width + a gap) | |
| dy | No | Step between rows (default: the copied block's height + a gap) | |
| ids | Yes | Node ids | |
| count | No | Copies, 1–100 (default 1) | |
| pageId | No | Page to copy onto (default: the source's page); the user's view does not move | |
| perRow | No | Copies per row before the next row starts (default: one row) | |
| patches | No | One object per copy: source id → partial patch | |
| parentId | No | Frame, group, section or component to copy into (default: the source's parent) | |
| sessionId | Yes | The artifact's id (its sessionId), from canvas-get_open or workspace-list_artifacts. |