Skip to main content
Glama

Keyboard focus check (WCAG 2.1.1 / 2.1.2 / 2.4.3 / 2.4.7 / 2.4.11 / 2.4.12 / 2.4.13 / 3.2.1)

check_keyboard_focus
Read-only

Presses Tab through a page to record keyboard focus order and detect missing focus indicators, focus traps, hidden elements, unreachable controls, and focus-triggered context changes.

Instructions

Presses Tab through the whole page and records the focus order. Detects elements with no focus indicator, elements hidden behind a fixed header or similar, places focus cannot leave, controls the keyboard cannot reach, and context changes triggered by focus alone. data.sequence lists the focus order so you can judge whether it makes sense.

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

Input Schema

NameRequiredDescriptionDefault
urlYesURL of the page to check (http, https or file). A dev server such as http://localhost:3000/ works too.
widthNoViewport width in CSS px. Default 1280.
heightNoViewport height in CSS px. Default 720.
waitMsNoExtra time to wait after load, in milliseconds.
maxStepsNoMaximum number of Tab presses. Default 150.
waitForSelectorNoAfter load, wait until an element matching this CSS selector appears. Use it to wait for an SPA to render.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint; the description adds real behavior beyond that by disclosing that the tool actively drives the page with Tab presses and returns a focus-order sequence under data.sequence. It stops short of mentioning runtime cost, page navigation, or what happens on pages that never settle, which would matter for an interactive browser-driven check.

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?

Two sentences, action first, then the detection list, then the return-value hint. The middle enumeration is long but each item is a distinct failure mode being reported, so it largely earns its space; the phrasing "or similar" is the only loose wording.

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 carries the return-value burden and does name data.sequence plus the categories of findings. For an openWorld browser tool with annotated safety, this is close to sufficient; a brief note on what the pass/fail summary looks like or expected runtime would make it complete.

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 url, width, height, waitMs, maxSteps and waitForSelector are already documented with defaults and bounds. The description adds nothing about parameter effects (e.g. that maxSteps bounds the recorded sequence or that waitForSelector helps with SPAs), so the baseline of 3 applies.

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 concrete verb and resource: it presses Tab through the page and records focus order, then enumerates exactly what it flags (no focus indicator, obscured by fixed headers, focus traps, unreachable controls, focus-triggered context changes). This is specific enough to separate it from the sibling axe/presentation/reflow checks without inspecting their schemas.

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

Usage Guidelines3/5

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

Usage is implied by the content: run it when auditing keyboard accessibility against the listed WCAG criteria. However, it never says when to prefer this over check_axe or check_interaction, nor any precondition such as needing a rendered page versus static HTML, so the agent must infer the routing.

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