phone_elements
Read the current iPhone screen as text instead of screenshots, then filter accessibility elements by query or selector and return row indexes plus a snapshot token for tapping.
Instructions
The current screen as text — use this instead of screenshots (an order of magnitude cheaper). Rows carry kind, label, identifier, value, rect and state, plus a snapshot token for phone_tap_element; indexes and snapshot tokens are valid for this read only. query keeps only rows containing that text (label, identifier, value, placeholder) and limit caps the rows. selector ANDs exact kind/identifier/name/label/value/enabled fields and case-sensitive label_contains; optional selector.index (integer0..199) selects one match after scope/query and before limit, retaining the original snapshot row index. Unknown earlier candidates or incomplete tree scope refuse the ordinal. name matches a non-empty identifier, otherwise the label; value_present checks whether the snapshot supplies a string value (including empty/truncated); false means omitted/null on non-secure rows, not a complete AX null; protected SecureTextField rows match neither boolean. It filters AX rows, not OCR. Queries preserve each row's index and the snapshot, so taps still work. Screen text shows at most 200 rows and 32 KiB of row text; an omission notice means a partial view, not absence or list completion. Narrow with query when needed. include_hidden=true expands off-screen/not-drawn rows instead of summarizing five labels; these rows are marked hidden and must be scrolled into view before acting. On the first read in a newly entered app a registry block lists saved flows for it: if one does the task, phone_flow_run it instead of tapping step by step. An alert block means a system alert is up: answer it with an alert step, taps on alerts do not act. ocr=auto adds text read from pixels when the tree has no interactive rows (games, canvases), ocr=force always; such rows have no element, tap their x/y with phone_tap. value_truncated marks an incomplete preview; use phone_read_value for the bounded full AX value. Requires phone_status drivable=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ocr | No | Text read from a fresh screenshot (Vision OCR) for screens the tree cannot describe (games, canvases, video): `auto` adds it only when the tree has no interactive rows, `force` always, `off` (default) never. | |
| limit | No | Return at most this many rows; the answer says how many were left out. | |
| query | No | Keep only rows whose label, identifier, value or placeholder contains this text (case-insensitive). Rows keep their original index. | |
| instance | No | Installed local instance name, such as i13 or default. Omit to use the configured daemon. No fallback on failure. | |
| selector | No | Literal case-sensitive field filters combined with AND; preserves original snapshot indexes. Requires literal criteria; optional index0..199 chooses one match in scoped/query tree order before limit. Row index remains the full snapshot index; incomplete or unknown earlier matches refuse an unproven rank. Filters AX elements, not separate OCR text. | |
| include_hidden | No | Show off-screen/not-drawn rows individually in the text, with their original indexes and hidden state, instead of a five-label summary. The 200-row / 32 KiB text budget still applies. Scroll them into view before acting. Default false. |