Skip to main content
Glama

Layer mask

layer_mask

Create, apply, invert, or delete a non-destructive mask to hide or reveal portions of a layer. Paint mask strokes to control visibility.

Instructions

Manage a layer mask (non-destructive hiding): add (from reveal-all, hide-all or the selection), apply (bake), delete, invert, enable, disable. Paint on it with stroke/fill target:"mask" (paint reveals, blend "erase" hides).

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": {
      "action": "<action>"
    },
    "name": "layer_mask"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromNoFor add (default reveal)
layerNoLayer id, name, or index (0 = bottom, -1 = top). Default: the active layer.
actionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/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 disclose the critical behavioral trait: the mask is non-destructive, and 'apply (bake)' is the irreversible step that flattens it into the layer. It also explains the polarity semantics (paint reveals, erase hides) that govern downstream stroke/fill calls. It stops short of saying what happens when an action is invoked on a layer with no mask, or whether add replaces an existing mask.

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?

Two tight sentences, front-loaded with the resource and its nature before the action list, with zero filler. The second sentence is densely compressed ('target:"mask"', 'blend "erase"') and relies on the agent knowing stroke/fill's parameter notation, which is a minor readability cost.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter mutation tool with no annotations and no output schema, the description covers purpose, action semantics and painting routing, which is close to adequate. Gaps remain around state preconditions and post-action results (does apply create a new layer? what does delete return?), which matter for safe sequencing in a multi-step workflow.

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?

Schema coverage is 67%, so the schema already documents all three parameters including layer id/name/index resolution. The description adds useful mapping for the `from` enum ('reveal-all, hide-all or the selection' corresponding to reveal/hide/selection) and clarifies what 'apply' means, but adds nothing about the `layer` parameter or defaults beyond what the schema states.

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 resource (layer mask) with a parenthetical gloss of what it means ('non-destructive hiding') and then enumerates the six concrete actions it performs, so an agent can map it directly against the action enum. It is clearly distinguishable from siblings like add_layer, delete_layer or merge_layers, which operate on layers themselves rather than a mask.

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?

Explicitly routes painting on the mask away from this tool and to the siblings stroke/fill with target:"mask", including the blend "erase" variant — that is real cross-tool guidance. What is missing is guidance on preconditions for the six management actions (e.g. whether a mask must already exist before delete/invert/apply), which the agent must infer.

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