Skip to main content
Glama

Check Contrast

check_contrast

Compute exact WCAG contrast ratios for foreground/background color pairs and get the closest passing color when a pair fails accessibility thresholds.

Instructions

Compute exact WCAG contrast ratios for color pairs and suggest the closest passing color for failures. Deterministic, no API key needed.

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": "check_contrast"
  }
}

Input Schema

NameRequiredDescriptionDefault
pairsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does add useful guarantees — 'deterministic' and 'no API key needed' — which tell the agent there is no auth step and results are reproducible, but it says nothing about output shape, how many pairs can be submitted at once, or whether the suggested passing color is always returned.

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?

Two short sentences, front-loaded with the core operation and followed by the remediation capability and the determinism/auth note. Nothing is padded, though the second sentence could have spent a clause on input expectations instead of only guarantees.

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

Completeness2/5

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

With no annotations, no output schema, and a nested-object input, the description is too thin: it omits batching behavior, the text-vs-ui distinction, and the large-text threshold that determines pass/fail. An agent could call it and get technically correct but contextually wrong results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter is a nested array of pair objects, and the description says only 'color pairs' without explaining that multiple pairs can be batched in one call. The schema's semantic levers — kind ('text' vs 'ui') and large_text, which change the WCAG threshold applied — are never mentioned, so an agent could easily omit large_text for large text and get a misleading failure verdict.

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?

Specific verb and resource: 'Compute exact WCAG contrast ratios for color pairs', plus the secondary capability of suggesting the closest passing color. An agent can distinguish this from siblings like simulate_colorblind or audit_accessibility, though it does not explicitly contrast itself with contrast_matrix, which appears to be the nearest alternative.

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 only implied by the purpose (checking a foreground/background pair against WCAG). There is no statement of when to prefer this over contrast_matrix or audit_accessibility, and no prerequisites or exclusions are given.

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