Skip to main content
Glama

color contrast

color_contrast
Read-only

WCAG 2.2 colour contrast check: ratio for text and background colours (hex, rgb, hsl or names), pass / fail for AA and AAA normal and large text and UI components, and a corrected foreground colour that passes AA. Costs $0.002 USDC per call (x402).

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": {
      "foreground": "<foreground>",
      "background": "<background>"
    },
    "name": "color_contrast"
  }
}

Input Schema

NameRequiredDescriptionDefault
backgroundYes
foregroundYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, openWorldHint=true). The description adds genuinely new behavioural context the annotations do not: it is a paid x402 endpoint costing $0.002 USDC per call, and it discloses the returned artefacts (ratio, pass/fail verdicts, suggested fix). Invalid-input or error behaviour is not described.

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?

A single front-loaded sentence that leads with the capability, then the outputs, then the cost. Every clause adds information; nothing is redundant with the schema or annotations.

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?

With no output schema, the description correctly takes on describing return values, and it covers both parameter formats and the payment requirement. Only minor gaps remain, such as what happens on unparseable colour input or whether the corrected colour is returned per target level.

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 description coverage is 0%, so the description must carry the parameter burden. It identifies both inputs by role (text colour and background colour) and enumerates accepted colour formats (hex, rgb, hsl or names), which is the key ambiguity for an agent calling this tool.

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 specific verb+resource (WCAG 2.2 colour contrast check) and enumerates exactly what it computes: contrast ratio, AA/AAA pass/fail for normal text, large text and UI components, plus a corrected foreground. That narrow, well-defined scope separates it from the broader a11y_audit and report_accessibility siblings without needing to name them.

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 scope (check a foreground/background pair against WCAG), and the cost note tells the agent the call is paid. But there is no explicit when-to-use, when-not-to-use, or pointer to an alternative such as a11y_audit for whole-page audits.

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