wait_for_text
Polls a desktop UI element until its text or name matches an exact value, substring, or regex, re-finding replaced nodes on each poll. Use it to confirm in-place text changes or status labels.
Instructions
Wait until an element reads text, contains it (contains=true), or
matches the regex pattern ("^Opened": starts with Opened, when the
rest is unknown). Compares whitespace-trimmed, NFC-normalised text.
Pass handle_id for a field whose value changes in place (a search box after type_text; get_value straight away still shows a prefix on a busy app). Pass window_id plus role and/or name for a label or status bar: toolkits like egui replace such a node when its text changes, so the old handle keeps the old text, and the element is re-found on every poll. An element without a value is read by its name.
Returns {ok, value}; on timeout {ok: false, error} with what was read.
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 |
|---|---|---|---|
| name | No | ||
| role | No | ||
| text | No | ||
| pattern | No | ||
| timeout | No | ||
| contains | No | ||
| handle_id | No | ||
| window_id | No |