Skip to main content
Glama

Wait For

wait_for

Pauses browser automation until a selector, text, URL pattern, timeout, page load state, or network idle condition is met.

Instructions

Wait for selector, text, URL regex, timeout, load state, or network idle.

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": {
      "kind": "<kind>"
    },
    "name": "wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYes
stateNo
valueNo
pageIdNoPage id. Defaults to the active page.
timeoutMsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It reveals nothing about whether the call blocks, what occurs on timeout (throw vs. return false), default timeout values, or whether the page is mutated — all critical for a wait primitive.

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

Conciseness3/5

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

It is a single front-loaded sentence with no wasted words, but the brevity is under-specification rather than efficiency. The one sentence an agent gets is spent largely repeating schema content.

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

Completeness2/5

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

For a 5-parameter, enum-driven blocking primitive with no annotations and no output schema, the definition leaves out timeout semantics, return behavior, and the meaning of four of five parameters. An agent cannot call this correctly across all `kind` variants from the description alone.

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

Parameters2/5

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

Schema description coverage is only 20% across 5 parameters, so the description should compensate but does not. It only echoes the `kind` values and never explains `state`, `value`, `pageId`, or `timeoutMs` (including the 120s cap and how `value` interacts with the different `kind` options).

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

Purpose3/5

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

The description gives a verb ('Wait for') and enumerates the six wait conditions, but the list is essentially a restatement of the `kind` enum already in the schema. It does not distinguish this tool from siblings like `assert` or `snapshot`, which an agent could plausibly reach for when waiting on page conditions.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus `assert`, `snapshot`, or `element_info`, and no mention of what happens on timeout or when a wait is appropriate. The agent must infer the entire usage context from the tool name alone.

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