Skip to main content
Glama

Compare two accessibility scans

diff_scan
Read-onlyIdempotent

Compare two accessibility scans of a page to report fixed issues, new regressions, and remaining violations. Confirm a fix by verifying the new[] list is empty.

Instructions

Compare two scans of the same page and report what changed: fixed[] (in the baseline, gone now), new[] (regressions — not in the baseline, present now), remaining[] (still there). Page-level complement to verify_fix (one element). Baseline is a scan_history id (baselineId, local installs) or a live scan of baselineUrl; current is url (scanned live now) or another history id (currentId). Live scans run a second time when they differ, and a difference that does not hold goes to unstable[], so a changed page can take twice as long. Findings are matched by issue id (rule + element), so a changed class/id on a fixed element reads as fixed AND new — check new[] before calling it a regression. Typical loop: scan_page → edit → diff_scan(baselineId=, url=) → confirm new[] is empty.

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": "diff_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoURL to scan now as the CURRENT side (deployed, staging, or http://localhost:3000). Omit when passing currentId.
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.
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. On the hosted server the default is compact.
viewportNoViewport for live scans (default: desktop). Use the same viewport the baseline used.
currentIdNoscan_history id to use as the CURRENT side instead of scanning `url`
minImpactNoOnly findings at this severity or above (critical > serious > moderate > minor)
baselineIdNoscan_history id of the BASELINE scan (local installs only)
widgetViewNoWhich DOM both live scans measure when the page embeds the WebAbility widget. "source" (default) blocks our widget; "applied" measures the visitor's patched view. Both sides must measure the same DOM — a source baseline against an applied current reports our widget's own patches as fixed/new, and the reply says so when the two sides disagree.
baselineUrlNoScan this URL live as the baseline (e.g. production) — use when there is no stored baseline
rootSelectorNoCSS selector to limit live scans to (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.10.2
    • changedInput schema / properties / format / description
      Previous value: -"\"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."New value: +"\"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. On the hosted server the default is compact."
    • addedInput schema / properties / widgetView
      Added value: +{
      +  "description": "Which DOM both live scans measure when the page embeds the WebAbility widget. \"source\" (default) blocks our widget; \"applied\" measures the visitor's patched view. Both sides must measure the same DOM — a source baseline against an applied current reports our widget's own patches as fixed/new, and the reply says so when the two sides disagree.",
      +  "enum": [
      +    "source",
      +    "applied"
      +  ],
      +  "type": "string"
      +}
  2. 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"
      +}
  3. Addedv1.7.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld/idempotent annotations: live scans re-run when the two passes differ, non-reproducing differences land in unstable[], and a changed page can take twice as long. It also discloses matching semantics (issue id = rule + element) and the failure mode where a source baseline against an applied current reports the widget's own patches as fixed/new.

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 return buckets, then the input pairings, then caveats, then the canonical loop — a sensible order with no filler sentences. The density is high and it runs as one paragraph, so the doubled-runtime and unstable[] caveats are easy to skim past.

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?

For a 12-parameter tool with no output schema, the description covers what an agent actually needs: the shape of the result, how to pick each side, the cost of live scans, and the stability caveat. Nothing material is left to guesswork.

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 coverage is 100%, so the baseline is 3, but the description adds real value on top: it clarifies the baseline/current side pairings, notes baselineId is local-installs-only, and warns that both sides must use the same viewport and widgetView. Remaining parameters (wcag, rules, minImpact, rootSelector) are left to the schema.

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 ("Compare two scans of the same page and report what changed") and immediately enumerates the three output buckets fixed/new/remaining, so the agent knows exactly what the tool produces. It explicitly positions itself against siblings: "Page-level complement to verify_fix (one element)" and the typical loop starting at 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 Guidelines5/5

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

Enumerates all four side-selection combinations (baselineId vs baselineUrl, url vs currentId) with the condition that selects each, plus a concrete end-to-end workflow (scan_page → edit → diff_scan → confirm new[] is empty). It also gives an explicit when-not-to-trust rule: check new[] before calling something a regression, since a changed class/id reads as both fixed and new.

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