browser_wait_for
Blocks page execution until a condition (selector, text, URL, network idle, or JavaScript predicate) is satisfied, replacing sleep-then-poll with a single atomic wait.
Instructions
TEMPORAL AWARENESS PRIMITIVE. Blocks until a declarative condition is met or a timeout fires. Replaces fragile sleep-then-poll patterns with a single atomic wait.
USE CASES: • Wait for a loading spinner to disappear: { type: "selector_hidden", value: ".spinner" } • Wait for a success message: { type: "text", value: "Saved successfully" } • Wait for a redirect: { type: "url", value: "/dashboard" } • Wait for all API calls to finish: { type: "network_idle" } • Wait for app state: { type: "predicate", value: "window.appReady === true" }
TIP: For the common pattern of "act then wait", use the waitFor parameter on atomic_interact instead — it combines action + wait in a single MCP round-trip. Use this standalone tool only when you need to wait without acting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Condition type. "selector" = wait for CSS selector to match a visible element. "selector_hidden" = wait for selector to stop matching. "text" = wait for text to appear on page. "text_hidden" = wait for text to disappear. "url" = wait for URL to contain substring. "network_idle" = wait for no pending network requests. "predicate" = wait for JS expression to return truthy. | |
| value | No | CSS selector, text substring, URL substring, or JS expression (depending on type). Not needed for network_idle. | |
| timeoutMs | No | Maximum time to wait in milliseconds (default: 5000). | |
| durationMs | No | For network_idle: how long (ms) the network must stay quiet to count as idle (default: 500). |