Scan an HTML snippet
scan_htmlCheck raw HTML snippets or component markup for WCAG accessibility issues without serving a page. Runs in-process in milliseconds and returns each finding with a fix.
Instructions
Scan a raw HTML snippet or component markup without serving it — IN-PROCESS by default (jsdom + WebAbility detectors + axe-core): milliseconds, no browser, no network, so it fits inside a tight edit loop. Fragments are auto-wrapped into a document. Returns scan_page's shape (issues / summary) with fix.op + fixability on every finding. jsdom has no layout, so visual-tier rules (contrast, target size, focus ring) are NOT evaluated — the dropped count is reported as skippedVisual; pass engine: "browser" to run the axe-core headless-browser path for those (slower, axe rules only, returns axe violations).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | HTML content to test — a full document or a fragment | |
| tags | No | WCAG tags to check (default ["wcag2a","wcag2aa","wcag21aa","wcag22aa"]) | |
| wcag | No | Only these WCAG criteria. A prefix selects the whole guideline ("1.4") or principle ("2"). | |
| level | No | Highest WCAG conformance level to report. Default "AA" — Level AAA criteria are not reported. Pass "AAA" to include them (naming one AAA criterion in `wcag`, e.g. "3.2.5", also includes it). | |
| rules | No | Only these rule ids (WebAbility type such as "missing_alt" or axe rule id such as "image-alt"). See get_rules. | |
| width | No | Viewport width (browser engine only, default 1280) | |
| engine | No | "in-process" (default): jsdom, ms, structural rules. "browser": headless Chromium + axe-core, includes contrast. | |
| format | No | "compact" prints one line per element with rule metadata once. "json" returns every field (html, fix values, source). Default: JSON when it fits inline (under ~24k chars), otherwise compact plus a JSON summary of every count. | |
| height | No | Viewport height (browser engine only, default 800) | |
| minImpact | No | Only findings at this severity or above (critical > serious > moderate > minor) |