Skip to main content
Glama

Set Clipping Mask

photopea_set_clipping_mask
Idempotent

Clips a layer to the layer directly below so it shows only where that layer has pixels; set enabled to false to release the clipping mask.

Instructions

Clip a layer to the layer directly below it, so it only shows where that layer has pixels (e.g. a photo or texture confined to a text or shape). Set enabled to false to release it.

Input Schema

NameRequiredDescriptionDefault
targetYesLayer name (string) or index (number)
enabledNotrue clips the layer to the one below, false releases it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A3.8/5.0
Behavior4/5

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

With annotations already declaring non-readOnly, idempotent and non-destructive, the description adds genuinely useful behavior: the operation is reversible via enabled=false, which tells the agent it can release a clip rather than delete anything. It omits edge cases such as what happens when the target layer has nothing beneath it, which is a minor gap given the annotation coverage.

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 tight sentences that lead with the core action, then give the visual rationale and the release mechanism. The parenthetical example earns its place by making the effect concrete; nothing is redundant.

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, fully documented, non-destructive layer operation with annotations covering the safety profile, the description covers what is needed. The only missing piece is failure behavior when the target is the bottom layer or has no layer below to clip against.

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 description coverage is 100%, so the schema already documents both parameters and the default for enabled. The description does add a small clarification that target refers to the layer being clipped while the base is the one directly below, but it largely restates what the schema and its enabled description already say.

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 and resource ('Clip a layer to the layer directly below it') and explains the visual effect, so an agent knows exactly what operation this performs. It does not name the nearest related sibling, photopea_layer_mask, so the distinction between a clipping mask and a layer mask must be inferred.

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 only implied through the example 'a photo or texture confined to a text or shape', which conveys the typical scenario. There is no explicit statement of when to prefer this over photopea_layer_mask or group-based masking, and no prerequisites or exclusions are given.

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