Skip to main content
Glama

Layer Mask

photopea_layer_mask

Add or delete layer masks to hide parts of a layer without erasing pixels; create reveal-all, hide-all, or selection-based masks, or remove an existing mask.

Instructions

Add or delete a layer mask, which hides parts of a layer without erasing pixels. 'from_selection' shows only the current selection (use make_selection first). Acts on the target layer, or the active layer if omitted.

Input Schema

NameRequiredDescriptionDefault
actionYes'reveal_all' adds a mask that shows everything, 'hide_all' one that hides everything, 'from_selection' one that shows the selection, 'delete' removes the mask
targetNoLayer name (string) or index (number)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, and idempotentHint=false, so the mutation profile is mostly covered. The description adds useful context that masking is non-destructive (pixels are not erased) and how the target layer is resolved. It does not disclose what happens when 'delete' is called on a layer with no mask, nor whether adding a mask replaces an existing one.

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

Conciseness5/5

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

Three short sentences, front-loaded with the core operation, then the action-specific prerequisite, then the target default. No redundant restatement of the enum or filler wording.

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?

For a two-parameter, non-nested tool with no output schema, the description covers purpose, action semantics, the selection prerequisite, and target defaulting. Only edge-case behavior (deleting a nonexistent mask, overwriting an existing mask) is left unstated, which is a minor gap.

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 enum values are already documented and the baseline would be 3. The description earns extra credit by adding meaning the schema lacks: the prerequisite for 'from_selection' and the default resolution of 'target' to the active layer when 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 gives a specific verb+resource pair ('Add or delete a layer mask') and explains the effect ('hides parts of a layer without erasing pixels'), which separates it conceptually from the sibling photopea_set_clipping_mask. It never names that sibling or any other alternative explicitly, so the differentiation is implicit 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 Guidelines4/5

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

It supplies a concrete prerequisite ('use make_selection first') for the from_selection action and clarifies the default target behavior ('or the active layer if omitted'), which is real when-to-use guidance. It does not say when to prefer this over photopea_set_clipping_mask or what to do when the target layer already has a mask.

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