Skip to main content
Glama

Wait for a condition

qa_wait_for

Pause until the page meets one named condition (element, text, count, announcement, or URL), then return. Use after slow saves, confirmations, or sign-in steps instead of polling snapshots.

Instructions

Wait until the page satisfies ONE named condition, then return — instead of polling qa_snapshot, which renumbers every ref each time it is called. Conditions: appears / disappears / enabled (each takes an accessible name OR a CSS selector) · text / textGone (anywhere on the page) · countOf a selector with atLeast or exactly · announced (what the page said through a live region — pass a string to wait for one containing it, or true for any) · urlContains. Use it after anything whose answer arrives later than a click settles: an order confirmation, a slow save, a list that repopulates, a button that ungreys when validation finishes. A condition already true when you call returns immediately. ON TIMEOUT IT SAYS WHAT IT SAW — how many matched, how many were visible, the nearest names on the page, and anything announced — so a wait that failed on a typo tells you so instead of just running out. A SIGN-IN IS WHAT THIS IS FOR, MORE THAN ANYTHING ELSE. When the site hands over to a password, a code from a phone or a hardware key, that step is the person's — do not drive it and do not call it a failure. Tell them to sign in, then qa_wait_for { urlContains: "<the site you came from>", timeoutMs: 180000 }: it is answered by the extension, so it survives the navigation, and if the tab never moves at all it says THAT instead of just running out. Up to 300000 ms is real: the wait runs in slices and keeps the call alive. If it still comes back with stillWaiting, call it again with the same arguments; never ask the person to write that they are done. Read-only: waiting is not acting, so this needs no consent — the same footing as qa_wait_ready. There is no "until quiet" (that is what every action already does) and no "until the network is idle" (the interceptor sees only the page's own fetch/XHR in the top frame, so the number would not mean what its name says).

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

Input Schema

NameRequiredDescriptionDefault
textNoWait until this text is anywhere on the page
tabIdNoTarget tab (from qa_tabs); omit for the active tab
appearsNoWait until this appears — accessible name or CSS selector
atLeastNoWith countOf: wait until at least this many match (default 1)
countOfNoCSS selector to count — pair with atLeast or exactly
enabledNoWait until this control stops being disabled
exactlyNoWith countOf: wait until exactly this many match
textGoneNoWait until this text is no longer on the page
announcedNoWait until a live region speaks — a string waits for one containing it, true for any
timeoutMsNoGive up after this long (default 15000, max 60000 — or up to 300000 with urlContains, which is how you wait for a person to sign in)
disappearsNoWait until this is gone — accessible name or CSS selector
urlContainsNoWait until the tab address contains this. Answered by the extension itself, so it survives the navigation it is waiting for.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.86.2

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so richly: it states the operation is read-only and needs no consent, that already-true conditions return immediately, that timeouts report what was seen (match counts, visible counts, nearest names, live-region text), that waits run in slices up to 300000 ms, and that `stillWaiting` means re-call with identical arguments rather than prompting the user.

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?

The condition catalogue is front-loaded and scannable, and most sentences carry real payload (timeout diagnostics, retry semantics, unsupported waits). It is dense and leans on all-caps emphasis, and the sign-in section restates the 'answered by the extension' point already made in the schema, so it is slightly longer than strictly necessary.

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?

For a twelve-parameter tool with no annotations and no output schema, virtually everything an agent needs is present: condition taxonomy, defaults and ceilings, immediate-return behavior, failure diagnostics, retry protocol, and the human sign-in handoff. Nothing material is left to inference.

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 coverage is 100%, so the baseline is 3; the description still adds cross-parameter meaning by grouping the twelve properties into mutually exclusive named conditions and noting the timeout ceiling only rises with urlContains. It also supplies a working example (`urlContains` plus `timeoutMs: 180000`) and explains the string-vs-true distinction for `announced`, though it does not restate every property.

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?

Opens with a specific verb and scope — 'Wait until the page satisfies ONE named condition, then return' — and then enumerates every supported condition by name (appears, disappears, enabled, text, textGone, countOf, announced, urlContains). It explicitly contrasts itself with polling qa_snapshot and mentions qa_wait_ready, so an agent can place it against siblings without opening the schema.

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

Usage Guidelines5/5

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

Gives concrete triggering situations ('an order confirmation, a slow save, a list that repopulates, a button that ungreys'), an explicit when-not ('There is no "until quiet" ... and no "until the network is idle"'), a named alternative it displaces (qa_snapshot polling renumbers refs), and a dedicated sign-in procedure with exact arguments and timeout.

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