Check contrast
check_contrastMeasure text/background contrast using WCAG 2 and APCA, then get the closest text color that passes your requested AA or AAA level.
Instructions
Measures text/background contrast with WCAG 2 (ratio) and APCA (Lc). If it fails the requested level, suggests the closest text color that passes.
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": {
"text": "<text>",
"background": "<background>"
},
"name": "check_contrast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text color in hex | |
| level | No | AA | |
| background | Yes | Background color in hex |