Skip to main content
Glama

Generate Smooth Gradient

generate_gradient

Build a 2–5 color OKLab gradient that avoids muddy midpoints, returning CSS with fallback and modern in oklab plus readable text color guidance.

Instructions

Build a smooth gradient from 2 to 5 colors, interpolated in OKLab so the middle never turns muddy. Returns CSS with a fallback plus a modern in oklab version, and tells you whether white or black text stays readable across the whole gradient. Deterministic, no API key needed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "colors": "<colors>"
    },
    "name": "generate_gradient"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeNolinear
angleNo
colorsYes
smoothnessNoExtra stops between colors

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does meaningful work: it discloses the return shape (fallback CSS plus a modern `in oklab` version), the extra contrast verdict on white vs black text, deterministic output, and no API key requirement. It omits edge behavior such as invalid color handling or what happens outside the 2-5 color range, so not a 5.

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?

Three tight sentences, front-loaded with what is produced and followed by the return value. Every clause is relevant; 'no API key needed' is a small operational nugget rather than filler.

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?

Returns are adequately described even without an output schema, which is the main gap this field would otherwise create. However, with only 25% schema coverage and four parameters, the description leaves half the inputs under-explained, so it is only adequately complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 25% (just `smoothness`), so the description should compensate for `type`, `angle`, and `colors` but does not. It restates the 2-5 color bound already in the schema and never explains angle units/orientation per type, color string format (hex vs named), or what `smoothness` stops actually do.

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?

Specific verb and resource ('Build a smooth gradient') plus concrete scope: 2-5 colors, OKLab interpolation. An agent can immediately tell this produces CSS gradients rather than palettes or tokens. It stops short of naming a sibling to distinguish from, e.g. generate_palette, so it lands at 4 rather than 5.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance, and no alternative is named. The agent must infer from the purpose sentence alone that this is the tool for producing gradient CSS rather than a color palette or contrast check.

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