Skip to main content
Glama

wait_for_element

Wait for a page element selected by CSS, XPath, ID, name, tag, class, or link to become visible, clickable, present, or invisible before continuing browser automation.

Instructions

Wait until an element is visible on the page.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "wait_for_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoStrategycss
timeoutNoSeconds
selectorYesLocator value
conditionNovisible

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.9.3
    • changedInput schema / properties / by / description
      Previous value: -"Locator strategy"New value: +"Strategy"
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector, XPath, or other locator value"New value: +"Locator value"
    • changedInput schema / properties / timeout / description
      Previous value: -"Wait timeout in seconds"New value: +"Seconds"
  2. First observedv0.3.7

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description carries the full burden, yet it omits critical behavior: that the call blocks, that it fails/times out after 'timeout' seconds, and what it returns or throws on failure. The single word 'visible' also understates that the tool can wait for clickable/present/invisible states.

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?

A single front-loaded sentence with no wasted words, which is the right shape. It is however sized for a much simpler tool than a four-parameter, blocking, timeout-driven wait.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter tool with no annotations and no output schema, the description leaves out timeout behavior, failure mode, and the non-default condition values. An agent cannot predict what the call will do on a missing element or how long it will block.

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

Parameters2/5

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

Schema coverage is 75% and the enum descriptions are terse ('Strategy', 'Seconds'), so the schema does most of the work. The description adds nothing about 'by', 'timeout', or 'condition', and by saying only 'visible' it silently narrows a tool whose condition parameter supports clickable, present, and invisible.

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 ('Wait until') and resource ('an element is visible on the page'), which is more informative than a bare tautology. However, it does not distinguish itself from close siblings such as assert_element_visible or find_element, so an agent cannot tell from the description alone why it would wait rather than assert.

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?

No indication of when to prefer this over assert_element_visible, is_displayed, or find_element, and no mention of the waiting/blocking semantics that are the whole point of the tool. Usage is only implied by the verb 'wait'.

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