Skip to main content
Glama

Check a colour pair against WCAG

check_contrast
Read-only

Get a WCAG 2.2 contrast ratio and pass/fail verdict for any foreground/background pair, using hex values or Sekura tokens resolved per theme.

Instructions

WCAG 2.2 contrast ratio and pass/fail verdict for a foreground/background pair. Accepts hex values or Sekura token names — passing tokens resolves them for the chosen theme, including compositing translucent values over the page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
useNoWhat the pair is for. Drives the threshold: 4.5:1 body, 3:1 large text and UI components.
themeNoTheme to resolve token names in (default light).
backgroundYesHex value, or a token name.
foregroundYesHex value, or a token name like "color-text-primary".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.0
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation, the description adds meaningful behavioral details: it resolves token names for the chosen theme and composites translucent values over the page. This helps the agent understand how inputs are processed and that token resolution is theme-dependent. It does not contradict the annotation.

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?

The description is two sentences with no redundant content. It front-loads the core output (contrast ratio and verdict) and then provides the key input behavior (hex/token acceptance, theme resolution, compositing). Every sentence earns its place.

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 low-complexity, read-only calculation tool, the description covers the main inputs, behavior, and result format. The lack of an output schema is mitigated by the explicit mention of 'contrast ratio and pass/fail verdict.' Some details like error handling for invalid hex/tokens could be added, but they are not critical for correct invocation.

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?

The schema already provides 100% coverage with descriptions for all parameters, so the baseline is 3. The description adds value by explaining the token-resolution behavior for foreground and background, including compositing translucent values, which is not fully captured in individual parameter descriptions. It also clarifies the role of the 'use' parameter indirectly by mentioning the pass/fail verdict driven by thresholds, though that is already in the schema.

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 clearly states the verb (check) and resource (a foreground/background pair), specifying exactly what it does: computes the WCAG 2.2 contrast ratio and a pass/fail verdict. It also distinguishes itself from the sibling tools, none of which offer this contrast-checking functionality directly. The mention of accepting hex values and Sekura token names further clarifies scope.

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?

The description implies its use case — checking contrast for a colour pair — but does not explicitly state when to use it versus alternatives like audit_theme or validate_integration. It provides no exclusions or when-not-to-use guidance. The usage context is inferable from the tool's purpose, but not explicitly articulated.

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