agentest_get_ui_tree
Retrieve a current UI tree with interaction points as @ref tokens for element selection in tests. Supports compact or full format, depth limits, and filtering to interactive elements.
Instructions
Get a fresh snapshot of the current UI screen. Returns compact text with @ref tokens by default.
Use refs in selectors: { "ref": "@b1" }. If a ref is stale (screen changed), you'll get a clear error — just call this tool again for fresh refs.
Options:
format: "compact" (default) or "full" (legacy JSON tree with bounds + classNames — use for debugging or layout inspection)
depth: max tree depth (omit for unlimited)
onlyInteractive: true to drop plain text lines (hoisted labels still appear on interactives)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Max tree depth. Deeper subtrees are summarized as "+N interactive elements". | |
| format | No | Output format: "compact" (default, indented text with @refs) or "full" (JSON tree with bounds/classNames for debugging) | |
| onlyInteractive | No | Drop plain text lines — only show interactive elements with refs. Labels are still hoisted onto interactives. |