Skip to main content
Glama

Web Wait For

web_wait_for

Waits (polls, not a fixed sleep) until an element appears on the page, or times out. Use for SPA pages that hydrate after load. Prefer selector (a CSS selector, e.g. "input[name=password]"). condition also accepts the form "document.querySelector('...')"; any OTHER JavaScript condition runs arbitrary code on the page (same power as web_eval) and is disabled when LMCP is in read-only mode. Returns met:true/false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionNoSession name (default 'default').
selectorNoCSS selector to wait for (preferred; treated as data, never executed). e.g. .feed
conditionNoAlternative to selector: "document.querySelector('...')" is accepted as-is; any other JS expression runs arbitrary code on the page (same power as web_eval).
timeout_secondsNoMax seconds to wait (default 15).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
metNoTrue if the condition became truthy before the timeout.
messageNoPresent when the condition was not met.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / condition / description
      Previous value: -"Alternative to selector: \"document.querySelector('...')\" is accepted as-is; any other JS expression requires the web_eval settings opt-in."New value: +"Alternative to selector: \"document.querySelector('...')\" is accepted as-is; any other JS expression runs arbitrary code on the page (same power as web_eval)."
  2. Changed3 schema fields changed
    • changedInput schema / properties / condition / description
      Previous value: -"JS expression evaluated on the page; waits until it's truthy. e.g. document.querySelector('.feed')"New value: +"Alternative to selector: \"document.querySelector('...')\" is accepted as-is; any other JS expression requires the web_eval settings opt-in."
    • addedInput schema / properties / selector
      Added value: +{
      +  "description": "CSS selector to wait for (preferred; treated as data, never executed). e.g. .feed",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "condition"
      -]New value: +[]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "message": {
      +      "description": "Present when the condition was not met.",
      +      "type": "string"
      +    },
      +    "met": {
      +      "description": "True if the condition became truthy before the timeout.",
      +      "type": "boolean"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  4. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond annotations, it discloses that waiting is polling rather than sleeping, that selector is data and never executed, that arbitrary conditions run with web_eval power, and that such conditions are disabled in read-only mode. This is important security and side-effect information.

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 compact and front-loaded; each sentence carries distinct information (behavior, use case, selector guidance, condition caveat, return value) without padding.

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?

With all parameters documented and an output schema present, the description still adds the SPA context, execution-safety distinction, read-only caveat, and return flag, making it complete for agent selection and 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 baseline is 3. The description adds meaningful guidance: prefer selector, explains the accepted condition form, and flags read-only behavior for arbitrary conditions.

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 opens with a specific verb and resource: waits (polls, not a fixed sleep) until an element appears on the page or times out. It grounds the tool in SPA/hydration and references web_eval, which helps an agent separate it from web_find or UI-element waits.

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?

It gives an explicit use case: 'Use for SPA pages that hydrate after load.' It does not enumerate exclusions or compare against the similar ui_wait_for_element, but the intended context is unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources