Skip to main content
Glama

a11y_suggest_color

Suggests the nearest opaque foreground color that meets a target contrast ratio against a background, and reports the resulting ratio plus lighten/darken direction.

Instructions

Nearest opaque color (RGB distance) to fg that reaches the target ratio against bg (4.5 default). Returns the color, its ratio and whether it lightens or darkens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bgYes
fgYes
targetNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.3.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations, so the description carries the full burden. It discloses the algorithm (nearest opaque color using RGB distance) and that it returns the color, its ratio, and whether it lightens or darkens, which is helpful. However, it omits whether the suggested color is guaranteed to meet the target, how ties are handled, and any failure behavior.

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?

A single, information-dense sentence that front-loads the most important details (what it returns, the algorithm) with no wasted words.

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?

For a 3-parameter function with no output schema and no annotations, the description covers the return concept and default target but lacks details on the color input format, edge-case behavior, and guarantees (e.g., if target is unreachable). It is minimally sufficient but leaves gaps.

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?

With 0% schema description coverage and 3 parameters, the description only partially compensates: it states that fg and bg are colors and target is the ratio (default 4.5), but the parameter names (fg, bg, target) are still not explicitly linked, and the color format (e.g., hex, rgb) is not specified.

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 (suggest) and resource (color), describes the algorithm (nearest opaque color by RGB distance), the goal (reaching a target contrast ratio against bg), and the expected output. Clearly distinct from siblings like a11y_contrast_pair which checks contrast.

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?

Implied usage is clear from 'suggest' and the contrast target, but there are no explicit when-to-use/when-not statements or references to alternatives like a11y_autofix or a11y_contrast_pair.

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