Wait for element
wait_for_elementPoll the page until a CSS selector or interaction-tree element appears, synchronizing after clicks or navigation and returning timeout reasons if absent or hidden.
Instructions
Wait until an element appears on the page, polling until it does.
The right way to synchronise with a single-page app after a click or navigation — more reliable than wait with a guessed duration. Returns how long it took, or an error naming why it never matched (absent, or present but hidden, with similarly named ids as suggestions).
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": {
"selector": "<selector>"
},
"name": "wait_for_element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab id from list_tabs or new_tab to act on, instead of the active tab. The active tab does not change. Omit to use the active tab. Example: 'tab_2' | |
| timeout | No | Maximum seconds to wait before giving up. The default suits single-page apps. Example: 30.0 | |
| visible | No | Require the element to be visible, not merely present in the DOM. Set false to accept a hidden element. Example: true | |
| selector | Yes | CSS selector, or a numeric id from get_interaction_tree, to wait for. Example: '#results .item' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| found | Yes | Always true: a miss is reported as an error. | |
| elapsed | Yes | Seconds until it appeared. | |
| summary | Yes | One line saying what happened. | |
| selector | Yes | The selector or id waited for. |