wait_for
Polls a JavaScript condition in Electron renderer processes until it evaluates as true, then returns the result. Use to wait for DOM elements, application states, or other conditions before proceeding.
Instructions
Poll a JavaScript predicate in the renderer until it returns truthy, then return its value. The predicate is a function body; use return to yield a value. Example body: return document.querySelectorAll(".item").length >= 3.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"js": "<js>"
},
"name": "wait_for"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | Yes | Function body. Use `return` to yield the predicate result. | |
| timeoutMs | No | Default 5000. | |
| pollMs | No | Poll interval, default 100. |