Skip to main content
Glama

a11y-toolkit: Keyboard-trap + skip-link landing detector

a11y_keyboard
Read-onlyIdempotent

Detect keyboard traps by real Tab-walking up to 60 stops, testing whether Escape releases the cycle, and checking skip link targets. Returns tab stops and findings as JSON.

Instructions

Keyboard-trap detection (2.1.2) with REAL Tab walking in Chromium: up to 60 real tab stops, cycle detection (the modal pattern), then the decisive test — does ESCAPE release the cycle? A modal that cycles and releases on Escape is correct and NOT reported; a cycle Escape cannot leave is a trap (high severity). It also activates the first real skip link once and reports skip_target_hidden (medium, 2.4.1) when the target is still not exposed after activation — focus landing on it is not required (browsers move the sequential-focus start regardless of tabindex). Returns the full tab stop list too. Requires local Playwright. — Scope: keyboard traps (2.1.2) + rendered bypass landing; focus visibility is part of a11y_audit_dom. Returns JSON: {tab_stops, trap_detected, escape_releases, findings}. Run on pages with modals, dialogs or embedded apps; a plain content page has nothing to trap.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "a11y_keyboard"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesPage URL to Tab-walk (http/https or file://)
langNoOutput language (default en)
browserNoBrowser engine (auto = detect the first available)
max_stepsNomax real Tab presses (60 default)
auth_stateNoPath to a Playwright storage_state JSON (exported session) to Tab-walk behind login

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv5.14.0
    • removedInput schema / properties / max_pasos
      Removed value: -{
      -  "description": "max real Tab presses (60 default)",
      -  "type": "integer"
      -}
    • addedInput schema / properties / max_steps
      Added value: +{
      +  "description": "max real Tab presses (60 default)",
      +  "type": "integer"
      +}
  2. Changed1 schema field changedv5.6.0
    • removedInput schema / browser
      Removed value: -{
      -  "description": "Browser engine (auto = detect the first available)",
      -  "enum": [
      -    "auto",
      -    "chromium",
      -    "firefox",
      -    "webkit",
      -    "chrome",
      -    "msedge"
      -  ],
      -  "type": "string"
      -}
  3. Changed1 schema field changedv5.5.0
    • addedInput schema / properties / browser
      Added value: +{
      +  "description": "Browser engine (auto = detect the first available)",
      +  "enum": [
      +    "auto",
      +    "chromium",
      +    "firefox",
      +    "webkit",
      +    "chrome",
      +    "msedge"
      +  ],
      +  "type": "string"
      +}
  4. Changed4 schema fields changedv4.0.0
    • addedInput schema / browser
      Added value: +{
      +  "description": "Browser engine (auto = detect the first available)",
      +  "enum": [
      +    "auto",
      +    "chromium",
      +    "firefox",
      +    "webkit",
      +    "chrome",
      +    "msedge"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / auth_state
      Added value: +{
      +  "description": "Path to a Playwright storage_state JSON (exported session) to Tab-walk behind login",
      +  "type": "string"
      +}
    • addedInput schema / properties / lang / description
      Added value: +"Output language (default en)"
    • addedInput schema / properties / url / description
      Added value: +"Page URL to Tab-walk (http/https or file://)"
  5. Addedv3.3.0

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations, which only declare read-only/open-world/non-destructive. It discloses the concrete mechanism (up to 60 real tab stops, cycle detection, the Escape-release decision), the reporting policy (correct Escape-releasing modals are not reported; unescapable cycles are high severity; skip_target_hidden is medium), the local Playwright dependency, and the JSON return keys.

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-loaded with the decisive test (does Escape release the cycle?) and organized as detection logic, then scope, then return shape. It is dense with worthwhile detail, though the nested parentheticals around tabindex and severity levels make it longer than strictly necessary.

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?

With no output schema, the description supplies the top-level return keys and severity conventions, and it flags the local Playwright requirement an agent must satisfy before calling. The internal shape of the findings array is left unexplained, a minor residual gap for a tool this specialized.

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%, so every parameter including url, lang, browser, max_steps and auth_state is already documented in structured form. The description reinforces max_steps' 60 default and implies the auth_state login case, but adds little syntax or format detail beyond the schema, making the baseline 3 correct.

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: keyboard-trap detection (WCAG 2.1.2) via real Tab walking in Chromium, plus skip-link landing (2.4.1). It explicitly carves out focus visibility as belonging to a11y_audit_dom, so an agent can pick between the two without opening either schema.

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 a clear usage condition ("Run on pages with modals, dialogs or embedded apps") and an explicit exclusion ("a plain content page has nothing to trap"), plus a routing note to a11y_audit_dom for focus visibility. It stops short of naming alternatives for broader page auditing versus this narrow probe, so a 4 rather than a 5.

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