Skip to main content
Glama

Wait For Text

wait_for_text

Waits until specified text appears in a page selector (default body), enabling reliable AJAX/SPA text detection before continuing automation.

Instructions

Wait until text appears in selector (default body). For AJAX/SPA text signals.

Ex: wait_for_text('t0', 'Welcome back', timeout_s=10) → {"ok":true,"found_in_ms":1840}

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": {
      "tab_id": "<tab_id>",
      "text": "<text>"
    },
    "name": "wait_for_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
tab_idYes
selectorNobody
timeout_sNo
case_sensitiveNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations exist, so the description carries the full burden. It explains waiting and shows a success payload, but says nothing about what happens on timeout — whether it returns ok:false, throws, or blocks the full timeout_s — which is the single most important behavior for a wait primitive.

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 lines: a scoping sentence followed by a compact call example with a sample return. Front-loaded and economical, though the example spends tokens restating what the output schema already declares.

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

Completeness3/5

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

An output schema exists, so return shape need not be described. However, for a wait tool the failure/timeout path and the effective default timeout are exactly the details an agent needs to choose and configure it, and those are absent.

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% across 5 parameters, so the description must compensate. It clarifies `text`, the `selector` default of body, and `timeout_s` via the example, but leaves `tab_id` and especially `case_sensitive` undefined, and gives no matching semantics.

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 until `text` appears within a selector, defaulting to body. The phrase 'text signals' distinguishes it from generic `wait_for`, though the sibling relationship is never made explicit.

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?

'For AJAX/SPA text signals' gives a usage context, implying dynamic content that appears asynchronously. But it never contrasts with `wait_for` or `find_by_text`, nor says when to poll versus when to extract text instead.

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