Accessibility tree
ax_treeReads 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
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Include nodes normally pruned as uninteresting. | |
| format | No | Tree output: text (default) or PNG frames. | |
| target | Yes | 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. | |
| maxDepth | No | Maximum tree depth. | |
| maxNodes | No | Maximum node count. |