Skip to main content
Glama

wait_for

Read-only

Waits for specified text to appear on a selected page, optionally until it becomes visible, so agents and scripts can synchronize with dynamic content.

Instructions

Wait for the specified text to appear on the selected page. By default, hidden text is also matched. Set visible to true to wait until the matched text is visible.

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": {
      "pageId": "<pageId>",
      "text": "<text>"
    },
    "name": "wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesNon-empty list of texts. Resolves when any value matches an accessible name exactly or is a substring of DOM text. Matching is case-sensitive. DOM text preserves spaces and newlines, unlike snapshot text which may normalize whitespace. Use the original whitespace or a shorter distinctive substring.
pageIdYesTargets a specific page by ID.
timeoutNoMaximum wait time in milliseconds. If set to 0, the default timeout will be used.
visibleNoIf true, wait until the matching text is visible. By default, hidden text also counts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds genuinely useful behavior beyond that: hidden text is matched by default and visible=true changes the wait condition. It does not disclose what happens on timeout (error vs. silent return), which is the key behavioral unknown for a wait tool.

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 core action, then the default behavior, then the opt-in flag. No redundant or filler wording.

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 four-parameter read-only tool with no output schema, the description plus rich schema covers nearly everything needed to call it. The one omission is timeout/failure semantics, which the schema's timeout parameter hints at but does not explain.

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 100%, so all four parameters are already documented, including the case-sensitivity and whitespace-matching rules for text. The description only restates the visible parameter's default, adding no meaning beyond the schema; baseline 3 applies.

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?

States a specific verb and resource: 'Wait for the specified text to appear on the selected page.' An agent can immediately tell this is a text-based wait/poll operation, and no sibling tool in the list performs waiting, so differentiation is implicit rather than stated.

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 by the verb 'wait' and the text-matching condition, but the description never says when to prefer this over polling with take_snapshot or evaluate_script, nor when not to use it. Adequate but leaves the agent to infer the context.

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