audit_contrast
Check WCAG contrast ratios for text elements on a page or DOM snapshot. Get AA/AAA pass/fail results, ratio, and fix delta for failing elements.
Instructions
Compute WCAG contrast ratios for every text element on a rendered page (pass url) or from a supplied dom_snapshot. Reports AA (4.5:1 normal, 3:1 large) and AAA pass/fail and surfaces failing pairs with selector, ratio, and delta-to-pass — replacing manual eyedropper + ratio math. dom_snapshot mode returns a row per supplied element; url mode returns counts plus every row that needs action (aa_failures, indeterminate_bg_rows) and OMITS the per-element rows for passing elements, because a real page produces hundreds of thousands of characters of them.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "audit_contrast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to render and measure (http/https or file://) | |
| screenshot | No | Optional base64 PNG for caller reference; ratios are computed from the DOM, not pixels | |
| dom_snapshot | No | Pre-collected text elements to score without rendering |