对比度审计
browser_contrast_auditAudit WCAG text contrast on the current page, compute foreground/background ratios, and flag AA/AAA violations with CSS selectors to find unreadable text before shipping.
Instructions
Audit WCAG text contrast on the current page. Reads computed foreground/background colors of visible text elements (compositing alpha over ancestors), computes contrast ratio and flags AA (4.5:1 / 3:1 large) or AAA (7:1 / 4.5:1 large) violations with a CSS selector and text snippet. Use this to find unreadable text before shipping. Returns isError when violations exist unless failOnViolation:false.
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": "browser_contrast_audit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | WCAG conformance level (default AA) | |
| tabId | No | Tab id (default: active tab) | |
| maxResults | No | Max violations to report (1–200, default 50) | |
| failOnViolation | No | Return isError when violations exist (default true) |