Skip to main content
Glama

Add Gradient

photopea_add_gradient

Replace a layer's pixel content with a linear gradient. Define evenly spaced hex color stops and set an angle for the gradient direction (0° left-to-right).

Instructions

Apply a linear gradient fill to a layer, replacing its current pixel content. The target layer must already exist — use add_layer to create one first. Colors are distributed evenly across the gradient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesLayer name (string) or index (number)
typeYesGradient type (currently only 'linear' is supported)
colorsYesArray of hex color stops distributed evenly along the gradient (minimum 2, e.g. ['#ff0000', '#0000ff'])
angleNoGradient angle in degrees (0 = left-to-right, 90 = top-to-bottom, default 0)
Behavior1/5

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

The description states the tool 'replaces its current pixel content', which implies destructive behavior. However, annotations set 'destructiveHint' to false, contradicting the description. This is a serious inconsistency, and the description does not disclose other behavioral traits beyond this contradiction.

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?

The description is only two sentences, each serving a purpose: stating the action and providing a usage hint. No redundant or unnecessary words.

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

Completeness3/5

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

For a tool with four parameters and no output schema, the description covers the main behavior and a key prerequisite. However, it lacks details about error conditions (e.g., layer locked) or the outcome (e.g., whether the gradient is applied as a fill effect or rasterized). The high schema coverage partially compensates.

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%, so the description adds minimal value. It mentions that colors are distributed evenly, reinforcing the schema's 'minItems: 2' and lack of stop positions. The prerequisite about layer existence is useful but already implied by the schema's required parameter.

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 clearly states the tool applies a linear gradient fill to a layer and replaces its pixel content. It uses a specific verb and resource, and the mention of 'replacing' distinguishes it from sibling tools like 'photopea_add_fill_layer' which likely add a fill as a new layer effect.

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

Usage Guidelines4/5

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

The description provides a prerequisite: the target layer must already exist, and directs the user to use 'add_layer' first. It also clarifies that colors are evenly distributed. However, it does not explicitly state when not to use this tool or provide alternatives for other gradient types.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/attalla1/photopea-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server