glass_find_elements
Find accessibility elements by approximate text, role, or state, returning ranked matches with actionable IDs. Use when target text is duplicated or unidentified.
Instructions
Find a bounded ranked set of accessibility elements from one fresh read. Use this when the target text is approximate, duplicated, or not yet identified; use glass_wait_for_element for one precise runtime condition and glass_a11y_snapshot for broad tree inspection. query is a deterministic case-insensitive substring over accessible name, description and non-secure value; optional role/states narrow targets, optional within must match one semantic scope, max_results defaults to 10 and is capped at 20, max_nodes uses snapshot walk-limit semantics, and positive timeout_ms waits for a match. Returns trusted counts plus one untrusted match array with actionable ids and compact context. Complete success and error text is capped at 8 KiB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Normalized target role. | |
| query | No | Approximate case-insensitive semantic text. Optional when role or states are supplied. | |
| states | No | Target state predicates combined with AND. | |
| within | No | Optional unique semantic scope resolved in the same fresh tree. | |
| max_nodes | No | Existing accessibility walk limit semantics; 0 removes the node-count limit. | |
| timeout_ms | No | Optional wait for at least one match; default 0 performs one fresh read. | |
| max_results | No | Maximum ranked matches before the byte budget; default 10, range 1 through 20. |