Skip to main content
Glama

wait_selector

Wait until a CSS selector reaches a specified state (visible, hidden, attached, or detached).

Instructions

Wait until a CSS selector reaches a state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leaseNoOptional lease token to present if the target session is leased (0.7.0). Threaded per-call; never read from the server's env.
stateNovisible|hidden|attached|detached
sessionNoOptional session name to target (omit for the shared 'default'). On a daemon shared with other agents, pass a UNIQUE name for stateful multi-step work (go→click→fill) so you don't collide on 'default'.
selectorYesCSS selector.
timeout_msNoTimeout in ms.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations provided, the description must disclose behavior such as timeout handling, return values, or error conditions, but it only states the action. It does not mention what happens when the state is not reached within the timeout, whether it throws, or what it returns, leaving the agent to guess.

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 sentence with no filler. It front-loads the action and avoids redundancy with the schema, making it efficient for an agent to parse.

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?

While the schema fully documents parameters, the description lacks context on expected outcomes (e.g., does it return a boolean, does it throw on timeout) and assumes the agent knows the semantics of the state values. For a wait tool with several parameters and no output schema, this is a noticeable gap, but it is not dangerously incomplete.

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 input schema already provides descriptions for all five parameters, including state values, session, lease, timeout, and selector, so the description adds no additional parameter guidance. Per calibration, with 100% schema coverage, a baseline of 3 is appropriate, and the description does not enhance beyond that.

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 states a clear verb-resource pair: waiting for a CSS selector to reach a state. This distinguishes it from sibling wait_* tools (wait_url, wait_load, wait_fn) by specifying the target is a CSS selector's state. The single sentence is precise and unambiguous.

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?

The description provides no guidance on when to use this tool versus the many other wait_* alternatives, nor does it mention scenarios where it is preferred or disallowed. The agent must infer usage purely from the name and schema, which is insufficient for choosing correctly among siblings.

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