Skip to main content
Glama
yinnho

AginxBrowser

session_wait

Read-only

Wait for async content to appear by polling a CSS selector or JS predicate until truthy, with a timeout. Replaces blind sleeps for dynamic pages.

Instructions

Wait until a CSS selector matches or a JS predicate turns truthy, with a timeout. The page's event loop keeps running while waiting (fetches, timers, promise chains progress), so this replaces blind sleeps for async content: navigate, session_wait for '.price-card', then click/read. Returns {matched, elapsed_ms, detail:{tag,text} or the predicate value}; errors with timeout ... naming the selector/predicate on expiry. Exactly one of selector/predicate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorNoCSS selector to wait for (e.g. ".price-card")
predicateNoJS expression polled until truthy (e.g. "document.querySelectorAll('.card').length >= 3")
session_idYesSession ID
timeout_msNoGive up after this many milliseconds (default: 10000, max: 120000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.1
    • removedInput schema / title
      Removed value: -"SessionWaitParams"
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation, the description reveals that the page's event loop continues running (fetches, timers, promise chains progress), which is important behavioral context. It also discloses the return shape, error text format, and the exactly-one-of constraint. This is substantial added value beyond the annotation.

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 two sentences, tightly packed with purpose, behavior, usage example, return format, error behavior, and the exclusivity constraint. No filler words; key information is front-loaded.

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 tool with no output schema, the description fully covers what an agent needs: what it waits for, the async behavior, a usage example, the return shape, error format, and the parameter constraint. The only minor omission is polling interval, but that is not essential for correct invocation.

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 adds a critical non-schema constraint: 'Exactly one of selector/predicate.' It also explains the meaning of selector and predicate in the wait context and what the return detail field contains depending on which is used, going beyond the schema's basic definitions.

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?

The description clearly states a specific action: wait until a CSS selector matches or a JS predicate is truthy, with a timeout. It gives a concrete example workflow (navigate, session_wait for '.price-card'), which distinguishes it from blind sleeps, but it does not explicitly compare itself to sibling tools like session_eval or session_console.

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

Usage Guidelines4/5

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

The description explicitly positions the tool as a replacement for blind sleeps in async scenarios: 'so this replaces blind sleeps for async content'. It provides a typical usage pattern, which gives clear context for when to use it. It stops short of stating exclusions (e.g., when not to use) and does not name alternative tools, so it loses the fifth point.

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