Skip to main content
Glama
playwright-mcp-router

playwright-mcp-router

by huangzt

browser_wait_for

Read-only

Waits for specified text to appear or disappear, or for a set time to pass, so browser automation can synchronize with page changes.

Instructions

Wait for text to appear or disappear or a specified time to pass. When both text and textGone are provided, waits for the first one to happen

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": {
      "session": "<session>"
    },
    "name": "browser_wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoThe text to wait for
timeNoThe time to wait in seconds, at most 30. When combined with text or textGone, serves as a timeout for them instead of the default action timeout
colorNoOptional Chrome tab group color override for a newly created session.
accountNoChrome account profile to use (defaults to 'default'). Configured accounts: 'default' (Isolated Browser).default
sessionYesRequired isolated session name (also displayed as the Chrome tab group title), e.g. "T1867-api-debug" or "home-css". Use a unique, descriptive task name per conversation so concurrent agents never hijack each other's active tab.
textGoneNoThe text to wait for to disappear

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds one genuinely useful behavioral fact not present in the schema: with both text and textGone supplied, the call resolves on whichever happens first. It omits what happens on failure/timeout (throw vs. return), which is central for a wait primitive, so it only partially clears the lower bar set by annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, no filler, and the three wait modes are front-loaded before the edge-case rule. The second sentence is slightly awkwardly phrased ("waits for the first one to happen") but earns its place by covering non-obvious semantics.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and six parameters, the description should say what a successful wait returns and what happens when the condition never occurs. Those gaps matter for a synchronization tool, though the rich schema descriptions of time and the timeout override mitigate them somewhat.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all six parameters are already documented, including the 30-second cap and the fact that time doubles as a timeout when combined with text/textGone. The description contributes only the interaction between text and textGone and says nothing about session, account, or color. Baseline 3 is appropriate when the schema carries the load.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ("Wait for") and enumerates the three things it can wait on: text appearing, text disappearing, or an elapsed time. That is far more informative than the title "Wait for" alone and is distinguishable from every sibling, none of which are wait-style tools. It stops short of naming any sibling or scope boundary, so it lands at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the wording (use it when you need to synchronize on text or a delay), and one conditional rule is given for the combined text/textGone case. However, there is no explicit when-to-use versus alternatives guidance — nothing tells the agent when to prefer waiting for text over taking a browser_snapshot or polling with browser_find, and no prerequisites are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.