Skip to main content
Glama

browser_waitFor

Wait for one page condition—text, element visibility, selector, URL match, or network idle—before continuing instead of fixed sleeps. Timeout errors report the last seen state.

Instructions

Wait for exactly one condition, then return: text to appear (or disappear), a ref to become visible (or vanish), a selector, a URL (with * wildcards), or the network to go idle. Use this instead of sleep-and-hope. On timeout the error says what was last seen and suggests a fresh snapshot.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_waitFor"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoWait until this ref is visible
urlNoWait until location matches, * is a wildcard
textNoWait until this text is on the page
untilNoInvert the condition (default visible)
timeoutNoMilliseconds (default 10000)
selectorNoWait until this selector matches
networkIdleNoAlso require no requests in flight

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.5.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden and does meaningful work: it states the tool waits on exactly one condition and then returns, and that a timeout produces an error reporting what was last seen plus a hint to re-snapshot. That timeout/error behavior is genuinely actionable and not derivable from the schema. It leaves success-return shape and whether an already-satisfied condition returns instantly unstated.

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

Conciseness5/5

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

Two tight sentences, front-loaded with the condition inventory, followed by the usage instruction and the failure-mode hint. No filler and nothing buried.

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?

For a 7-parameter, fully-optional tool with no output schema, the definition covers input modes and failure behavior but is vague about what is actually returned on success ("then return" is never elaborated). It also says "exactly one condition" while networkIdle is described in the schema as an additional requirement, leaving the composition rule slightly ambiguous.

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% and every condition type (ref, url, text, selector, until, timeout, networkIdle) is already documented in the schema, including the wildcard and default notes the description repeats. The description adds no syntax, precedence, or interaction rules beyond what the schema already states, so the baseline 3 applies.

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?

Specific verb (wait) plus an explicit enumeration of the condition types it accepts: text, ref, selector, URL with wildcards, and network idle. An agent knows exactly what this tool covers, though it never names the closely-related browser_waitForSelector sibling to disambiguate the two.

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

Usage Guidelines4/5

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

"Use this instead of sleep-and-hope" gives a clear rationale for reaching for this tool over a fixed delay, and the listed condition types scope where it applies. It stops short of saying when-not to use it or which sibling to prefer for a subset case.

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