Skip to main content
Glama

apply_mask

Protect image regions during processing by applying a mask to a target view; black areas stay unchanged while white areas allow edits. Optionally invert the mask to swap protected and editable areas.

Instructions

Apply a mask to a target view. The mask protects areas where it is black (0) and allows processing where it is white (1). Use inverted=true to flip this.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mask_idYesMask view ID
invertedNoInvert the mask (default false)
target_idYesTarget view ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description must carry the behavioral disclosure burden. It does explain what the mask does to processing (protect black, allow white) and how inverted changes it, which is valuable. However, it does not disclose whether applying a mask replaces an existing mask, whether it is reversible, or what side effects occur on the target view.

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 fluff. The primary action and semantics are front-loaded, and the inverted guidance is a natural follow-up. Every sentence 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?

The description is sufficient for a simple masking operation: it explains what the mask does, how the target view is affected, and how to invert. It does not mention how this interacts with downstream processing tools, but the phrase 'allows processing where it is white' implies the intended workflow. Given no output schema and a simple parameter set, this is nearly complete.

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?

The input schema already describes all three parameters with 100% coverage, so the baseline is 3. The description adds meaning by clarifying the mask value semantics (0=black protects, 1=white allows) and explicitly linking inverted=true to flipping this behavior, which goes beyond the schema text.

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 clearly states the verb and resource: applying a mask to a target view, and it explains the mask's semantics (black protects, white allows processing). It does not explicitly name a sibling alternative like remove_mask, but the core action is unambiguous enough to distinguish it from create/remove/close mask tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

The description implies the tool is used to restrict processing on a view, but it gives no explicit when-to-use or when-not-to-use guidance. It mentions inverted=true, a parameter directive, but does not describe when to prefer this over related tools such as remove_mask or create_luminance_mask.

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