Skip to main content
Glama

Contrast

check_contrast
Read-only

Check color contrast. Give fg and bg, or pairs (a list of {fg, bg, label, sizePx, bold}), or a palette. Returns the WCAG 2.2 ratio with AA and AAA results for the text size, APCA Lc with what it is enough for, the nearest passing color, and for palettes the color pairs that become indistinguishable under protanopia, deuteranopia or tritanopia. Accepts hex, rgb(), hsl() and CSS names.

Input Schema

NameRequiredDescriptionDefault
bgNoBackground color
fgNoForeground color
boldNoTrue if the text is bold, which changes the large-text threshold
pairsNoSeveral pairs at once
sizePxNoText size in CSS px, default 16
paletteNoColors to test against white, black and each other under color blindness

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / bg / description
      Previous value: -"Background colour"New value: +"Background color"
    • changedInput schema / properties / fg / description
      Previous value: -"Foreground colour"New value: +"Foreground color"
    • changedInput schema / properties / palette / description
      Previous value: -"Colours to test against white, black and each other under colour blindness"New value: +"Colors to test against white, black and each other under color blindness"
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish readOnly/closed-world/non-destructive, so the bar is lower, and the description still adds substantive behavior: exactly which verdicts come back (AA/AAA per text size, APCA Lc, nearest passing color) and that palettes are additionally screened for protanopia, deuteranopia and tritanopia. It stops short of stating limits such as maximum palette or pairs size.

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?

Three sentences, front-loaded with the purpose, then input modes, then outputs — no filler and nothing repeated from the schema verbatim. It is dense with comma-separated result types, so slightly harder to scan than it could be, but every clause carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With six optional parameters and no output schema, the description carries the full burden and does: it documents the input modes, the color formats accepted, and the complete return payload including accessibility-standard specifics. An agent could call this correctly from the description alone.

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%, giving a baseline of 3, but the description adds meaning the schema lacks: accepted color syntaxes (hex, rgb(), hsl(), CSS names) and the shape of a pair entry including label and sizePx used for threshold evaluation. It does not say what happens when no parameters are supplied, despite all six being optional.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Check color contrast") and immediately enumerates the three input modes and the full result set (WCAG 2.2 ratio with AA/AAA, APCA Lc, nearest passing color, CVD pair collisions). The purpose is unmistakable, though it never names why it differs from close siblings such as check_contrast_tokens or css_contrast_pairs.

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?

"Give fg and bg, or pairs..., or a palette" tells the agent which input shape selects which behavior, which is real mode-selection guidance. However, it offers no when-to-use/when-not-to-use framing and no routing to sibling contrast tools, leaving the choice among check_contrast, check_contrast_tokens, css_contrast_pairs and chart_colour_check to inference.

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