Skip to main content
Glama

check_contrast

Idempotent

Check if text, buttons, links, and images meet WCAG contrast ratios (4.5:1 for text, 3:1 for graphics) and report each failing element with its ratio and colors.

Instructions

Check that text, buttons, links and images stand out from their background: WCAG's 4.5:1 for text (3 for large text) and 3:1 for images unless text_ratio and graphics say otherwise, and with edges, a button's or field's edge too. It raises the window and measures a picture of the screen in each node's bounds. The answer: each node that fails, a tree line with bounds, its ratio and colors, or "No problems."; then what it couldn't measure, which doesn't fail (too small, or GTK 4's, whose positions are wrong), and why. A window where nothing can be measured, as GTK 4's, is an error, not a pass. Switches, sliders, check boxes, disabled nodes and what's scrolled out of view are skipped. For missing names, use check_accessible_names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
edgesNoLeast for edges (unchecked)
ignoreNoRegexes for lines that can't be fixed yet
windowNoA window's title, exactly or a regex matched in full, or app=RE for its app id
sessionYesIts name, from start_session
graphicsNoLeast for images (3)
text_ratioNoLeast for text (4.5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.1

TDQS

A4.6/5.0
Behavior5/5

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

Without relying on annotations, it discloses the side effect of raising the window and capturing the screen in each node's bounds, the exact result shape (failed nodes with bounds, ratio, colors, or 'No problems.', plus unmeasurable items), and the critical behavioral rule that an unmeasurable window is an error rather than a pass. This explains why readOnlyHint=false despite being an analysis tool.

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?

The purpose is front-loaded and nearly every sentence carries unique information about thresholds, skips, output or errors. The prose is occasionally run-on (the 'The answer: ... ; then what it couldn't measure' sentence), which costs some clarity but not much length.

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 no output schema, the description fully carries the burden: it describes the return values, the failure semantics, the error condition and the exclusion set for a 6-parameter tool. Nothing an agent needs to call and interpret this tool 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 meaning by tying text_ratio (4.5), graphics (3) and edges to WCAG rationale and explaining that the ratio parameters override the defaults. It does little extra for window, session and ignore, which the schema already covers.

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 and resource: check that text, buttons, links and images stand out from their background, and grounds it in WCAG ratios. It also explicitly distinguishes itself from the sibling check_accessible_names for name problems, so an agent can route without opening either schema.

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?

Names the alternative tool for missing names and enumerates what is skipped (switches, sliders, check boxes, disabled nodes, scrolled-out content), which is real usage context. It stops short of a general 'use this when / not when' framing beyond that one routing hint.

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