Skip to main content
Glama

suggest_contrast_fix

Read-onlyIdempotent

Given failing WCAG contrast pairs, compute the smallest color change to reach AA/AAA. Outputs alternate foreground or background values with achieved ratios.

Instructions

Given failing WCAG color pairs, return the MINIMAL color change that clears the target ratio. For each {fg,bg} pair, computes the smallest foreground adjustment (and an alternative background adjustment) that reaches AA/AAA — with the achieved ratio and direction. Feeds directly from audit_contrast's failing pairs: pass them here to get concrete passing values instead of brute-forcing colors by hand. Pure offline math.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNoWCAG level when targetRatio is not given per-pair. Default AA.
pairsNoColor pairs to remediate. Each: { selector?, fg, bg, fontPx?, bold?, targetRatio? }. fontPx/bold pick the large-text threshold; targetRatio overrides the level.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.9

TDQS

A4.3/5.0
Behavior5/5

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

The aliases already declare readOnly, idempotent, and non-destructive; the description adds meaningful context with 'Pure offline math.' It also discloses exactly what is computed and returned: smallest foreground adjustment, an alternative background adjustment, and the achieved ratio and direction.

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?

The description is front-loaded with the core purpose and avoids verbose fluff. There is some redundancy between 'Given failing WCAG color pairs' and 'audit_contrast's failing pairs,' but each sentence still contributes useful operational context.

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?

With no output schema, the description is sufficiently explicit about what the tool returns: the minimal color change, the achieved ratio, and direction. It also clarifies it's offline, which helps set expectations. An exact response shape is not described, but enough information exists to call it correctly.

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?

The input schema covers all properties at 100%, including the 'level' scale and targetRatio override semantics, so the description doesn't need to re-document them. It adds the helpful note that pairs should come from audit_contrast's failing-pair output, but that is more usage context than parameter-level semantics.

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?

The description specifies a concrete verb and resource: it computes the MINIMAL color change for failing WCAG color pairs. It also distinguishes itself from audit_contrast by stating that it consumes that audit's failing pairs rather than performing the audit.

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?

The description explicitly says to feed it audit_contrast's failing pairs to get concrete passing values, which is clear when-to-use guidance. It frames the tool as the fast path instead of brute-forcing colors, though it does not spell out explicit exclusion cases.

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

Install Server

Other Tools