Skip to main content
Glama

Duplicate layers

canvas-duplicate_nodes

Copy 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

NameRequiredDescriptionDefault
xNoFirst copy's left (world at page level, parent-local inside a parent)
yNoFirst copy's top
dxNoStep between copies in a row (default: the copied block's width + a gap)
dyNoStep between rows (default: the copied block's height + a gap)
idsYesNode ids
countNoCopies, 1–100 (default 1)
pageIdNoPage to copy onto (default: the source's page); the user's view does not move
perRowNoCopies per row before the next row starts (default: one row)
patchesNoOne object per copy: source id → partial patch
parentIdNoFrame, group, section or component to copy into (default: the source's parent)
sessionIdYesThe artifact's id (its sessionId), from canvas-get_open or workspace-list_artifacts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations (which only say non-read-only, non-destructive, closed-world), the description discloses that all copies land as one undoable action with nothing to resend, exactly how placement is computed at page level vs inside a frame (including auto-layout flow), and that pageId does not move the user's view. It also explains the return payload, that rejected patch entries come back, and that 'unmeasured' copies keep model sizes and may not match a hugging text or auto-layout frame until rendered — a real behavioral caveat an agent could not infer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Content is front-loaded — purpose and the alternative come first, then ids/patches, then placement, then return values and caveats. However, it is one dense unbroken block of roughly 250 words with terse field-prefix fragments ('ids:', 'patches:', 'Placement:') that reduce scanability, and a few clauses (the screenshot aside, the repeated page-level placement warning) could be tightened without losing information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation tool with no output schema, the description covers what an agent actually needs: return shape ({rootIds, idMap, bounds}), failure/rejection reporting, the unmeasured edge case with its remedy, and the two hard exclusions (live-page artboards, instance internals). Nothing material about calling it correctly is left to inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline would be 3, but the description adds substantial meaning: patches is keyed by SOURCE ids obtained from canvas-read action=outline, each value is a partial patch with canvas-update_nodes semantics (text, radius, layout merge; fills replace), and a concrete JSON example is given. It also clarifies that x/y are world coordinates at page level but parent-local inside a parent, and that dx/dy govern both inter-copy and inter-row spacing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource — copy layers or artboards already on the canvas, N times, each copy with its own patches — and immediately distinguishes itself from the read+insert path. It also carves out a scope boundary (not for live-page artboards or their layers), so an agent can tell it apart from canvas-insert_html and canvas-update_nodes without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit routing rule: use this instead of canvas-read action=html + canvas-insert_html whenever a copy starts from something that exists, with concrete examples (a template stamped per title, a card repeated in a list). The negative case is equally explicit — HTML pages and their layers must use the insert_html path — and the instance-layer limitation names the workaround (edit the master).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.