Skip to main content
Glama

wait_for_selector

Waits for a web element matching a CSS selector to appear or reach a specified state (attached, detached, visible, hidden) in an Electron application, returning element count and bounding box data.

Instructions

Wait until an element matching a selector appears (or reaches a given state: attached/detached/visible/hidden). Returns element count and the bounding box of the first match so you do not need a follow-up eval. Honours timeoutMs (default 5000).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYes
stateNoDefault visible.
timeoutMsNoDefault 5000.
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behaviors: it returns element count and bounding box of the first match (avoiding follow-up eval), honors a timeout with default value, and supports multiple states. It covers mutation aspects (waiting for changes) and output behavior, though it could mention error handling or side effects.

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 front-loaded with the core purpose, followed by key behavioral details and parameter defaults in two efficient sentences. Every sentence adds critical information without redundancy, making it appropriately sized and well-structured for quick understanding.

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

Completeness4/5

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

Given 3 parameters, no annotations, and no output schema, the description does a good job covering purpose, behavior, and parameter context. However, it could be more complete by explicitly detailing the return format (e.g., structure of bounding box) or error cases, leaving minor gaps in full contextual understanding.

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 description coverage is 67% (2 of 3 parameters have descriptions). The description adds value by explaining the 'state' parameter's purpose ('reaches a given state: attached/detached/visible/hidden') and clarifying 'timeoutMs' default, which compensates for the lack of schema description on 'selector'. It provides meaningful context beyond the schema's basic definitions.

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 clearly states the verb ('wait until') and resource ('an element matching a selector appears'), specifying the exact action. It distinguishes from siblings like 'wait' and 'wait_for' by focusing on selector-based waiting with state conditions, making the purpose specific and differentiated.

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 implies usage for waiting on selector-based element states, but does not explicitly state when to use this vs. alternatives like 'wait' or 'wait_for'. It provides clear context for selector-based scenarios but lacks explicit exclusions or named alternatives, limiting full guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mesomya/electron-driver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server