Skip to main content
Glama

layer

Destructive

Layer management. op: create | create_group | delete | duplicate | select | set | reorder | merge_down | flatten (a group is created, addressed and reordered like any layer; there is no separate group tool). Address a layer by layer_id (an id from inspect or a previous layer / bake result) or by layer (its name; names can repeat, so layer_id is the only handle that always tells two apart). Every op except select changes pixels or layer structure, and there is no undo in this session: checkpoint first when in doubt. create adds an empty layer (width/height default to the photo size; fill white, black or transparent, default transparent). create_group adds a group (a folder for other layers). delete removes a layer (a group takes its children with it) and its filters; REFUSED if it is or contains the photo's only remaining layer. duplicate copies a layer directly above the source; REFUSES when the layer (or, for a group, any layer in it) carries an Editmamei filter, since the copy's filter would collide with the original's record: bake it first or delete the filter, then duplicate. select sets the active layer (the default target of add_adjustment and friends when no layer is named) and changes nothing else. set changes opacity, mode (a blend mode from a fixed list), visible and/or name (at least one is required; a name may not be empty). Names are kept unique by suffixing " 2", " 3", ... when taken. reorder changes a layer's stack position and/or moves it into a group (parent_group) or out to top level (to_top_level: true); giving neither keeps the layer in its current group and only changes position; REFUSED if parent_group would nest a group inside itself or one of its own descendants. merge_down bakes ONE layer's live filters (masked ones included) into pixels and merges it into the first VISIBLE layer below it at the same level; REFUSES if the source layer itself is hidden, if the target would be a group, if there is no visible layer below (a hidden one in between is skipped, not merged), or if the result would exceed the size cap resize enforces; a visible text layer involved is rasterized (reported as rasterized_text). flatten collapses the WHOLE photo into a single layer the same way, always drops transparency (reported as has_alpha: false), and REFUSES by default when any layer is hidden, INCLUDING a visible layer inside a hidden group, rather than silently discarding it (discard_hidden: true proceeds and reports what was discarded). On this server a created layer's width x height must stay within the workspace's pixel limit (less at a higher bit depth), and a photo's layers together within its layer limit, each counted at the canvas size (or the largest layer size used in the photo, if bigger).

Input Schema

NameRequiredDescriptionDefault
opYes'create' adds a new, empty layer (width/height default to the image size, capped the same way resize's target is; fill white/black/transparent, default transparent). 'create_group' adds a group layer (a folder for other layers). 'delete' removes a layer (a group takes its children with it) and prunes any of its filters from the ledger — REFUSED if it is or contains the image's only remaining layer. 'duplicate' copies a layer, inserted directly above the source — REFUSED when the layer (or, for a group, any descendant) carries an Editmamei filter, since the copy's filter would collide with the original's own ledger record. 'select' sets the active layer (the default target for add_adjustment and friends when no layer is named) and is the one sub-op that changes nothing else. 'set' changes opacity, mode, visible, and/or name (at least one required, name may not be empty) — mode is a blend mode from a fixed list, not a raw name. 'reorder' changes a layer's stack position and/or moves it into a group (parent_group) or out to top-level (to_top_level: true) — neither given keeps the layer in its current group and only changes `position`; REFUSED if parent_group would nest a group inside itself or one of its own descendants. 'merge_down' bakes ONE layer's live filters (masked ones included) into pixels and merges it into the first VISIBLE layer below it in the same group/level — REFUSED if the SOURCE layer itself is hidden (the editor cannot merge a hidden layer down), if that target would be a group, if there is no visible layer below (a hidden one in between is skipped, not merged), or if the merged result would exceed the same size cap resize enforces; a visible text layer involved is rasterized (reported as rasterized_text). 'flatten' collapses the WHOLE image into a single layer the same way, always drops alpha (reported as has_alpha: false), and REFUSES by default when any layer is hidden, INCLUDING a layer whose own visibility is on but sits inside a hidden group (the editor discards a hidden layer outright rather than compositing it in) unless discard_hidden: true is given.
fillNocreate only. The new layer's initial content.transparent
modeNoset only. A blend mode from a fixed list. 'color' here is HSL-style, a little different from fill's 'color'.
nameNocreate/create_group: the new layer's name (default 'Layer'/'Group'). set: renames the target layer; may not be empty. Every case enforces a unique name, suffixing " 2", " 3", ... if the name is already taken (duplicate names are possible elsewhere; this tool does not allow them).
imageYesImage id, as returned by open_photo.
layerNoLayer name. Defaults to the selected layer, or the topmost layer if none is selected. Ignored when layer_id is given. Not used by create, create_group, or flatten.
widthNocreate only. Defaults to the image width.
heightNocreate only. Defaults to the image height.
opacityNoset only.
visibleNoset only.
layer_idNoCanonical layer id (from inspect or a prior layer/bake result) — takes priority over `layer` (name) when both are given, and is the only way to address two layers that happen to share a name. Not used by create, create_group, or flatten.
positionNocreate/create_group/reorder: index within the target parent's (or top-level) stack, 0 = topmost.
parent_groupNocreate/create_group: the group layer_id to insert the new layer into (omit for top-level). reorder: the group layer_id to move the layer into. Must itself be a group, and cannot be the layer being moved or one of its own descendants. Omit (leaving the layer in its current group) or use to_top_level instead to move it OUT of a group — there is no way to pass "no group" through this field itself.
to_top_levelNoreorder only. Moves the layer to the top level, out of whatever group (if any) it is currently in. Takes priority over parent_group if both are given.
discard_hiddenNoflatten only. Without it, flatten REFUSES when any layer is hidden (naming them) rather than silently discarding them — pass true to proceed; the discarded layers are reported back as discarded_hidden_layers.

Output Schema

NameRequiredDescriptionDefault
modeNo
nameNo
deletedNo
opacityNo
visibleNo
is_groupNo
layer_idNo
has_alphaNo
parent_groupNo
rasterized_textNo
discarded_hidden_layersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / mode / description
      Previous value: -"set only. A fixed blend-mode list, not a raw mode name."New value: +"set only. A blend mode from a fixed list. 'color' here is HSL-style, a little different from fill's 'color'."
    • changedInput schema / properties / mode / enum
      Previous value: -[
      -  "normal",
      -  "multiply",
      -  "screen",
      -  "overlay",
      -  "soft_light",
      -  "hard_light",
      -  "darken",
      -  "lighten",
      -  "difference",
      -  "exclusion",
      -  "addition",
      -  "subtract",
      -  "divide",
      -  "dodge",
      -  "burn",
      -  "hue",
      -  "saturation",
      -  "color",
      -  "luminosity",
      -  "grain_extract",
      -  "grain_merge"
      -]New value: +[
      +  "normal",
      +  "multiply",
      +  "screen",
      +  "overlay",
      +  "soft_light",
      +  "hard_light",
      +  "darken",
      +  "lighten",
      +  "difference",
      +  "exclusion",
      +  "linear_dodge",
      +  "subtract",
      +  "divide",
      +  "color_dodge",
      +  "color_burn",
      +  "hue",
      +  "saturation",
      +  "color",
      +  "luminosity"
      +]
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and readOnlyHint=false, but the description goes far beyond that with concrete refusal rules (delete refused on sole layer, merge_down refused on hidden source, flatten refused on any hidden layer including inside hidden groups), reporting behavior (rasterized_text, has_alpha: false, discarded_hidden_layers), and no-undo warning. This is exactly the added context annotations cannot carry.

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

Conciseness3/5

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

The single dense paragraph is front-loaded with addressing rules and the no-undo warning, which is good, but it is very long and packs per-op rules into semicolon-laden prose that is hard to scan. The schema already documents ops individually, so much of this is duplicated rather than summarized.

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 15-param, 9-op destructive tool with no undo, the description covers refusal conditions, side effects, reporting, addressing precedence, and the checkpoint escape hatch. With an output schema present, return-value detail is appropriately left out. Nothing an agent needs to call correctly 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?

Schema coverage is 100%, so the baseline is 3, but the description adds real semantics: the default target of select, the name-uniqueness suffix rule (' 2', ' 3'), the 'color' mode HSL distinction, and the parent_group/to_top_level interaction. It falls short of 5 only because a few params (opacity, visible, position defaults) are left to the schema.

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 description opens with a specific verb-resource statement ('Layer management') and enumerates all nine ops, each with a distinct meaning. It explicitly distinguishes itself from siblings by noting 'there is no separate group tool,' which prevents an agent from searching for one.

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?

Gives explicit when-to-use and when-not-to-use guidance across ops: 'checkpoint first when in doubt,' 'Every op except select changes pixels... there is no undo,' and names the specific failure conditions for delete, duplicate, reorder, merge_down, and flatten. It routes the agent to bake before duplicate when an Editmamei filter is present.

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.

Resources