Skip to main content
Glama

wait_for

Read-only

Waits until specified conditions are met—visible text appears/disappears, an element reaches a state, or the URL contains text—checking every 100 ms and returning elapsed time or timeout details.

Instructions

Waits until every condition given holds: visible text appears or disappears (open shadow roots and same-origin iframes included), an element reaches a state, or the URL contains a text; checks every 100 ms. Returns the time waited; on timeout it fails naming what is missing. A dialog or debugger pause ends it at once.

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

Input Schema

NameRequiredDescriptionDefault
urlNoText the tab's URL must contain.
textNoVisible text to wait for (case-sensitive).
stateNoState 'selector' must reach ('hidden' = missing or without a visible box). Default: 'visible'.
tab_idNoDefault: the active tab.
selectorNoCSS selector, 'host >>> inner' (into an open shadow root or same-origin iframe) or snapshot ref (e12).
text_goneNoVisible text to wait to disappear, e.g. 'Loading'.
timeout_msNo1 to 30000. Default: 5000.
instance_idNoDefault: 'default'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.1

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, and the description is consistent with a non-mutating poll. Beyond that it discloses the 100 ms polling cadence, that all conditions are conjunctive, the return value (time waited), the timeout failure mode (fails naming what is missing), and the important edge case that a dialog or debugger pause ends the wait immediately. This is exactly the behavioral context annotations cannot carry.

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 semantics (what it waits for), then the operational facts (poll interval, return, timeout, interruption). No restatement of the name or title and no filler.

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

Completeness5/5

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

Eight optional parameters with no required fields and no output schema, yet the description still states what comes back (elapsed time) and how failure manifests. Combined with 100% schema coverage, an agent has everything needed to call it correctly and interpret the result.

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 description coverage is 100%, so the baseline is 3, but the description adds semantics the schema does not: the conditions are combined with AND ('every condition given holds'), and selector resolution reaches into open shadow roots and same-origin iframes. That cross-parameter composition rule is the main thing an agent could get wrong from the schema alone.

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 opens with a precise verb and resource ('Waits until every condition given holds') and enumerates the three condition families: text appears/disappears, element state, URL substring. That is far more specific than the name 'wait_for' alone. It stops short of naming a sibling to contrast with (e.g. snapshot or find_in_snapshot), so it is clear but not fully differentiated.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the agent can infer this is the tool for dynamic content that has not settled yet, and the mention of shadow roots and iframes hints at where plain selectors fail. There is no explicit when-to-use/when-not-to-use guidance and no named alternative for cases like 'the element is already there, just read it', which the sibling set clearly provides.

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