Skip to main content
Glama
Josusanz
by Josusanz

Set or clear a layer mask

set_layer_mask
DestructiveIdempotent

Control layer visibility by applying or removing a grayscale raster mask, where white reveals and black hides content.

Instructions

Attaches a raster mask from a grayscale image (white reveals, black hides) to a layer, or removes the existing mask. The mask is stretched over the layer's own rectangle.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the .comp project package (a directory ending in .comp)
layerYesLayer UUID or its exact name
invertNo
maskPathNoGrayscale or any image; luminance becomes coverage. Omit to clear the mask.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4/5.0
Behavior4/5

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

Annotations already provide readOnlyHint=false, destructiveHint=true, and idempotentHint=true. The description adds value beyond them by disclosing the luminance-to-coverage mapping ('white reveals, black hides') and the sizing behavior ('stretched over the layer's own rectangle'). 'Removes the existing mask' aligns with destructiveHint, and nothing contradicts the annotations.

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?

Two sentences with no filler. The first sentence front-loads the core action and both operation modes (attach/remove) plus the key luminance rule; the second adds the stretch detail. Every clause earns its place.

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 moderate-complexity tool (4 params, no output schema) with safety already covered by annotations, the description covers purpose, mask behavior, and sizing. Minor gaps remain: it does not state whether attaching a new mask replaces an existing one, nor how invert interacts with the white/black luminance rule.

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 75% (path, layer, and maskPath documented; invert undocumented). The description's white/black luminance rule adds meaning beyond the schema's maskPath description ('luminance becomes coverage') and partially compensates for the undocumented invert parameter, but it never explicitly explains invert or how replacing an existing mask behaves.

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 states a specific verb and resource: it 'attaches a raster mask from a grayscale image' or 'removes the existing mask.' The white/black luminance rule clarifies the mask semantics, and no sibling tool (replace_layer_image, set_layer, add_image_layer) handles masks, so it is clearly differentiated.

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: use this tool when attaching or removing a mask on a layer. However, it never names alternatives, exclusions, or prerequisites (e.g., what to use instead for editing layer content), despite 13 siblings being present. The unique purpose keeps ambiguity low, but no explicit routing guidance is given.

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