Skip to main content
Glama

wait_for

Waits until specified text appears, an element is visible, or the URL contains a value after an action loads or updates a page, replacing guessed pauses with condition-based timing.

Instructions

Wait until everything given holds: text is on the page, the ref's element is visible, the URL has url_contains.

Gives up after timeout_ms (100 to 30000). Use it after an action that loads or updates the page,
instead of guessing a pause. Each poll checks the site, so a redirect to a blocked one ends the wait.

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
refNo
textNo
tab_idNo
timeout_msNo
url_containsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does a decent job: it discloses polling behavior, that a redirect to a blocked site terminates the wait, and the timeout bounds (100-30000 ms). It omits what happens when the timeout expires, i.e., whether it returns false, throws, or reports the failing condition.

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?

Three short sentences, front-loaded with the conditions, then timing limits, then usage guidance. No filler or repetition; each sentence adds actionable information.

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 five-parameter polling tool with no output schema and no annotations, the definition covers the conditions, timeout range, polling, and blocked-site behavior. It falls short on failure semantics and the tab_id parameter, which an agent would still need to infer.

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, and it explains text, ref (as element visibility), url_contains, and timeout_ms with its range. However tab_id is never mentioned, and the origin or format of ref values (presumably from read_page) is left implicit, so the compensation is incomplete.

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?

States a specific verb (wait) plus the exact conditions it waits on: page text, visibility of the ref's element, and URL matching. That makes it immediately distinguishable from siblings like click, navigate, or read_page.

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?

Explicitly says to use it after an action that loads or updates the page, instead of guessing a pause, which gives clear context and even contrasts it with a naive sleep. It does not name any sibling tool as the alternative, nor state when not to use it.

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