glass_wait_for_element
Waits for a GUI element to appear, disappear, or reach a state such as enabled or checked, selected by name, role, or description. Returns the matched element or a timeout result.
Instructions
Wait for semantic transition completion, not pixels/stability. Select by name, description and/or role; value is exact, value_contains is a substring. Supports appears/disappears and state conditions. Returns matched, elapsed_ms and the element; timeout is matched:false. subject_mismatch flags a different app, named by subject in the untrusted block even without an element. Waits for initial tree publication, but errors if no tree appeared. Batched use fails the sequence on an unmatched predicate. For 2+ known steps, use glass_do.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "glass_wait_for_element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Substring of the element's accessible name (selector). | |
| role | No | Element role filter, e.g. "Button", "ProgressBar", "Document" (selector). | |
| value | No | Exact case-sensitive accessible value, requiring another selector and excluding `value_contains`. | |
| condition | No | Default appears. appears|disappears|enabled|disabled|checked|unchecked|selected|unselected|expanded|collapsed|focused|visible|hidden. checked/unchecked require a real checkable state. | |
| timeout_ms | No | Timeout in ms (default 10000). Standalone: matched:false; batched: fails the sequence. | |
| description | No | Accessible-description substring; can select unnamed controls. | |
| interval_ms | No | Poll interval (default 200ms — an a11y snapshot per tick). | |
| value_contains | No | Value substring; requires name, description and/or role; exclusive with value. |