Skip to main content
Glama

Wait for condition

wait_for

Pause automation until a selector, text, URL, JavaScript predicate, or page load state is met, so async updates and navigation finish before the next step.

Instructions

Wait for a selector/text state, a URL, a JavaScript predicate, or a page load state. Use after actions that trigger async updates or navigation.

Input Schema

NameRequiredDescriptionDefault
jsNoJavaScript expression/predicate.
textNo
exactNo
stateNovisible
tabIdNo
frameIdNo
timeoutNo
trustedNo
intervalNo
selectorNo
loadStateNo
urlMatchesNoJavaScript regular expression source.
urlIncludesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure and does not meet it. It says nothing about what happens on timeout (error vs. silent return), that timeout defaults to 10s and caps at 120s, the 200ms polling interval, or whether only one wait can be active at a time.

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?

Two short sentences with no padding, and the capability list is front-loaded ahead of the usage hint. Nothing is wasted, though the terse enumeration leaves the reader parsing unformatted prose rather than a scannable list.

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 13-parameter, zero-required tool with no annotations and no output schema, this description is far too thin. An agent cannot tell how the condition parameters interact, what a timeout produces, or which parameters are required to make a valid call.

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 15% across 13 parameters, so the description must compensate and largely does not. Enumerating the four condition families loosely maps to js, selector/text, urlMatches/urlIncludes, and loadState, but state, exact, trusted, timeout, interval, tabId, and frameId remain undocumented, and the critical question of whether these condition modes are mutually exclusive or combinable is unanswered.

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 names a specific verb (wait) and enumerates the four condition families it accepts: selector/text state, URL, JavaScript predicate, and page load state. That is enough to separate it from siblings like evaluate, snapshot, or navigate without opening the schema. It stops short of explicitly naming which siblings are the alternatives.

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 after actions that trigger async updates or navigation" gives clear situational context for when to reach for this tool rather than polling manually. It offers no when-not guidance (e.g., do not use if the element is already synchronously present) and does not point at an alternative tool.

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