ui_snapshot
The accessibility tree of a window as text, each element with an id that ui_act and the pointer tools accept. Prefer it to a screenshot where the app exposes one: it is cheaper and does not depend on pixels. Some apps expose little or nothing (then use screen_capture); the answer says when a limit cut the tree.
Arguments
Over MCP every tool also takes machine: the machine’s name or id, optional when only one machine is online.
| Name | Type | Required | Meaning |
|---|---|---|---|
depth | integer | no | Tree depth (default 12). |
max_elements | integer | no | At most this many elements (default 400, at most 3000). |
window | integer | no | Window id from window_list (default: the frontmost window). |
Result
| Name | Type | Required | Meaning |
|---|---|---|---|
elements | integer | yes | |
snapshot | string | yes | Valid until the next snapshot; element ids belong to it. |
text | string | yes | The tree as indented text, one element per line: [id] role "name" value (state). |
truncated | string | no | depth, max_elements or time when a limit cut the tree; absent when complete. |
window | integer | no |
Examples
MCP
{
"name": "ui_snapshot",
"arguments": {
"machine": "<machine>"
}
}Limits
The call times out after 30 s (timed_out). Available since version 0.0.2. A refused or failed call returns one of the error codes.