Skip to main content
Glama
computer
by zznabil

Accessibility tree

ax_tree
Read-onlyIdempotent

Reads a window's OS accessibility tree as line-by-line text with element refs, enabling agents to inspect UI elements before acting on them.

Instructions

OS accessibility tree of a window as text, one node per line: - role "label" [ref=eN]: "value" plus states. Refs stay valid across reads until the element's role/label changes; a ref missing from the last two reads throws StaleRef (re-read, never guess).

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": {
      "target": "<target>"
    },
    "name": "ax_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoInclude nodes normally pruned as uninteresting.
targetYesWindow id from list_windows, "desktop", or "display:<id>" / "display:active" / "display:all". Prefer a window id: window input runs in the background; desktop/display input drives the user's real pointer and keyboard.
maxDepthNoMaximum tree depth.
maxNodesNoMaximum node count.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint, idempotentHint, destructiveHint=false), yet the description adds real substance: the exact line format including role, label, [ref=eN], and value, plus the lifecycle of refs across reads and the StaleRef failure mode. It stops short of describing truncation behavior or what happens when maxNodes/maxDepth cut the tree off.

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?

Two dense sentences with no filler: the output format is front-loaded so the agent knows what it will parse, and the ref-lifetime caveat follows immediately. Every clause carries operational information.

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 correctly takes on the job of showing the return shape via a concrete line template, and it also covers the main failure mode. It is nearly complete for a read-only tree dump; only truncation and sizing behavior under maxNodes/maxDepth are left to 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 description coverage is 100%, so target, all, maxDepth, and maxNodes are already documented at the field level, and the description does not expand on their meaning. Saying the tool returns the tree 'of a window' also understates the desktop/display targets that the schema allows, but the schema resolves that. Baseline 3 applies.

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?

States a specific verb and resource: it returns the OS accessibility tree of a window rendered as text, one node per line. It is identifiable as the bulk tree-dump tool against siblings like ax_element and ax_find, though it never names them or explicitly contrasts its scope with theirs.

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 no explicit statement of when to reach for this tool versus ax_element, ax_element_at, or ax_find; the reader must infer that this is the full-tree read. It does give a concrete operational rule for handling stale refs (a ref missing from the last two reads throws StaleRef, so re-read rather than guess), which is useful but is staleness handling, not tool-selection guidance.

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