Skip to main content
Glama

page.wait_for

Read-only

Waits until an element, text, or condition appears or disappears; use any_of or all_of to race several outcomes. On timeout, it reports which conditions were unmet and the closest page content.

Instructions

Wait until an element appears or disappears, or until text shows up. Use any_of to race several outcomes (success UI vs error UI) instead of guessing one and eating a full timeout; all_of waits for every condition. On timeout the error reports which conditions were unmet and the closest thing on the page.

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": "page.wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
goneNoWait for absence instead of presence.
textNo
all_ofNoReturn once every one of these is met.
any_ofNoReturn as soon as any one of these is met; the response says which (matched, index).
poll_msNo
selectorNo
normalizeNoCase- and whitespace-insensitive text matching. Use when the DOM may differ in casing or line breaks.
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
timeout_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true and openWorldHint=true, so the safety profile is already known. The description genuinely adds timeout-failure behavior (reports unmet conditions and the closest thing on the page), but says nothing about polling defaults, timeout defaults, or what a successful return looks like beyond any_of's matched index.

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?

Core purpose is front-loaded in the first sentence, and the follow-up sentences carry distinct, non-redundant information about mode selection and failure reporting. The second sentence strings three ideas together with semicolons, making it slightly dense but still readable.

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 10 optional parameters and no output schema, the description should say what happens when no condition is supplied and what the default timeout/polling behavior is; neither is covered. It does cover the two composite modes and timeout errors well, which is the most important behavioral surface for this tool.

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 coverage is 60%, so a third of the parameters (text, selector, poll_ms, timeout_ms) lack even schema descriptions, and the prose does not compensate for those. What it does add beyond the schema is the semantics of composing conditions via any_of/all_of and the index reported on a match.

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?

States a specific verb and resources: wait for an element to appear/disappear or for text to show up, and it distinguishes the any_of vs all_of modes. It does not differentiate itself from the close sibling page.expect, so the agent must infer which wait-style tool to use.

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 any_of to race several outcomes (success UI vs error UI) instead of guessing one and eating a full timeout" is concrete guidance on when to pick a mode, and all_of's 'wait for every condition' contrasts it. It gives no guidance on when to use this tool at all versus page.expect or page.observe, which are plausible alternatives.

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

Deploy Server

Other Tools