Skip to main content
Glama

layer_mask

Destructive

A real layer mask (it moves with the layer). create from a saved selection channel (e.g. from select or select_with_ai) or from white, black, the layer's transparency or grayscale; delete; apply (bake the mask into the layer's transparency: a cut-out); invert. For a cut-out composite: place the photo as a layer, select on that layer, then create its mask from the channel.

Input Schema

NameRequiredDescriptionDefault
opYescreate replaces any existing mask. apply bakes the mask into the layer's alpha.
imageYesImage id, as returned by open_photo.
layerNoLayer name. Defaults to the selected layer, or the topmost layer if none is selected.
invertNocreate: invert the new mask.
sourceNocreate: where the mask comes from.channel
channelNosource=channel: the saved selection to use.
layer_idNoLayer id, as inspect (and any tool that creates a layer) reports it. Takes priority over `layer`, and is the only way to address one of two layers that share a name.

Output Schema

NameRequiredDescriptionDefault
opNo
layerNo
has_maskNo
layer_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and non-idempotent, and the description reinforces this with real consequences: apply 'bakes the mask into the layer's transparency: a cut-out', and create replaces any existing mask. It adds the crucial semantic that the mask travels with the layer, which annotations cannot express. No note on undo/reversibility or scoping of the bake, so not a 5.

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-loads the definition of what a layer mask is, then packs the four operations and a workflow into one dense paragraph with no filler. The semicolon-chained operation list is efficient, though slightly choppy to parse on first read.

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

Completeness4/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 described, and the description covers the operation set, source options, and a canonical workflow. Remaining details (layer vs layer_id precedence, invert scoping) are handled by the fully-populated schema, so the description is adequate without being exhaustive.

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 baseline is 3, but the description goes beyond it by naming the concrete source values and explaining where a channel comes from ('a saved selection channel, e.g. from select or select_with_ai'). That provenance is genuinely new information not present in the schema text.

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 the specific resource (a layer mask, explicitly 'real' and layer-bound) and enumerates the four operations it performs: create, delete, apply, invert. The parenthetical '(it moves with the layer)' distinguishes it from selection-style masking, so an agent can separate it from siblings like modify_selection without opening schemas.

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 when-to-use guidance — create masks from a saved selection channel produced by `select` or `select_with_ai`, or from white/black/alpha/grayscale — plus a worked workflow ('place the photo as a layer, select on that layer, then create its mask from the channel'). It never states when *not* to use this tool or contrasts it explicitly with a masking alternative, so it stops short of 5.

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