Skip to main content
Glama
Intrect-io

lyra-browser

Official
by Intrect-io

wait_for

Pause until the page is ready: wait for text, a selector, a URL pattern, or a load state before reading or clicking, instead of sleeping.

Instructions

Wait until the page is ready, instead of sleeping or clicking to pass time.

Give exactly one condition:

  • text: the phrase is in the page's visible text — what read_page returns. Whitespace does not matter, case does. state="hidden" waits for it to be gone instead (a "Loading..." message).

  • selector: an element matching it (CSS or Playwright text=) reaches state: visible (default), hidden, attached or detached.

  • url: the tab's URL matches. A glob over the whole URL, so use **/checkout** or https://site.example/cart*, not checkout.

  • load_state: load, domcontentloaded or networkidle.

Waits up to timeout_ms (default 10000, never more than 30000) and returns {"status": "ok", "waited_ms"}. Running out of time is an answer, not a failure: {"status": "timeout", "waited_ms", "last_seen"}, where last_seen is a short excerpt of the page text (the URL for a url wait) so you can see why. Bad arguments return error.

Use it after navigate or an action when the page draws content late: a page that renders 300ms after load looks empty to read_page until this returns. It only reads, so it needs no approval and works while the user has taken over.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo
textNo
stateNovisible
selectorNo
load_stateNo
timeout_msNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: it documents the success and timeout return shapes including 'last_seen', states that timeout is 'an answer, not a failure', notes bad arguments return 'error', and discloses that it only reads, needs no approval, and works while the user has taken over. These are meaningful behavioral facts beyond any structured field.

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?

Front-loaded with the core purpose, then organized as scannable bullets with return-value and usage notes at the end — nothing is wasted. It is on the long side for a single tool, but the length is largely justified by six parameters and two distinct return paths.

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 six-parameter, zero-coverage, no-annotation tool, this is complete: it defines every parameter, the mutual-exclusion rule, timeout bounds, both return shapes, and the operational context (no approval, takeover-safe). An agent has everything needed to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and does: it defines the semantics of each of the six parameters — text (whitespace-insensitive, case-sensitive), state (visible/hidden/attached/detached), selector (CSS or text=), url (whole-URL glob with examples), load_state values, and timeout_ms (default 10000, max 30000). It also warns that exactly one condition must be given, which the flat schema does not express.

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?

States a specific verb+resource ('Wait until the page is ready') and immediately frames its role against the anti-pattern of 'sleeping or clicking to pass time'. It also references the sibling 'read_page' to anchor what it observes, letting an agent distinguish it from navigation and read tools.

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?

Explicitly says when to use it ('after navigate or an action when the page draws content late') and why ('a page that renders 300ms after load looks empty to read_page'). It also supplies the alternative it replaces (sleeping/clicking), so the when-to-use is unambiguous.

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