wait_for
Pauses browser automation until specified conditions hold—element visibility, text, URL, JavaScript, or ready state—handles anyOf alternatives, and fails at timeout with last observed state.
Instructions
Wait until every given condition holds, or the first of anyOf; at timeoutMs it fails with the last observed state. Selector checks scroll the element into view. Actions already return what changed once the page settles, so wait only for something that comes later.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Page URL equals this. | |
| anyOf | No | Conditions with the fields above, instead of them; holds when any holds (result: matchedIndex). | |
| state | No | With selector (default visible); hidden means absent or not visible. | |
| selector | No | Locator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b | |
| sessionId | No | ||
| timeoutMs | No | ms before failing (default 10000). | |
| expression | No | Page JavaScript; holds when its (awaited) result is truthy. Throwing fails. | |
| readyState | No | document.readyState is at least this. | |
| textEquals | No | The selector's visible text equals this (whitespace collapsed). | |
| urlIncludes | No | Page URL contains this. | |
| textExcludes | No | The selector's visible text no longer contains this; false for a missing element. | |
| textIncludes | No | The selector's visible text contains this. | |
| pollIntervalMs | No | ms between checks (default 100). |