Skip to main content
Glama

Scan an HTML snippet

scan_html
Read-onlyIdempotent

Check 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

TableJSON Schema
NameRequiredDescriptionDefault
htmlYesHTML content to test — a full document or a fragment
tagsNoWCAG tags to check (default ["wcag2a","wcag2aa","wcag21aa","wcag22aa"])
wcagNoOnly these WCAG criteria. A prefix selects the whole guideline ("1.4") or principle ("2").
levelNoHighest 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).
rulesNoOnly these rule ids (WebAbility type such as "missing_alt" or axe rule id such as "image-alt"). See get_rules.
widthNoViewport width (browser engine only, default 1280)
engineNo"in-process" (default): jsdom, ms, structural rules. "browser": headless Chromium + axe-core, includes contrast.
formatNo"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.
heightNoViewport height (browser engine only, default 800)
minImpactNoOnly findings at this severity or above (critical > serious > moderate > minor)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.8.0
    • addedInput schema / properties / level
      Added value: +{
      +  "description": "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).",
      +  "enum": [
      +    "A",
      +    "AA",
      +    "AAA"
      +  ],
      +  "type": "string"
      +}
  2. Changed8 schema fields changedv1.7.0
    • addedInput schema / properties / engine
      Added value: +{
      +  "description": "\"in-process\" (default): jsdom, ms, structural rules. \"browser\": headless Chromium + axe-core, includes contrast.",
      +  "enum": [
      +    "in-process",
      +    "browser"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "\"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.",
      +  "enum": [
      +    "json",
      +    "compact"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / height / description
      Previous value: -"Viewport height (default 800)"New value: +"Viewport height (browser engine only, default 800)"
    • changedInput schema / properties / html / description
      Previous value: -"HTML content to test"New value: +"HTML content to test — a full document or a fragment"
    • addedInput schema / properties / minImpact
      Added value: +{
      +  "description": "Only findings at this severity or above (critical > serious > moderate > minor)",
      +  "enum": [
      +    "critical",
      +    "serious",
      +    "moderate",
      +    "minor"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rules
      Added value: +{
      +  "description": "Only these rule ids (WebAbility type such as \"missing_alt\" or axe rule id such as \"image-alt\"). See get_rules.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / wcag
      Added value: +{
      +  "description": "Only these WCAG criteria. A prefix selects the whole guideline (\"1.4\") or principle (\"2\").",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / width / description
      Previous value: -"Viewport width (default 1280)"New value: +"Viewport width (browser engine only, default 1280)"
  3. First observedv1.3.1

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the readOnly/idempotent annotations: it discloses the execution model (jsdom + WebAbility detectors + axe-core, no browser, no network), the fragment auto-wrapping behavior, and the critical limitation that visual-tier rules (contrast, target size, focus ring) are NOT evaluated with the dropped count surfaced as skippedVisual. This is exactly the kind of non-obvious behavioral context that prevents wrong invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose before the execution details, and each sentence carries information. The heavy use of em-dash parentheticals makes it dense, but it is not padded with filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description correctly takes on the burden of explaining the return shape ('scan_page's shape (issues / summary) with fix.op + fixability'), plus the compact-vs-json output behavior and skippedVisual. An agent has enough to call it and interpret the result without opening anything else.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, so the baseline is 3, but the description adds real meaning to engine (in-process vs browser tradeoff and rule coverage), format defaults, and the skippedVisual consequence of the engine choice. It reinforces and disambiguates the schema rather than merely repeating it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Scan a raw HTML snippet or component markup') plus the key scoping constraint ('without serving it'), which distinguishes it from the served-page sibling scan_page. An agent can tell immediately what it does and roughly where it sits relative to scan_page.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly frames the default in-process path as fitting 'inside a tight edit loop' and states the condition for switching (pass engine:"browser" for visual-tier rules), which is explicit when-to-use guidance. It does not, however, explicitly name scan_page as the alternative for already-served URLs, so sibling routing is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.