Wait for an element to appear
wait_for_elementPoll the accessibility tree until an element matching text or role appears or the timeout elapses, replacing blind sleeps for page loads, AJAX content, or animations.
Instructions
Poll the accessibility tree until an element matching text/role appears (or the timeout elapses). Use this instead of blind sleeps when waiting on page loads, AJAX content, or animations to settle. Getting the role wrong here is expensive — it polls the FULL timeout for a role that can never match. If unsure of the exact role, omit role and match on text alone.
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": "wait_for_element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Real AT-SPI role name only (button, link, entry, heading, ...) — NOT HTML-ish names like 'textbox' or 'input'. Omit if unsure. | |
| text | No | ||
| poll_ms | No | ||
| timeout_ms | No | ||
| window_address | No |