Skip to main content
Glama
doucej

playwright-mcp-server

by doucej

wait_for_selector

Wait until an element matching a provided selector is present or reaches a specified state (attached, visible, hidden, or detached), enabling reliable automation.

Instructions

Wait until an element matching the selector is present.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoDesired element state (default: attached).
timeoutNoMaximum wait time in milliseconds (default: 30 000).
selectorYesCSS or XPath selector.
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It states only that the tool waits for an element to be present, but it does not disclose what happens on timeout (throw, return false, etc.), whether it polls or uses events, or what the return value is. This is a significant gap for a wait operation.

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 a single short sentence that immediately conveys the core function. There is no redundancy or unnecessary detail. It is an excellent example of concise writing.

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

Completeness3/5

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

The tool is relatively simple, and the schema documents the parameters well. However, because there is no output schema and no annotations, the description should at least mention the return value or timeout behavior to be complete. This missing information makes the description adequate but not thorough.

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

Parameters3/5

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

Schema coverage is 100%: all three parameters (selector, state, timeout) have descriptions in the input schema. The tool description adds no additional meaning beyond 'element matching the selector', which is already captured in the selector parameter description. Per the baseline, a score of 3 is appropriate when the schema fully documents parameters.

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 action ('Wait') and the target ('an element matching the selector'). It unambiguously differentiates this from sibling tools like click, type, or get_text, which perform other operations. The purpose is immediately obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies a usage scenario: wait for an element to appear before interacting with it. However, it does not explicitly state when to use this tool versus alternatives, nor does it mention any prerequisites or exclusions. The guidance is minimal and relies on the tool's name and context.

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/doucej/playwright-mcp-server'

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