Skip to main content
Glama

Wait For

wait_for

Pause automation until a CSS selector appears, a URL substring matches, or network activity goes idle, so steps run only after the page reaches the needed state.

Instructions

Wait — one of: selector / url_contains / network_idle_ms. For text use wait_for_text.

Ex (DOM): wait_for('t0', selector='.submit-btn') → {"ok":true,"why":"selector_found"} Ex (URL): wait_for('t0', url_contains='/dashboard') → {"ok":true,"why":"url_match","url":"..."} Ex (network): wait_for('t0', network_idle_ms=500) → {"ok":true,"why":"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": {
      "tab_id": "<tab_id>"
    },
    "name": "wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
tab_idYes
selectorNo
timeout_sNo
url_containsNo
network_idle_msNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. The examples show successful `ok` outcomes and `why` values, but they do not explain timeout behavior, what happens on failure, or how `timeout_s` is applied.

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?

The condition list is front-loaded, the text-wait alternative follows immediately, and the three compact examples illustrate each mode without excessive prose. Every part earns its place.

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?

An output schema exists, so return values need not be fully explained, and the examples still help. However, for a wait tool with no annotations and zero schema descriptions, the absence of timeout and failure semantics leaves a meaningful gap.

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 0%, so the description must compensate. It meaningfully explains `selector`, `url_contains`, and `network_idle_ms` through examples, but leaves `tab_id` and `timeout_s` undocumented, and 'one of' is slightly ambiguous because the schema permits multiple condition fields.

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?

The description clearly states that the tool waits for one of three conditions: selector, URL substring, or network idle. It also explicitly distinguishes itself from `wait_for_text`, so an agent can tell which wait tool to pick, though the verb 'Wait' is somewhat generic.

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 names the condition types to use and explicitly routes text waits to `wait_for_text`. It does not address other nearby wait siblings such as `wait_for_download`, so guidance is clear but not exhaustive.

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