Skip to main content
Glama

generate_gradient

Gradient Generator — Blend two or more colours into a PNG image. Unlike the web page, which writes a line of CSS, this produces a real picture a later step can composite or stamp on. [category: generate]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthNoOut-of-range values are pulled back rather than refused. Width times height is also capped at 8 megapixels; over that, both sides shrink together and the shape is kept.
colorsYesTwo to sixteen colours, in order. Hex (#E05535, #E55, or with alpha #E05535FF) or a colour name. Fewer than two or more than sixteen is refused, not trimmed.
formatNoPNG only. Any other value is refused.png
heightNoOut-of-range values are pulled back rather than refused. See the note on width about the 8 megapixel cap.
directionNoWhich way the blend runs: a CSS side or corner ('to right', 'to bottom left'), an explicit angle ('135deg', '-45'), 'radial' for a circular blend, or 'conic' for one that sweeps around. A direction we do not recognise is refused rather than quietly becoming top-to-bottom.to right
positionsNoWhere each colour sits along the blend, as a percentage from 0 to 100: one entry per colour, in the same order. Two colours at the same stop make a hard edge (0, 50, 50, 100). Leave it out and the colours are spaced evenly. A list without exactly one entry per colour is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / positions / x-ui / unset_label
      Added value: +"Spaced evenly"
  2. Changed1 schema field changed
    • changedInput schema / properties / positions / description
      Previous value: -"Optional, and API-only for now: the builder cannot draw it safely yet. Where each colour sits along the blend, as a percentage, one entry per colour. Leave it out and the colours are spaced evenly. The API accepts it normally; it is hidden in the builder because the control an array gets there is a chip list, and a chip list DISCARDS DUPLICATES — a hard-edged gradient needs two colours at the same stop (0,50,50,100) and the chips would silently collapse that to three stops and change the picture. Same defect class as pdf_merge.pageRanges. Show it once there is a control that keeps one entry per colour."New value: +"Where each colour sits along the blend, as a percentage from 0 to 100: one entry per colour, in the same order. Two colours at the same stop make a hard edge (0, 50, 50, 100). Leave it out and the colours are spaced evenly. A list without exactly one entry per colour is refused."
  3. Added

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already indicate non-readOnly and non-destructive, so the description adds context about producing a real picture for later compositing. It does not disclose further behavioral traits such as output format details, file handling, or side effects, but given annotations cover the safety profile, this is adequate.

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 zero waste. The main purpose is front-loaded, and the differentiation from the web page is concise. The category tag adds organization without verbosity.

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?

Given the tool's moderate complexity (6 parameters, no output schema), the description is minimal. It mentions the output is a PNG image and hints at compositing use, but does not explain how the result is returned (e.g., file path or binary) or any additional context about using the tool effectively. The schema covers parameters, but the description lacks output/return information.

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 parameters are fully documented in the schema. The description adds no parameter-specific information, so the baseline of 3 applies. The description does not need to repeat schema details.

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 blends two or more colours into a PNG image, and distinguishes it from a web-page variant that produces CSS. This is specific and differentiates it from sibling generate_* tools like generate_color_palette or generate_placeholder_image.

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 explicitly contrasts with the web page alternative, indicating when to choose this tool (when a real raster image is needed for compositing). It does not mention other generate_* tools, but the differentiation from the CSS-writing variant provides clear context for a key use case.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources