Skip to main content
Glama

Duplicate layer

gimp_duplicate_layer

Duplicate a layer or entire group with masks and children, placing the copy above the original or in a chosen parent and position.

Instructions

Copy a layer or a whole group (with masks and children). By default the copy is placed just above the original in the same parent. GIMP names it ' copy'. One undo step.

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": {
      "item": "<item>"
    },
    "name": "gimp_duplicate_layer"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemYesItem id (layer, group, mask...) e.g. 'item:5@a1b2c3d4'.
parentNoGroup id to put the layer in; null for the top level of the image.
positionNo

Output Schema

NameRequiredDescriptionDefault
xYesOffset of the layer's top-left corner in image pixels.
yYes
idYes
kindYes
maskYes
modeYesGIMP layer mode nick, e.g. 'normal', 'multiply'.
nameYesLayer name. GIMP keeps names unique within an image ('Title #1').
locksYes
widthYes
heightYes
parentYesId of the parent group, null at the top level.
opacityYes0-100.
visibleYes
childrenNoChild layers of a group, top-most first; null for non-groups.
has_alphaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • changedOutput schema / $defs / LayerNode / properties / kind / enum
      Previous value: -[
      -  "layer",
      -  "group",
      -  "text"
      -]New value: +[
      +  "layer",
      +  "group",
      +  "text",
      +  "vector",
      +  "link"
      +]
    • changedOutput schema / properties / kind / enum
      Previous value: -[
      -  "layer",
      -  "group",
      -  "text"
      -]New value: +[
      +  "layer",
      +  "group",
      +  "text",
      +  "vector",
      +  "link"
      +]
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only but non-destructive, non-open-world mutation, so the safety bar is partly covered. The description adds real behavior the annotations cannot convey: the copy is deep (masks and children included), placement defaults to just above the original in the same parent, the naming convention is '<name> copy', and the whole operation is a single undo step.

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?

Three short sentences with the core action front-loaded, then defaults, naming, and undo cost. No filler; the only mild inefficiency is that placement and naming could be merged without loss.

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?

An output schema exists, so return values need not be explained, and the description covers the behaviors an agent actually needs before calling: deep-copy scope, default position, resulting name, and undo cost. The only residual gap is that the schema's 'item' also allows masks, while the description mentions only layers and groups.

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

Parameters3/5

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

With 67% schema coverage, the baseline is 3, and the description does add meaning for the undocumented 'position' parameter by stating the default is just above the original. However, it also creates ambiguity with 'parent': the schema says null means the top level of the image, while the description says the default is the original's same parent, so the agent is left unsure which default applies when 'parent' is omitted.

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

Purpose4/5

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

The description opens with a specific verb and resource ('Copy a layer or a whole group') and immediately scopes the deep-copy behavior ('with masks and children'), which separates it from gimp_create_layer or gimp_add_layer_mask. It stops short of naming a sibling explicitly, so differentiation is inferred from the verb rather than stated.

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

Usage Guidelines3/5

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

Usage is implied by the copy semantics and the default placement rule, but there is no explicit 'use this instead of create_layer when...' guidance or any stated prerequisite (e.g. that the image must be open, or that the item must exist). An agent must infer when duplication beats creation.

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