Skip to main content
Glama

a11y-toolkit: A11y snapshot + tab order

a11y_snapshot
Read-onlyIdempotent

Capture a URL's interactive elements, real tab focus order, and screen-reader accessibility tree as JSON before deployment. Compare snapshots with a11y_diff to detect accessibility changes.

Instructions

Accessibility snapshot of a URL: interactive elements (tag, role, accessible name, href) in DOM order, the REAL tab focus order, and when Playwright ≥1.49 is available the computed ACCESSIBILITY TREE (aria snapshot — what a screen reader announces). Save it before a deploy and compare after with a11y_diff. Requires local Playwright. — Capture half of the watch loop; compare with a11y_diff (or a11y_diff_urls for two live URLs). Returns JSON: {url, ts, elements [{tag, role, name, ref…}], focus_order}.

Input Schema

NameRequiredDescriptionDefault
urlYesPage URL to snapshot (http/https or file://)
auth_stateNoPath to a Playwright storage_state JSON (exported session) to snapshot behind login

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.0.0
    • addedInput schema / properties / auth_state
      Added value: +{
      +  "description": "Path to a Playwright storage_state JSON (exported session) to snapshot behind login",
      +  "type": "string"
      +}
    • addedInput schema / properties / url / description
      Added value: +"Page URL to snapshot (http/https or file://)"
  2. First observedv2.3.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, openWorld. The description adds real behavioral context beyond them: it requires local Playwright, the accessibility tree only appears with Playwright ≥1.49, and it documents the return shape. Not full marks because the Playwright dependency is stated without failure semantics.

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

Conciseness3/5

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

The core purpose is front-loaded, but the single sentence sprawls with nested parentheticals, an em-dash clause, and a trailing fragment about the watch loop and JSON shape. It is information-dense rather than wasteful, yet the run-on structure hurts scannability.

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

Completeness4/5

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

No output schema exists, but the description compensates by sketching the return JSON ({url, ts, elements, focus_order}) and the Playwright version condition. Combined with annotations covering the safety profile, an agent has enough to invoke it correctly, though auth/login flow details remain thin.

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

Parameters3/5

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

Schema description coverage is 100% and both parameters (url, auth_state) are documented in the schema itself, so the baseline is 3. The description mentions login context only obliquely via the 'watch loop' framing and never explains auth_state's format, adding little beyond the structured field.

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 precise verb+resource (accessibility snapshot of a URL) and enumerates exactly what it captures: interactive elements in DOM order, real tab focus order, and the computed accessibility tree. It names sibling tools (a11y_diff, a11y_diff_urls) so an agent can distinguish this capture tool from the comparison tools without opening schemas.

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?

Gives clear usage context ('Save it before a deploy and compare after with a11y_diff') and explicitly routes to a11y_diff_urls for two live URLs. It stops short of stating when NOT to use it (e.g., when you only have a DOM string, where a11y_audit_dom/a11y_keyboard might apply), so it is strong but not exhaustive.

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