Skip to main content
Glama

WritersLogic business agents

contrast-fix

WCAG 2.2 contrast check with the minimal OKLCH lightness fix and colour-blind pair check — Checks up to 50 foreground/background hex pairs against a WCAG 2.2 contrast threshold (4.5 AA text, 3 large text and UI, 7 AAA, or your own) on the unrounded ratio, so 4.499 fails and exactly 4.5 passes, and for a failing pair returns the closest colour by OKLCH lightness (chroma and hue held, gamut-clipped, 8-bit) that meets it. Optionally simulates protanomaly, deuteranomaly and tritanomaly (Mac

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": {
      "pairs": "<pairs>"
    },
    "name": "contrast-fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoaa-normal 4.5 (default), aa-large 3, aaa-normal 7, aaa-large 4.5, non-text 3 (WCAG 2.2 SC 1.4.3, 1.4.6, 1.4.11).
pairsYesForeground/background pairs.
fixTargetNoWhich colour to move for a failing pair (default foreground); none skips the fix.
thresholdNoOverrides level: the minimum contrast ratio.
cvdSeverityNoEnables the colour-vision-deficiency check at this severity, 0 to 1 (1.0 is dichromacy); between the published 0.1 steps the matrices are interpolated.
cvdMinDeltaENoSmallest OKLab distance counted as distinguishable (default 0.05, a heuristic, not a standard).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/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 substantial work: it discloses the unrounded-ratio comparison and its exact boundary behavior (4.499 fails, exactly 4.5 passes), that fixes hold chroma and hue, gamut-clip, and round to 8-bit, and that the deltaE default is a heuristic rather than a standard. It loses a point because the sentence truncates mid-clause during the CVD simulation explanation, leaving that behavior only partly described.

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?

The key scope is front-loaded, which is good, but the content is packed into one long run-on sentence with nested parentheticals that is hard to parse, and it ends abruptly mid-word. Information density is high but structure works against readability.

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?

There is no output schema, so the description must convey return shape; it covers the fixed colour but not the per-pair result structure (ratio, pass/fail, level applied, CVD results). Combined with the truncated CVD sentence, an agent can call this correctly but has an incomplete picture of what comes back for the colour-blindness path.

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 coverage is 100%, so the baseline is 3, but the description adds interpretive value: it explains what the threshold means against the unrounded ratio and what 'fixTarget' does mechanically (move the colour in OKLCH lightness while holding chroma/hue). The truncated CVD passage prevents a 5.

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 names a specific verb and resource: a WCAG 2.2 contrast check with a minimal OKLCH lightness fix and a colour-blind pair check. Scope (up to 50 foreground/background hex pairs) and output behavior (closest compliant colour for failing pairs) are stated, so an agent can distinguish this from generic color or accessibility utilities without opening the schema.

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?

Usage context is implied rather than stated: threshold levels, defaults (foreground fix, aa-normal), and the 'none' opt-out are described, which tells an agent how to invoke it. There is no explicit when-to-use/when-not guidance or routing to an alternative for, say, non-color accessibility auditing, and the sentence is cut off mid-thought, so the guidance is only partially actionable.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources