Skip to main content
Glama

browser_wait_for

Read-onlyIdempotent

Wait until a visible element shows specified text or matches a locator, or until matching elements disappear, so you can continue after delayed UI changes without fixed pauses.

Instructions

Waits until a visible element shows the text (case-insensitive substring) or matches the locator (see browser_find), in every frame; with gone=True, until none is left (a spinner, "Loading...", a closed dialog). Use it after an action whose result appears later: no fixed pause needed. timeout_ms: at most 115000. Response: count of matching elements and elapsed_ms; an error if the timeout is reached.

Input Schema

NameRequiredDescriptionDefault
goneNo
textNo
tab_idYesYour tab's id (from browser_new_tab, or a tab adopted with browser_adopt_tab).
locatorNo
timeout_msNo

Output Schema

NameRequiredDescriptionDefault
dataYes
statusYes
warningNoEmergency stop hotkey not held, or similar notice
untrusted_noteNoPage text that looks like instructions aimed at an AI

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv2.31.6
    • addedOutput schema / $defs
      Added value: +{
      +  "WaitedFor": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "count": {
      +        "type": "integer"
      +      },
      +      "elapsed_ms": {
      +        "type": "integer"
      +      },
      +      "gone": {
      +        "type": "boolean"
      +      }
      +    },
      +    "title": "WaitedFor",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / additionalProperties
      Added value: +true
    • addedOutput schema / description
      Added value: +"Matching elements once the wait is over."
    • addedOutput schema / properties / data
      Added value: +{
      +  "$ref": "#/$defs/WaitedFor"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "title": "Result",
      -  "type": "string"
      -}
    • addedOutput schema / properties / status
      Added value: +{
      +  "const": "success",
      +  "type": "string"
      +}
    • addedOutput schema / properties / untrusted_note
      Added value: +{
      +  "description": "Page text that looks like instructions aimed at an AI",
      +  "type": "string"
      +}
    • addedOutput schema / properties / warning
      Added value: +{
      +  "description": "Emergency stop hotkey not held, or similar notice",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "status",
      +  "data"
      +]
    • changedOutput schema / title
      Previous value: -"browser_wait_forOutput"New value: +"WaitForAnswer"
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial extra behavior: polling across every frame, case-insensitive substring semantics, the maximum timeout of 115000ms, the return payload (matching element count and elapsed_ms), and that a timeout produces an error. That is exactly the kind of context annotations cannot convey.

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?

Front-loads the core behavior in the first sentence and follows with usage, timeout limit, and return shape; nearly every clause adds information. The opening sentence is dense with parentheticals, which costs a bit of readability but not enough to warrant trimming.

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

Completeness5/5

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

For a polling tool with an output schema, the description covers mode selection, cross-frame scope, timing limits, error behavior, and result contents. An agent can call this correctly without reading anything else.

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?

With only 20% schema description coverage, the description carries most of the burden and does so well: it defines text semantics (case-insensitive substring), explains locator by reference to browser_find, explains gone as the inverse mode, and caps timeout_ms at 115000. Only tab_id (already documented in schema) and the default timeout value are left to structured fields.

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?

States a precise verb and resource: waits until a visible element shows matching text (case-insensitive substring) or matches a locator, across every frame, with an inverse 'gone' mode. This is clearly distinguishable from siblings like browser_wait_load and browser_wait_network_idle, which wait on page/network state rather than element/text presence.

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?

Explicitly tells the agent when to use it: after an action whose result appears later, with the note that no fixed pause is needed, and lists concrete examples (spinner, 'Loading...', closed dialog) for gone=True. It also routes locator syntax to browser_find. It does not explicitly say when to prefer browser_wait_load or browser_wait_network_idle instead, so it stops short of full alternative routing.

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