Skip to main content
Glama

photoshop_apply_gradient_mask

Apply a black-to-white linear gradient to the active layer mask, creating soft edge fades and blending the layer into the background. Use it to fade edges or blend subjects when a layer mask is already present.

Instructions

Apply a linear black-to-white gradient on the active layer mask channel (fade/blend).

Users often say: fade into background, gradient mask, blend subject, soft edge fade.

This paints on an existing layer mask — not a Gradient Fill layer. Use when: softening edges or fading a layer into the background through its mask. Do NOT use when: subject is not isolated — use photoshop_recipe_remove_background or photoshop_create_layer_mask first.

Returns: JSON { ok, summary, details: { applied, direction, angle, mask_auto_created? } }. Preconditions: active document and active layer. Creates a reveal-all mask if none exists. Side effects: modifies layer mask pixels; two history steps when mask is auto-created.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_pctNoGradient end along fade axis (0-100)
angle_degNoOverride gradient angle in degrees (optional)
directionNoGradient fade direction on the mask (default bottom_to_top)bottom_to_top
start_pctNoGradient start along fade axis (0-100)
document_idNoOptional Photoshop document id from photoshop_get_state / photoshop_list_documents. When set, the tool activates that document before running so a UI tab switch cannot retarget the edit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries full burden and does so thoroughly: it discloses preconditions (active document and layer), auto-creation of a reveal-all mask if none exists, and side effects (modifies mask pixels, two history steps when auto-created). It even specifies the return JSON structure, leaving no ambiguity about behavior.

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?

Every sentence earns its place. The core action is front-loaded, followed by user phrasing, a critical distinction (not a fill layer), usage conditions, return format, preconditions, and side effects. The structure with line breaks aids scanning and there is no filler.

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

Completeness5/5

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

The description is complete for a mutation tool: it covers preconditions, side effects, return format, and even history steps. There is no output schema, but the return JSON is fully specified. All parameters are documented in the schema, and the tool's behavior is unambiguous.

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 100% with descriptive text for each parameter, so baseline is 3. The description adds some contextual meaning (e.g., that the gradient applies to the mask, and direction/angle appear in the return), but does not elaborate on start_pct/end_pct beyond schema. It adds marginal value, not enough to exceed baseline.

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 verb and resource: 'Apply a linear black-to-white gradient on the active layer mask channel'. It clearly distinguishes from a Gradient Fill layer and lists common user phrasings, making the intent unmistakable and differentiating it from siblings like photoshop_apply_gradient_map.

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

Usage Guidelines5/5

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

Explicitly provides 'Use when' and 'Do NOT use when' conditions, naming alternatives (photoshop_recipe_remove_background, photoshop_create_layer_mask) for the negative case. Also clarifies it operates on an existing mask, not a fill layer, so an agent knows when to select it.

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

Deploy Server

Other Tools