Skip to main content
Glama

wait_for

Pause browser automation until a CSS selector or text appears or disappears in the page. Use with timeout to handle dynamic content.

Instructions

Wait for a selector or text to appear/disappear.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goneNo
tabIdNoTab id (default: active tab)
frameIdNoFrame id from frames_list
selectorNo
allFramesNoAct on the first match in ANY frame (the element may be in an iframe)
timeoutMsNo
textContainsNo
failOnAuthWallNoError with [AUTH_REQUIRED] if this lands on a sign-in wall (expired session)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.9.5
    • changedInput schema / properties / allFrames / description
      Previous value: -"Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)"New value: +"Act on the first match in ANY frame (the element may be in an iframe)"
    • changedInput schema / properties / failOnAuthWall / description
      Previous value: -"Fail with [AUTH_REQUIRED] when the page this call lands on is a high-confidence sign-in wall (session expired). Off by default unless the server runs with --fail-on-auth-wall; snapshot still reports the verdict as `authWall` either way."New value: +"Error with [AUTH_REQUIRED] if this lands on a sign-in wall (expired session)"
    • changedInput schema / properties / frameId / description
      Previous value: -"Act inside this frame (ids come from frames_list)"New value: +"Frame id from frames_list"
    • changedInput schema / properties / tabId / description
      Previous value: -"Target tab id (defaults to the active tab)"New value: +"Tab id (default: active tab)"
  2. Changed1 schema field changedv0.9.3
    • addedInput schema / properties / failOnAuthWall
      Added value: +{
      +  "description": "Fail with [AUTH_REQUIRED] when the page this call lands on is a high-confidence sign-in wall (session expired). Off by default unless the server runs with --fail-on-auth-wall; snapshot still reports the verdict as `authWall` either way.",
      +  "type": "boolean"
      +}
  3. Changed2 schema fields changedv0.7.0
    • addedInput schema / properties / allFrames
      Added value: +{
      +  "description": "Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / frameId
      Added value: +{
      +  "description": "Act inside this frame (ids come from frames_list)",
      +  "type": "number"
      +}
  4. First observedv0.6.2

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description carries the full burden, but it only states the core wait behavior. It does not disclose default timeout behavior, what happens on timeout, whether 'appear' means visible or attached, or how multiple conditions interact.

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?

The description is a single front-loaded sentence with no filler or redundancy. Every word contributes to the core meaning.

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

Completeness2/5

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

For an 8-parameter tool with no annotations and no output schema, the description is too thin. An agent cannot determine required parameter combinations, default timeout, what 'gone' means precisely, or what happens when the wait condition is not met.

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?

The description adds some semantic meaning by connecting 'selector' and 'text' to the selector/textContains parameters and 'disappear' to gone. However, it leaves timeoutMs, frame targeting, and condition-combination behavior unexplained, and schema coverage is only 50%.

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?

The description uses a specific verb ('Wait'), names the exact resources ('selector or text'), and captures the two outcomes ('appear/disappear'). It clearly differentiates this from sibling tools like click, type, and navigate.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives, such as before interacting with a page, after navigation, or in polling scenarios. The description only states what it does, not when it should be chosen.

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