Skip to main content
Glama

copy_layers

Copies source layers or groups into a target sprite while preserving cels, opacity, blend modes, and user data; optionally replaces same-named top-level layers and appends missing frames.

Instructions

Copy layers from another sprite into the target, on top of its top level.

A group comes with all its layers, nested groups included. Cels keep their frame number, position, opacity and z-index; linked cels stay linked. Layer name, visibility, opacity, blend mode, colour and user data are copied. Both sprites must have the same colour mode (indexed copies palette indices as they are, so give both the same palette). A name already used at the target's top level is an error unless replace is true, which puts the copy in the old layer's place. Without create_missing_frames, cels past the target's last frame are skipped and counted. Tilemap layers cannot be copied. Source and target must be different files.

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": {
      "target": "<target>",
      "source": "<source>",
      "layers": "<layers>"
    },
    "name": "copy_layers"
  }
}

Input Schema

NameRequiredDescriptionDefault
layersYesSource layers or groups
sourceYesSprite file to copy from; it is not changed
targetYesSprite file. Relative paths resolve against the server root.
replaceNoReplace a top-level target layer with the same name
create_missing_framesNoAppend frames the target lacks (with the source durations)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it enumerates exactly which properties survive the copy (frame number, position, opacity, z-index, linked-cel status, name, visibility, blend mode, colour, user data), plus the error conditions, the palette-index caveat and the tilemap exclusion. Failure modes are stated rather than left to discovery.

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?

Front-loaded with the purpose, then layered constraints; no filler sentences. It is dense and would read better as short clauses or bullets, but every sentence conveys a distinct constraint.

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 a five-parameter mutation tool with 100% schema coverage and an output schema, the description covers all the gaps that matter: overwrite behaviour, partial-copy semantics and hard preconditions. Nothing an agent needs to invoke it safely is missing.

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

Parameters4/5

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

Adds real meaning beyond the schema: it explains that 'replace' inserts the copy in the old layer's place rather than merely allowing the name, and that omitting 'create_missing_frames' causes out-of-range cels to be skipped and counted. It also clarifies that a group name pulls in all nested layers, which the 'group/child' schema note does not spell out.

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?

States a specific verb ('copy'), resource ('layers'), direction ('from another sprite into the target') and destination ('on top of its top level'). That level of specificity makes it distinguishable from neighbours like duplicate_layer, add_layer or copy_frames 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 Guidelines4/5

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

Gives concrete applicability boundaries: both sprites must share a colour mode and palette, tilemap layers cannot be copied, and source and target must be different files. It never names an alternative tool (e.g. when to prefer duplicate_layer or copy_frames), so it stops short of full routing guidance.

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