Skip to main content
Glama

photoshop_fill_gradient

DestructiveIdempotent

Paint a two-color linear gradient across the active layer's pixels, choosing start and end RGB colors plus direction to create color blends or ramps.

Instructions

Paint a two-color linear gradient on the active layer pixels.

Use when: the user asks for a color gradient, blend, or "mavi yeşil" style ramp on a layer. Do NOT use when: a flat color is enough — use photoshop_fill_layer. Do NOT use when: the gradient should fade the layer into the background — use photoshop_recipe_gradient_fade. Do NOT use when: you would write ExtendScript. Document.gradients does not exist.

Returns: the two colors and direction applied. Preconditions: active document and an unlocked non-text layer. Side effects: overwrites those pixels, one history step. The same colors on the same pixels are idempotent. Reversible with photoshop_undo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toRedYesEnd red (0-255)
toBlueYesEnd blue (0-255)
fromRedYesStart red (0-255)
toGreenYesEnd green (0-255)
fromBlueYesStart blue (0-255)
directionNoGradient axis. Default left_to_right.
fromGreenYesStart green (0-255)
document_idYesPhotoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.7.33
    • changedInput schema / properties / document_id / description
      Previous value: -"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null to use the active document. A number activates that document before the tool runs."New value: +"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call."
  2. Addedv1.7.32

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes further: it names preconditions (active document, unlocked non-text layer), side effects (overwrites pixels, one history step), confirms idempotency for identical colors/pixels, and states reversibility via photoshop_undo. Consistent with, and additive to, 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?

Front-loaded one-line purpose followed by labeled sections (Use when / Do NOT use when / Returns / Preconditions / Side effects). Every sentence carries distinct operational value; no padding.

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?

Despite having no output schema, the description states the return value, preconditions, side effects, idempotency, and reversibility — everything an agent needs to call and reason about a destructive pixel operation correctly.

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 all 8 parameters (RGB channels, direction enum, document_id) are already documented in the schema. The description adds only 'two colors and direction' at a high level, which matches the schema without adding format or edge-case detail. Baseline 3.

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?

Specific verb (Paint) + resource (two-color linear gradient) + scope (active layer pixels). Clearly distinguishable from photoshop_fill_layer and photoshop_recipe_gradient_fade, both of which are named.

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?

Explicit 'Use when' with concrete triggers (gradient/blend/color ramp) and three 'Do NOT use when' clauses that each route to a specific alternative (photoshop_fill_layer for flat color, photoshop_recipe_gradient_fade for fading into background). Nothing is left to inference.

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