Skip to main content
Glama

Accessibility tree (ARIA YAML)

browser_accessibility_tree
Read-only

Generate a Playwright ARIA snapshot (YAML) of a page or element to inspect accessibility structure and write toMatchAriaSnapshot assertions.

Instructions

Playwright's ARIA snapshot (YAML) of the page or an element, useful for writing toMatchAriaSnapshot assertions.

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

Input Schema

NameRequiredDescriptionDefault
nthNo
refNoElement ref from snapshot (preferred)
nameNo
roleNo
textNo
exactNo
labelNo
pageIdNo
testIdNo
withinNoScope to a unique container (ref, role+name, label, testId or CSS selector)
sessionNo
selectorNoCSS (last resort)
placeholderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already establish the read-only, non-destructive, open-world profile, so the description's burden is lower. It adds useful context by disclosing the output format (YAML) and that it can be scoped to an element, but says nothing about snapshot size, truncation of large trees, or cost on complex pages.

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?

A single well-formed sentence with the artifact front-loaded and no filler. It is efficient, though the economy comes partly at the expense of the parameter and scoping detail this tool needs.

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

Completeness2/5

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

For a 13-parameter tool with 23% schema coverage and no output schema, the definition is thin: nothing explains how the many locator params combine to select an element or subtree, nor what the returned YAML looks like at a high level. The one sentence does not cover what an agent needs to invoke this confidently.

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

Parameters2/5

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

Schema description coverage is only 23% across 13 parameters, so the description needs to compensate and does not: it never mentions that locator parameters (role, name, text, label, testId, placeholder, nth) narrow the snapshot to a subtree, nor what pageId and session do. Only ref, within, and selector carry schema descriptions, leaving most of the surface undocumented.

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

Purpose4/5

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

The description names a specific artifact (Playwright's ARIA snapshot in YAML) and states its scope (the page or an element), which is concrete enough to distinguish it from interaction tools like browser_click. It stops short of contrasting with the closely related browser_snapshot sibling, so an agent must infer which of the two to pick.

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?

There is an implied use case: writing toMatchAriaSnapshot assertions. That gives some signal about when the output is appropriate, but there is no explicit when-not guidance, no mention of when to prefer browser_snapshot, and no prerequisites or preconditions stated.

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