Skip to main content
Glama

fill_gradient

Apply linear or radial gradients to regions, by default only shading existing pixels. Use dithering for retro palettes.

Instructions

Fill a region with a gradient, by default only where pixels already exist.

Args:
    colors: 2+ colour stops, e.g. ["#000000", "#ff004d", "#ffec27"], spread
        evenly. For dither=True, provide exactly 2 colours.
    gradient_type: "linear" or "radial".
    angle: Direction in degrees for linear gradients (0 = left->right).
    dither: Ordered (Bayer 4x4) dithering between 2 colours instead of smooth
        interpolation, great for limited palettes / retro looks.
    x, y, width, height: Region (defaults to the whole canvas).
    respect_alpha: Leave transparent pixels transparent (default). The gradient
        then shades the artwork inside the region rather than filling the region.
        Pass False to paint the whole rectangle, background included.

Returns `pixels_written` and `pixels_skipped` so the caller can tell how much of
the region was actually covered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoDefault: 0.
yNoDefault: 0.
angleNoDefault: 0.0.
frameNoDefault: 1.
layerNo
widthNo
colorsYes
ditherNoDefault: false.
heightNo
filenameYes
gradient_typeNoDefault: "linear".linear
respect_alphaNoDefault: true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv0.10.0
    • addedInput schema / properties / angle / description
      Added value: +"Default: 0.0."
    • removedInput schema / properties / angle / title
      Removed value: -"Angle"
    • removedInput schema / properties / colors / title
      Removed value: -"Colors"
    • addedInput schema / properties / dither / description
      Added value: +"Default: false."
    • removedInput schema / properties / dither / title
      Removed value: -"Dither"
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • addedInput schema / properties / frame / description
      Added value: +"Default: 1."
    • removedInput schema / properties / frame / title
      Removed value: -"Frame"
    • addedInput schema / properties / gradient_type / description
      Added value: +"Default: \"linear\"."
    • removedInput schema / properties / gradient_type / title
      Removed value: -"Gradient Type"
    • removedInput schema / properties / height / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / height / default
      Removed value: -null
    • removedInput schema / properties / height / title
      Removed value: -"Height"
    • addedInput schema / properties / height / type
      Added value: +"integer"
    • removedInput schema / properties / layer / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / layer / default
      Removed value: -null
    • removedInput schema / properties / layer / title
      Removed value: -"Layer"
    • addedInput schema / properties / layer / type
      Added value: +"string"
    • addedInput schema / properties / respect_alpha
      Added value: +{
      +  "default": true,
      +  "description": "Default: true.",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / width / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / width / default
      Removed value: -null
    • removedInput schema / properties / width / title
      Removed value: -"Width"
    • addedInput schema / properties / width / type
      Added value: +"integer"
    • addedInput schema / properties / x / description
      Added value: +"Default: 0."
    • removedInput schema / properties / x / title
      Removed value: -"X"
    • addedInput schema / properties / y / description
      Added value: +"Default: 0."
    • removedInput schema / properties / y / title
      Removed value: -"Y"
    • removedInput schema / title
      Removed value: -"fill_gradientArguments"
  2. First observedv0.7.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and openWorldHint=false; the description goes further by explaining that respect_alpha=True shades existing artwork while False paints the whole rectangle including background, and that the call reports pixels_written/pixels_skipped. It does not mention permissions or layer targeting limits across the 12 params.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded one-line summary followed by a tight Args list where each entry adds distinct information; the closing sentence about return values is one line. Slightly long but essentially no filler.

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?

For a 12-parameter mutation tool with no output schema and thin annotations, the description supplies the missing alpha/dither semantics and even explains the return payload, which compensates for the absent output schema. Only the frame/layer parameters are left unaddressed.

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?

Schema coverage is only 58% and most schema descriptions are bare 'Default: X', so the description carries real weight: it gives the colors array format with an example, the dither=exactly-2-colours constraint, angle's 0=left->right convention, and the region defaults. It leaves filename, frame, and layer undocumented.

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?

States a specific verb and resource ('Fill a region with a gradient') and immediately narrows scope with 'by default only where pixels already exist.' An agent can distinguish this from solid fill_area or palette-gradient gradient_map by the region+gradient framing, though no sibling is named explicitly.

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

Usage Guidelines3/5

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

Offers contextual guidance for options ('dither ... great for limited palettes / retro looks') and explains the default alpha behavior, but never states when to prefer this tool over the many neighboring fill/gradient tools (fill_area, gradient_map, dither_band). Usage is implied rather than routed.

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