Skip to main content
Glama

Get the accessibility tree

get_accessibility_tree

Retrieve a hierarchical role/name/text outline of the visible DOM to understand page structure and complement flat interactive refs. Bounded by maxNodes and depth, with truncation reporting.

Instructions

Hierarchical role/name/text outline of the VISIBLE DOM — structure to complement read_page's flat interactive refs. Top frame only (for shadow DOM / iframes use read_page). Bounded by maxNodes (default 400, max 2000) + depth; returns {ok, tree, nodes, truncated}.

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": {
      "tabId": "<tabId>"
    },
    "name": "get_accessibility_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdYesTarget tab ID (must be in the MCP group)
maxNodesNoMax nodes to emit (default 400, capped at 2000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.24.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description still discloses important behavior: top-frame-only scope, bounding via maxNodes and depth, and the returned shape including truncation. It does not explicitly state read-only/side-effect behavior, but the 'get' naming and visibility scope make that reasonably clear.

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

Conciseness5/5

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

The description is dense but front-loaded: purpose first, then sibling distinction, then scope limits and return shape. Every clause carries useful information, with no filler.

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?

For a two-parameter read tool with no output schema, the description provides the essential context: hierarchical output, visible-DOM scope, frame limitations, truncation, and return keys. It is close to complete, with only minor gaps around permissions or error behavior already covered indirectly by the schema.

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 coverage is 100%, so tabId and maxNodes are already documented. The description repeats maxNodes defaults and limits without adding syntax beyond the schema, and its mention of a 'depth' bound is not represented in the input schema, which could confuse parameter expectations.

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?

The description states a specific verb and resource: a hierarchical role/name/text outline of the visible DOM. It explicitly distinguishes this from read_page's flat interactive refs and names the sibling to use for shadow DOM and iframes.

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?

It gives explicit when-to-use guidance by framing the tool as complementary structure to read_page, and states when not to use it: top frame only, with read_page for shadow DOM and iframes. The alternative and condition are both named directly.

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