Skip to main content
Glama

Set gradient

gradient_set
DestructiveIdempotent

Replace a node's color ramp stops in an IlluGen project; previous stops are discarded and the project file is updated in place.

Instructions

Replaces a node's color gradient (Color Ramp, Color Interpolate, Geometry Combine Color...).

The previous stops are discarded. Fails if the node has no gradient. Writes the project file in place.
Returns: stops (number written) and color_space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path of the .illugen project file.
graphNoGraph to work in: empty for the top-level graph, or the id or label of a Node_Subgraph node ('outer/inner' for nested subgraphs).
indexNoWhich gradient of the node, for nodes with several. 0 = first.
stopsYesAt least one stop: [[position 0..1, color], ...], color as [r, g, b, a] floats 0..1 or '#rrggbb[aa]'.
node_idYesNode id as a string (from project_summary or node_add), or the node's label if it is unique.
color_spaceNoInterpolation space between stops. Empty = keep the current one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.1.2
    • addedInput schema / properties / color_space / description
      Added value: +"Interpolation space between stops. Empty = keep the current one."
    • addedInput schema / properties / color_space / enum
      Added value: +[
      +  "",
      +  "RGB",
      +  "OKLab",
      +  "sRGB",
      +  "Constant",
      +  "Beer_Lambert"
      +]
    • addedInput schema / properties / graph / description
      Added value: +"Graph to work in: empty for the top-level graph, or the id or label of a Node_Subgraph node ('outer/inner' for nested subgraphs)."
    • addedInput schema / properties / index / description
      Added value: +"Which gradient of the node, for nodes with several. 0 = first."
    • addedInput schema / properties / node_id / description
      Added value: +"Node id as a string (from project_summary or node_add), or the node's label if it is unique."
    • addedInput schema / properties / path / description
      Added value: +"Absolute path of the .illugen project file."
    • addedInput schema / properties / stops / description
      Added value: +"At least one stop: [[position 0..1, color], ...], color as [r, g, b, a] floats 0..1 or '#rrggbb[aa]'."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses exactly what is destroyed ('previous stops are discarded'), the failure condition, that it persists via an in-place project file write, and the return payload. destructiveHint=true and idempotentHint=true are already declared, so this is genuine added context, and it is consistent with them.

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?

Four short sentences, front-loaded with the core action, then destruction, failure, persistence, and return. Every sentence carries distinct information with no filler.

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?

For a destructive 6-parameter mutation with no output schema, the description covers the essential unknowns: what gets overwritten, the failure mode, that the file is written, and the return values. Nothing an agent needs to invoke it safely is missing.

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 every parameter (path, graph, index, stops, node_id, color_space) is already documented in the schema. The description only gestures at 'stops' and 'color_space' via the return summary and adds no syntax or format detail beyond what the schema provides, so the baseline 3 applies.

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?

States a specific verb+resource ('Replaces a node's color gradient') and immediately scopes the applicable node types (Color Ramp, Color Interpolate, Geometry Combine Color). An agent can tell this apart from the analogous curve_set/spline_set siblings because the resource is unambiguous.

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?

Gives the applicability context (which node types have gradients) and a hard precondition ('Fails if the node has no gradient'), which tells the agent when this tool is valid. It does not explicitly name alternatives or when-not-to-use cases, so it stops short of a 5.

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