elements
Retrieve UI elements from accessibility trees to analyze application interfaces. Filter by role, state, hierarchy, and source for comprehensive UI exploration.
Instructions
Get UI elements from the accessibility tree.
Returns a broad view of available elements. Use find() instead
when you know the element's name -- it is faster and ranked.
Args:
app: Scope to this application.
window_id: Scope to this window.
tree: If true, include parent/child hierarchy.
max_depth: Maximum tree depth (0 = immediate children only).
root_element: Start from this element ID (drill into a container).
max_elements: Maximum elements to return (prevents huge results).
role: Only include this role (e.g. "button", "text_field").
states: Only include elements with ALL these states.
named_only: If true, exclude elements with empty names.
sort_by: None (default, tree order) or "position" for reading order (top-to-bottom, left-to-right).
source: "full" (default, merged native+web), "ax" (CDP AX tree only), "native" (platform only), or "dom" (live DOM).Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | ||
| window_id | No | ||
| tree | No | ||
| max_depth | No | ||
| root_element | No | ||
| max_elements | No | ||
| role | No | ||
| states | No | ||
| named_only | No | ||
| sort_by | No | ||
| source | No | full |