Skip to main content
Glama

check_contrast

Compute WCAG 2.x contrast ratios and AA/AAA pass flags for a foreground/background hex pair, using local math with no network calls.

Instructions

Compute WCAG 2.x contrast ratio and AA/AAA pass flags for a foreground/background hex pair. Pure local math — no network.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backgroundYesBackground color as #RGB or #RRGGBB (e.g. #ffffff)
foregroundYesForeground color as #RGB or #RRGGBB (e.g. #000000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It helpfully discloses 'Pure local math — no network,' which signals a deterministic, side-effect-free, offline operation. However it says nothing about error behavior for malformed hex input or the exact shape/order of the returned flags, and there is no output schema to fall back on.

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?

Two tight sentences with zero waste: the primary action leads, and the follow-on behavioral note ('no network') is short and load-bearing rather than filler.

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?

For a two-parameter pure-computation tool with fully documented parameters, the description covers purpose and the key non-functional trait. Minor gap: with no output schema, the 'AA/AAA pass flags' hint is the only clue about return contents, so an agent lacks full return-value detail, though the tool's complexity makes this acceptable.

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 both parameters (foreground, background, with #RGB/#RRGGBB formats and examples) are already fully documented. The description only names them as a 'hex pair' and adds no format or constraint detail beyond the schema. 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 precise verb+resource: computes WCAG 2.x contrast ratio and AA/AAA pass flags for a hex pair. The sibling tools (generate_palette, search_tools) do entirely different jobs, so an agent can identify this tool's function 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 is implied by the description — you call it when you have a foreground/background pair and need contrast compliance — but there is no explicit when-to-use, prerequisite, or alternative statement (e.g. versus generate_palette). Minimum viable guidance only.

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

Deploy Server

Other Tools