Wait For Text
wait_for_textPoll visible page text until a string or regex appears or disappears. Use it to detect status changes like "Saved" or a spinner label that vanishes.
Instructions
Poll until any of several strings (or a regular expression) appears in, or disappears from, the visible text of the page or of a scope selector. Use it where wait_for_selector cannot: a status line that changes ("Saved", "Order confirmed"), or a spinner label that goes away. Reads the rendered text, so text in display:none is not seen, and text inside an iframe is not either. Same conventions as wait_for_selector: a bad regex fails straight away, and a timeout says so with waitedMs and what was found on the last poll.
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_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regex | No | A JavaScript regular expression source, without slashes, matched against the text. Combines with texts: either matches. | |
| state | No | present waits for a match to appear. absent waits until none of the texts or the regex match. | present |
| texts | No | Any one of these strings counts as a match. Case-insensitive unless case_sensitive is set. | |
| tab_id | No | Arc tab id from list_tabs. Omit to use this agent's current tab. A tool that changes a tab will not fall back to the tab the user is looking at, so pass this or call open_url first. | |
| selector | No | Only search the text of elements matching this selector (every match is searched). CSS selector, or "text=Label". Omit to search the whole page. | |
| timeout_ms | No | Give up after this long. Capped at 30000ms so the call cannot outlive a client's request timeout. To wait longer, call this again. | |
| case_sensitive | No | Match case exactly |