wait_for_event
Block until the browser reports a matching event, then return it (or timedOut=true). This is how the browser talks back: wait for a network response to a URL (kind=network, url_contains), a console error (kind=console, level=error), a navigation, a page message (kind=message). Default timeout 20s, max 120s. Pass since_seq (from get_events latest_seq) to also catch an event that already fired.
Example#
Call this MCP tool with the argument object below. Replace illustrative IDs, selectors, local paths, and project URLs with values observed in your session.
{
"kind": "network",
"url_contains": "/api/",
"timeout_ms": 20000
}Usage notes#
The URL filter is illustrative. Record the event sequence and arm network before the triggering action. A matching response still needs status/content verification.
Result#
Returns a matching buffered/new event or timedOut:true. since_seq can include an event that arrived before this call.
Results arrive in MCP content blocks. Most structured results are JSON in text blocks; image tools can include image blocks. Handle errors and partial or truncated data. No formal output schema is declared for this tool.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
kind | string | No | See usage and full schema below. |
term | string | No | Only events from this terminal id |
source | string | No | page or terminal |
level | string | No | See usage and full schema below. |
url_contains | string | No | See usage and full schema below. |
text_contains | string | No | See usage and full schema below. |
since_seq | number | No | See usage and full schema below. |
timeout_ms | number | No | See usage and full schema below. |
tab | string | No | Tab name or id in your workspace; does not change the visible tab. minLength: 1 |
Full input schema#
The schema includes nested shapes and constraints. Additional semantic constraints can apply at runtime; read the description and usage notes.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"kind": {
"type": "string"
},
"term": {
"description": "Only events from this terminal id",
"type": "string"
},
"source": {
"description": "page or terminal",
"type": "string"
},
"level": {
"type": "string"
},
"url_contains": {
"type": "string"
},
"text_contains": {
"type": "string"
},
"since_seq": {
"type": "number"
},
"timeout_ms": {
"type": "number"
},
"tab": {
"description": "Tab name or id in your workspace; does not change the visible tab.",
"type": "string",
"minLength": 1
}
},
"additionalProperties": false
}Related documentation#
Reference conventions · Agent operating guide · Troubleshooting