Dea DardanicaDocumentation
Network, events, and healthRead Markdown

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.

json
{
  "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#

wait_for_event — table 1
ParameterTypeRequiredDescription
kindstringNoSee usage and full schema below.
termstringNoOnly events from this terminal id
sourcestringNopage or terminal
levelstringNoSee usage and full schema below.
url_containsstringNoSee usage and full schema below.
text_containsstringNoSee usage and full schema below.
since_seqnumberNoSee usage and full schema below.
timeout_msnumberNoSee usage and full schema below.
tabstringNoTab 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.

json
{
  "$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
}

Reference conventions · Agent operating guide · Troubleshooting