Skip to main content
Glama

等待

browser_wait
Read-onlyIdempotent

Pause browser automation until specified text, selectors, or URL conditions appear or disappear, or a delay elapses, so scripts continue only when the page is ready.

Instructions

Wait for one of: text to appear (text), text to disappear (textGone), a selector to appear (selector) or disappear (selectorGone), the URL to contain a string (urlContains), or a fixed delay (time, ms). Multiple conditions wait for whichever happens first. Polls every 250ms. Prefer selector/urlContains on SPAs where text is reused; use text conditions for plain pages.

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_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoWait until this text appears on the page
timeNoWait a fixed number of milliseconds (max 30000)
tabIdNoTab id (default: active tab)
selectorNoWait until this CSS selector matches a visible element
textGoneNoWait until this text disappears from the page
timeoutMsNoTimeout in ms (default 10000, max 30000)
urlContainsNoWait until the page URL contains this string
selectorGoneNoWait until this CSS selector matches nothing

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and openWorld, so safety is covered. The description adds genuinely non-obvious behavior: a 250ms polling interval and first-condition-wins race semantics when several conditions are supplied. It does not say what happens on timeout (throw vs. return a false-y result), which is the main behavioral question left open.

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?

Three tightly packed sentences: condition inventory first, then composition and polling, then the SPA-vs-plain-page heuristic. No redundancy with the schema or title, and nothing is buried.

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

Completeness4/5

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

For an 8-parameter, no-required-parameter tool this covers the modes, defaults, and composition semantics well. The remaining gap is that no output schema exists, so the description should say what is returned (e.g., which condition matched) or how a timeout is surfaced; without that an agent cannot interpret the result.

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

Parameters4/5

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

Schema coverage is 100%, so each parameter is already documented; the description's added value is the composition rule that multiple conditions race against each other, which the flat schema cannot express. It adds no further detail on timeoutMs defaults or units beyond what the schema states.

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

Purpose5/5

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

The description opens with a specific verb ('Wait') and enumerates every condition mode the tool accepts — text, textGone, selector, selectorGone, urlContains, time — mapping each to its parameter name. An agent can tell exactly what this tool does and how it differs from action tools like browser_click or browser_assert.

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?

It states the selection rule between condition types ('Prefer selector/urlContains on SPAs where text is reused; use text conditions for plain pages') and explains how multiple conditions compose ('wait for whichever happens first'). It stops short of naming a sibling alternative such as browser_assert for verifying an already-observed state, so it sits at 4 rather than 5.

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