Skip to main content
Glama
computer
by zznabil

Accessibility tree

ax_tree
Read-onlyIdempotent

Reads a desktop window's OS accessibility tree to expose UI roles, labels, values, states, and refs for locating elements before interacting with apps.

Instructions

OS accessibility tree of a window. Default format is text, one node per line: - role "label" [ref=eN]: "value" plus states. With format: "frames", returns up to 12 PNG pages with per-page captions and token estimates, refs first, and non-ASCII shown as \u{…} escapes. If frames are not cheaper, returns text. Confirm exact refs using ax_find. 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.
formatNoTree output: text (default) or PNG frames.
targetYesWindow id from list_windows (a "window:<id>" prefix is accepted), "desktop", or "display:<id>" / "display:active" / "display:all". Prefer a window id so the input stays scoped to that window; desktop/display input directly drives the user's pointer and keyboard.
maxDepthNoMaximum tree depth.
maxNodesNoMaximum node count.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.0
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "Tree output: text (default) or PNG frames.",
      +  "enum": [
      +    "text",
      +    "frames"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / target / description
      Previous value: -"Window id from list_windows (a \"window:<id>\" prefix is accepted), \"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."New value: +"Window id from list_windows (a \"window:<id>\" prefix is accepted), \"desktop\", or \"display:<id>\" / \"display:active\" / \"display:all\". Prefer a window id so the input stays scoped to that window; desktop/display input directly drives the user's pointer and keyboard."
  2. Changed1 schema field changedv0.3.3
    • changedInput schema / properties / target / description
      Previous value: -"Window 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."New value: +"Window id from list_windows (a \"window:<id>\" prefix is accepted), \"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."
  3. First observedv0.2.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description still adds substantial unstated behavior: the default format and its line grammar, the 12-page PNG cap with captions and token estimates, non-ASCII escaping, and the ref lifecycle with a named StaleRef failure after two misses. That is real error-model disclosure well beyond what the structured fields carry.

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 default output format is front-loaded in the first sentence, then format alternative, then ref semantics and failure mode in a logical read-to-use order. Every sentence carries distinct information; nothing is restated from the schema or annotations.

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

Completeness5/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 takes on the burden of describing return shape and does so for both modes, including pagination and escaping. It also covers the stale-ref failure path, which is the main way an agent can misuse this tool. Remaining details (depth/node limits) are fully documented in the schema.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description genuinely enriches the `format` parameter by explaining what `frames` actually yields (paginated PNGs, per-page captions, token estimates, refs first, escaped non-ASCII). The `all`, `maxDepth`, and `maxNodes` parameters get no narrative treatment, relying entirely on their schema text.

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 names the resource precisely ("OS accessibility tree of a window") and specifies the exact serialization of the default output (`- role "label" [ref=eN]: "value"`). It also distinguishes itself from the sibling ax_find, which is named as the tool for confirming exact refs, so an agent can pick between them without opening schemas.

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?

It gives concrete operational guidance: use ax_find to confirm exact refs, re-read rather than guess when a ref is stale, and expect a text fallback if frames aren't cheaper. It never states an explicit exclusion or "do not use this when" case, and the guidance for choosing frames vs text is left to an opaque cost heuristic.

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