Skip to main content
Glama

Check color contrast

check_color_contrast
Read-onlyIdempotent

Check text contrast against the WCAG AA threshold (4.5:1, or 3:1 for large text); the AAA verdict is shown only when you pass level: "AAA". Either pass a foreground / background color pair, or pass url + selector to read the element's own text color, background (composited from the nearest painted ancestors), font size and weight from the live page; explicit colors win over the page. A gradient or image background is reported as an error, never a guessed ratio. When it fails, suggests BRAND-aligned replacements — extracts the actual brand palette from the url page using our scanner (CSS vars + most-used colors), or use a provided brandColors array. No url and no brandColors = ratio + pass/fail only. NOTE: on this HOSTED server, localhost and private addresses are refused — it runs in our cloud and cannot reach your machine. Two ways to scan a local dev server: run the MCP locally (npx -y @webability/mcp, simplest — nothing leaves the machine), or open a tunnel (webability-tunnel --port 3000) and pass its URL as url together with the printed secret as tunnel_secret.

Input Schema

NameRequiredDescriptionDefault
urlNoLive page: with `selector`, the colors are read from that element; on a failing pair, the brand palette is extracted from it (uses our scanner — CSS vars + dominant colors).
levelNoConformance level to judge. Default "AA". "AAA" adds the enhanced-contrast (1.4.6) verdict and AAA palette suggestions.
isBoldNoWhether text is bold (default false, or the element's computed weight with url + selector)
contextNoExplain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as "a user", "the customer", or "an account". Example: "Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution."
fontSizeNoFont size in px (default 16, or the element's computed size with url + selector)
selectorNoCSS selector of the text element on `url` (e.g. the `selector` from a scan_page issue)
llm_modelNoThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. "claude-opus-4-8", "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" — never guess.
backgroundNoBackground color (hex or rgb). Optional with url + selector.
foregroundNoForeground color (hex or rgb). Optional with url + selector.
brandColorsNoPre-supplied brand palette. Skips URL extraction if provided.
tunnel_secretNoSecret printed by `webability-tunnel`. Required when `url` is a tunnel URL; the URL alone will be refused by the relay. Ignored otherwise.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / level
      Added value: +{
      +  "description": "Conformance level to judge. Default \"AA\". \"AAA\" adds the enhanced-contrast (1.4.6) verdict and AAA palette suggestions.",
      +  "enum": [
      +    "AA",
      +    "AAA"
      +  ],
      +  "type": "string"
      +}
  2. Changed8 schema fields changed
    • changedInput schema / properties / background / description
      Previous value: -"Background color (hex or rgb)"New value: +"Background color (hex or rgb). Optional with url + selector."
    • removedInput schema / properties / conversation_id
      Removed value: -{
      -  "description": "Echo the conversation_id from the server's previous response. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it.",
      -  "type": "string"
      -}
    • changedInput schema / properties / fontSize / description
      Previous value: -"Font size in px (default 16)"New value: +"Font size in px (default 16, or the element's computed size with url + selector)"
    • changedInput schema / properties / foreground / description
      Previous value: -"Foreground color (hex or rgb)"New value: +"Foreground color (hex or rgb). Optional with url + selector."
    • changedInput schema / properties / isBold / description
      Previous value: -"Whether text is bold (default false)"New value: +"Whether text is bold (default false, or the element's computed weight with url + selector)"
    • addedInput schema / properties / selector
      Added value: +{
      +  "description": "CSS selector of the text element on `url` (e.g. the `selector` from a scan_page issue)",
      +  "type": "string"
      +}
    • changedInput schema / properties / url / description
      Previous value: -"Live URL to extract brand palette from (uses our scanner — CSS vars + dominant colors)."New value: +"Live page: with `selector`, the colors are read from that element; on a failing pair, the brand palette is extracted from it (uses our scanner — CSS vars + dominant colors)."
    • changedInput schema / required
      Previous value: -[
      -  "foreground",
      -  "background"
      -]New value: +[]
  3. Changed1 schema field changed
    • changedInput schema / required
      Previous value: -[
      -  "foreground",
      -  "background",
      -  "context",
      -  "llm_model"
      -]New value: +[
      +  "foreground",
      +  "background"
      +]
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent safety, yet the description adds substantial behavioral context: gradient/image backgrounds are reported as errors rather than guessed, brand palette extraction behavior, and the critical hosted-server limitation (localhost/private addresses refused) with two concrete workarounds. This is exactly the kind of environment-specific constraint an agent needs.

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?

Front-loaded with the core purpose and thresholds, then modes, then the hosted-server caveat. It is dense and long, but nearly every clause carries actionable information; the localhost/tunnel note could arguably be tightened but is not padding.

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?

For an 11-parameter tool with no output schema, the description covers return semantics (ratio, pass/fail, AAA verdict, brand-aligned suggestions), failure modes (gradient/image = error), and the environment constraint. Nothing an agent needs to invoke it correctly is missing.

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%, so the baseline is 3, but the description adds real meaning beyond the schema: the url/selector interaction (reads element colors, extracts palette on failure), the precedence of explicit colors, and the tunnel_secret requirement when url is a tunnel URL. It clarifies cross-parameter behavior the schema documents only per-field.

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 ('Check text contrast against the WCAG AA threshold') with exact thresholds (4.5:1, 3:1 large text), clearly distinguishing it from siblings like check_aria or visual_audit. An agent immediately knows what the tool computes and returns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly lays out the two invocation modes (foreground/background pair vs url+selector), the precedence rule ('explicit colors win over the page'), and the degenerate case ('No url and no brandColors = ratio + pass/fail only'). It also names the alternative workflows for local dev servers (run MCP locally or use a tunnel), leaving nothing 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.