Remediate Tool
The remediate tool takes one or more accessibility issues identified by the analyze or igt tool and generates context-aware, AI-powered remediation guidance that coding agents can translate into actual code fixes. Issues are submitted as a batch, so a single call can return fixes for every violation found on a page.
What It Does
- Authentication - Validates the user's credentials—either an API key or an OAuth 2.0 access token—to ensure authorized access
- AI Credit Usage - Each issue in the batch consumes AI credits from your organization's allocation, enabling the use of advanced AI models trained on Deque's extensive accessibility expertise
- AI-Generated Remediation - Crafts high-quality, actionable accessibility fixes that coding agents can interpret and implement in the source code
If AI credits are depleted, the remediate tool will no longer work until your credits are restored (either by purchasing more or your monthly cycle resets). However, the analyze tool will continue to function.
Batch Remediation
The tool accepts an issues array. Submit all the issues from a single analyze or igt run together in one call rather than calling the tool once per issue — a batch supports between 1 and 25 issues.
Each issue has the following fields:
| Field | Required | Description |
|---|---|---|
id |
Yes | A caller-chosen identifier, unique within the batch (e.g., the rule ID plus a counter: color-contrast-0). Used only to correlate each result to its input. |
rule |
Yes | The Axe rule ID from the analyze/igt output (e.g., color-contrast, image-alt). |
elementHtml |
Yes | The HTML snippet of the violating element. |
remediation |
Yes | A description of what's wrong and what needs fixing, taken from the issue's summary (optionally enriched with its description, help text, or AI reasoning). |
pageUrl |
No | The URL of the page being remediated, from the analyze response. |
Prompt your AI agent in natural language — it assembles the batch from the analysis results:
Analyze http://localhost:3000 and remediate every issue foundThe agent resolves the prompt and calls the remediate tool with a payload similar to:
{
"issues": [
{
"id": "color-contrast-0",
"rule": "color-contrast",
"elementHtml": "<span style=\"color: #aaa\">Sign up</span>",
"remediation": "Increase the contrast ratio to at least 4.5:1",
"pageUrl": "http://localhost:3000"
},
{
"id": "image-alt-1",
"rule": "image-alt",
"elementHtml": "<img src=\"logo.png\">",
"remediation": "Add alt text describing the image"
}
]
}Output
The tool returns an array of per-issue results, each keyed back to its input by id. A result is one of two shapes:
- Success —
status: "ok", with aremediationobject containing a general description, the remediation steps, and a concrete code fix - Error —
status: "error", with anerrorobject (codeandmessage) for an issue that could not be remediated
{
"data": [
{
"id": "color-contrast-0",
"status": "ok",
"remediation": {
"general_description": "...",
"remediation": "...",
"code_fix": "<span style=\"color: #595959\">Sign up</span>"
}
},
{
"id": "image-alt-1",
"status": "error",
"error": { "code": "LLM_ERROR", "message": "..." }
}
]
}Results are independent: a failure on one issue does not block guidance for the others.
Credit Usage
The remediate tool is part of the AI Credit Management System. Each issue in a batch consumes credits from your organization's monthly allocation. Administrators can monitor credit usage through the Axe Account Portal.
