Skip to main content
Glama

page_wait_for

Wait until a page condition is met: selector or text appears, URL contains a string, or network goes idle. Returns immediately once any condition holds, avoiding fixed sleeps.

Instructions

Wait until the page reaches a condition instead of sleeping: a CSS selector appears, some text appears, the URL contains a string, or the network has been idle for N ms. Any one condition satisfies it (they OR together). Returns as soon as it holds — use this (or net_wait) rather than fixed waits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNowait until the page URL contains this substring
textNowait until this text appears anywhere in the page
selectorNowait until this CSS selector matches an element
sessionIdNo
timeoutMsNogive up after this many ms (default 10000)
networkIdleMsNowait until no new requests/console output for this many ms AND nothing started since your last action is still awaiting a response (requests older than 5 s — long-polls, streams, hung calls — do not block)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well: it reveals OR semantics, that it resolves as soon as one condition holds, and the nuanced networkIdle behavior (long-polls/streams older than 5s do not block). This goes beyond the schema and materially changes how an agent predicts execution.

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?

Two sentences, front-loaded with the core purpose, condition list, and usage alternative; no filler. The detail about network idle blocks is placed inside the parameter-relevant phrase, so structure stays efficient.

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 a six-parameter wait tool with no output schema and no annotations, this description covers trigger conditions, OR behavior, return timing, and usage guidance. It leaves sessionId undocumented and doesn't specify timeout failure behavior, but those are relatively minor gaps given the schema documents timeoutMs and session context is likely system-managed.

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 high (83%), so the schema already documents most parameters; the description adds cross-parameter semantics by stating conditions OR together. It does not add new per-parameter detail beyond the schema, but the interaction semantics are valuable.

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?

Description opens with a specific action and target ('Wait until the page reaches a condition instead of sleeping') and enumerates concrete conditions: selector, text, URL substring, network idle. It also distinguishes itself from fixed sleeps, making its role clear even among wait-related siblings.

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

Usage Guidelines5/5

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

It explicitly tells the agent when to use it ('use this rather than fixed waits') and names an alternative ('or net_wait'). The OR-any-condition note clarifies call construction, and the condition list gives concrete triggers for choosing this tool over unrelated siblings.

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