Skip to main content
Glama

generate_ramp

Build a dark-to-light shading ramp from a base color with optional hue and saturation shifts, returning palette-ready hex colors and warnings when lightness clamping reduces distinct steps.

Instructions

Generate a shading ramp from a base colour (dark -> light).

Produces `steps` colours by varying lightness across `light_range`, optionally
rotating hue by `hue_shift` total degrees across the ramp (classic pixel-art
hue shifting: cool shadows / warm highlights) and scaling saturation by
`saturation_shift` percent across the ramp.

Args:
    filename: If set with apply, write the ramp into that sprite's palette.
    apply: "none" (just return), "append" (add to palette), or "replace".

Returns the ramp as a list of "#RRGGBB" colours (darkest first), with `distinct`, how
many of them are different from each other.

**`distinct` is not always `steps`.** Lightness is clamped at both ends, so a base
already near white or near black spends its outermost steps on the same colour: nine
steps in, eight colours out. The ramp is still returned, because clamping is the honest
result of the inputs and a caller may not care, but `warnings` then names which end
collapsed and the nearest `light_range` that would not.

It is worth caring about at least once. `specular_highlight` needs the ramp's top step
to be brighter than what `shade_region_by_light` spread across the lit side, so a ramp
whose top two entries are both `#ffffff` makes that call refuse, with a message about
the shading pass. The cause is two calls earlier, in this one, which used to report
success either way.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applyNoDefault: "none".none
stepsNoDefault: 5.
easingNoDefault: "linear".linear
filenameNo
hue_shiftNoDefault: 0.0.
light_hueNo
sat_curveNoDefault: "linear".linear
base_colorYes
shadow_hueNo
light_rangeNoDefault: 0.6.
saturation_shiftNoDefault: 0.0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed20 schema fields changedv0.10.0
    • addedInput schema / properties / apply / description
      Added value: +"Default: \"none\"."
    • removedInput schema / properties / apply / title
      Removed value: -"Apply"
    • removedInput schema / properties / base_color / title
      Removed value: -"Base Color"
    • addedInput schema / properties / easing
      Added value: +{
      +  "default": "linear",
      +  "description": "Default: \"linear\".",
      +  "type": "string"
      +}
    • removedInput schema / properties / filename / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / filename / default
      Removed value: -null
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • addedInput schema / properties / filename / type
      Added value: +"string"
    • addedInput schema / properties / hue_shift / description
      Added value: +"Default: 0.0."
    • removedInput schema / properties / hue_shift / title
      Removed value: -"Hue Shift"
    • addedInput schema / properties / light_hue
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / light_range / description
      Added value: +"Default: 0.6."
    • removedInput schema / properties / light_range / title
      Removed value: -"Light Range"
    • addedInput schema / properties / sat_curve
      Added value: +{
      +  "default": "linear",
      +  "description": "Default: \"linear\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / saturation_shift / description
      Added value: +"Default: 0.0."
    • removedInput schema / properties / saturation_shift / title
      Removed value: -"Saturation Shift"
    • addedInput schema / properties / shadow_hue
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / steps / description
      Added value: +"Default: 5."
    • removedInput schema / properties / steps / title
      Removed value: -"Steps"
    • removedInput schema / title
      Removed value: -"generate_rampArguments"
  2. First observedv0.7.0

TDQS

A3.9/5.0
Behavior5/5

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

With only readOnlyHint=false and openWorldHint=false available, the description carries the full burden and does so well: it discloses that apply mutates a sprite palette, that lightness clamping can make distinct < steps, that warnings name the collapsed end plus a corrective light_range, and that a degenerate top step makes specular_highlight refuse downstream. That is exactly the non-obvious behavior an agent needs.

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

Conciseness3/5

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

Front-loaded purpose and Args block are fine, but the final three paragraphs are discursive and repeat the distinct/steps point multiple times ('It is worth caring about at least once...'). The Args section also partly restates schema fields. Informative, but not tight.

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?

No output schema exists, so the description correctly documents the return value (list of '#RRGGBB', darkest first) plus distinct and warnings. For an 11-parameter mutating tool this is nearly sufficient, with the main gap being the unexplained easing, sat_curve, light_hue, and shadow_hue parameters.

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 description coverage is 64% and the schema's own parameter descriptions are near-useless (mostly just restated defaults). The prose compensates by explaining steps, light_range, hue_shift, saturation_shift, base_color, apply, and filename semantics — 7 of 11. easing, sat_curve, light_hue, and shadow_hue remain undocumented in both places, keeping it short of a 5.

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?

Opens with a specific verb+resource+scope: 'Generate a shading ramp from a base colour (dark -> light).' An agent immediately knows the operation and the direction convention. It does not, however, distinguish itself from close siblings like ramp_between, ramp_from_art, or shift_along_ramp, so sibling selection still requires inference.

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?

It clarifies the three apply modes (none/append/replace) and filename pairing, and gives a strong downstream caveat about when to care about collapsed ramps feeding specular_highlight. But it never states when to choose this tool over ramp_between or ramp_from_art, so alternative-routing guidance is implied rather than explicit.

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