Skip to main content
Glama

check_contrast

Score any foreground/background color pair for readability. Get WCAG 2.2 ratio with AA/AAA verdicts plus APCA Lc value, revealing dark-theme pairs that WCAG 2.x passes despite poor contrast.

Instructions

Score a foreground/background pair for readability. Reports the WCAG 2.2 ratio with AA/AAA verdicts and the APCA Lc value, which is the better guide for dark themes where WCAG 2.x passes pairs that are hard to read.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backgroundYesBackground colour in the same formats.
foregroundYesText colour as #rgb, #rrggbb, or rgb(r, g, b).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.2/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 discloses what the tool returns (WCAG 2.2 ratio, AA/AAA verdicts, APCA Lc) plus a limitation of WCAG 2.x on dark themes. It omits minor details like how large-text exceptions are handled, but is otherwise transparent.

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 well-structured sentences with no filler. The action and resource are front-loaded, and the APCA caveat is placed after the primary output description where it adds useful 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?

For a two-parameter check with no output schema, the description names both output families and provides a meaningful usage caveat. The main gap is not specifying whether AA/AAA verdicts assume normal text, large text, or both, but this is minor for a simple scoring tool.

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 coverage is 100%, and both parameters are already described clearly in the schema, including accepted color formats via 'same formats'. The description adds little beyond the pair concept already implied by the parameter names.

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?

Uses a precise verb ('Score') and object ('foreground/background pair'), then names the concrete metrics returned. This clearly distinguishes it from generation-oriented siblings like suggest_pairing and build_palette.

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?

Provides clear context: the tool is for evaluating a specific color pair, and the APCA note gives actionable guidance for dark themes. It does not explicitly name sibling alternatives or exclusions, but the intended use is unambiguous.

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