Skip to main content
Glama

dom_wait_for

Ensure a DOM element is present by polling every 100ms until the CSS selector matches, with optional visibility check and timeout to control waiting.

Instructions

Wait for an element to appear in the DOM (polls every 100ms).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNoTimeout in milliseconds (default: 5000)
visibleNoAlso require the element to be visible (default: false)
selectorYesCSS selector to wait for
targetIdYesTarget ID of the tab

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.9/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. It discloses the polling interval but omits critical behaviors: what happens on timeout (throws vs. returns false), whether it returns a value, and whether visibility is required (though that's a parameter, the description doesn't clarify the default behavior). The description is inadequate for a tool with no output schema.

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 sentence with zero filler. It front-loads the purpose and adds the polling interval as a key detail. Every word earns its place, making it highly concise and efficiently structured.

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 tool with four parameters, no output schema, and no annotations, this description is far too sparse. It does not mention return value, error behavior on timeout, or any usage context. An agent would need to guess important aspects like whether it blocks or returns a boolean. The omission of timeout handling is a significant gap.

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 description coverage is 100%, so all four parameters (timeout, visible, selector, targetId) have inline descriptions. The tool description adds nothing beyond the polling interval, which is not a parameter. Per the baseline rule, a 3 is appropriate since the schema adequately documents parameters.

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?

The description clearly states the core action: 'Wait for an element to appear in the DOM' and adds the polling interval (every 100ms). This is specific and distinguishes it from query tools like dom_query that don't wait. However, it does not explicitly differentiate from sibling tools that might have overlapping purposes, so it stops short of a 5.

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?

There is no guidance on when to use this tool versus alternatives. It does not mention scenarios like async loading, nor does it state any exclusions (e.g., when to use dom_query or dom_click instead). An agent must infer usage from the schema and name.

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