Skip to main content
Glama

Web Wait For

web_wait_for
Destructive

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): it requires confirm=true, and without it you get a preview that runs nothing. It is disabled when LMCP is in read-only mode. Returns met:true/false.

Input Schema

NameRequiredDescriptionDefault
confirmNoMust be true to run a `condition` that is arbitrary JavaScript. Without it, returns a preview and runs nothing. Not needed for `selector` or the document.querySelector('...') form.
sessionNoSession name (default 'default').
rememberNoWith confirm: true, also stop asking for this kind of action from now on. Only when the person said so ("don't ask again"). The person can revoke it in LMCP or with set_always_allowed.
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

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
    • addedInput schema / properties / remember
      Added value: +{
      +  "description": "With confirm: true, also stop asking for this kind of action from now on. Only when the person said so (\"don't ask again\"). The person can revoke it in LMCP or with set_always_allowed.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "Must be true to run a `condition` that is arbitrary JavaScript. Without it, returns a preview and runs nothing. Not needed for `selector` or the document.querySelector('...') form.",
      +  "type": "boolean"
      +}
  3. 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)."
  4. 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: +[]
  5. 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"
      +}
  6. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only say readOnly=false, destructive=true, openWorld=true; the description explains WHY — arbitrary JS conditions execute on the page with web_eval-level power, require confirm=true, otherwise return a preview that runs nothing, and are disabled entirely under read-only mode. That is exactly the kind of safety and failure-mode context annotations cannot convey.

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 verb and the polling-vs-sleep distinction, then escalates to the dangerous path and its guardrails. Slightly dense with repeated confirm semantics that the schema already spells out, but no sentence is wasted outright.

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 6-parameter, zero-required tool with an output schema and annotations, everything an agent needs to call it safely is present: default timeout lives in the schema, the confirm gate, the preview behavior, the read-only-mode restriction, and what a met/false result means.

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, but the description adds a preference ordering the schema does not state: prefer `selector` because it is treated as data and never executed, and that the document.querySelector('...') form is exempt from the confirm gate. It also repeats return shape (met:true/false) rather than deepening parameter meaning elsewhere.

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?

States a specific verb and mechanism ('Waits (polls, not a fixed sleep) until an element appears... or times out') and calls out the SPA-hydration use case, which separates it from a generic sleep or immediate check. It also contrasts itself with web_eval for the arbitrary-JS path, but never distinguishes itself from close siblings like web_find or ui_wait_for_element.

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?

'Use for SPA pages that hydrate after load' gives a clear positive trigger, and 'Prefer `selector`' plus the confirm=True rule for arbitrary JS gives explicit conditional guidance among the parameter paths. It stops short of saying when to use a different tool (e.g. web_find for an immediate check) or when waiting is the wrong approach.

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