Skip to main content
Glama

Click element

click_element

Clicks the first element matching a selector and waits for any navigation it triggers, enabling reliable browser test interactions.

Instructions

Click the first element matching a selector. Waits for any navigation the click triggers. Note "text=" is a case-insensitive substring match against any element (headings included); prefer aria-ref from get_page_snapshot or scoped selectors like button:has-text("Login").

Input Schema

NameRequiredDescriptionDefault
frameNoCSS selector of the iframe containing the element (e.g. "iframe[name^=__privateStripeFrame]"), or a list for nested iframes, outermost first. Not needed with aria-ref selectors.
timeoutNoTimeout in milliseconds
selectorYesSelector: "aria-ref=e5" from get_page_snapshot (preferred; also reaches into iframes), CSS ("#email", "button.submit"), text ("text=Sign in"), role ("role=button[name=/save/i]") or XPath ("xpath=//a")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

The annotations declare readOnlyHint=false and openWorldHint=true, so the description only has to add context. It does so well by disclosing that the tool waits for navigation triggered by the click, and by warning that text= may match any element as a case-insensitive substring; still, it omits what happens on timeout or on no match.

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?

Two sentences, with the action and its navigation-waiting side effect front-loaded, followed by a single caveat about selectors. Nothing is redundant.

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?

With 3 parameters, 100% schema coverage, and no output schema, the description covers the main behavior an agent needs: matching semantics, navigation waiting, and selector preference. The only gaps are error behavior when no element matches and whether clicking scrolls the element into view.

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 100%, so the baseline is 3, and the description adds real meaning beyond the schema: it says aria-ref selectors also reach into iframes, so the frame parameter is often unnecessary, and it warns about substring matching. It does not describe how the frame list is ordered, or how timeout interacts with navigation waiting.

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?

It states a specific verb and resource — 'Click the first element matching a selector' — and the word 'first' usefully scopes the behavior when several elements match. It does not explicitly contrast itself with sibling action tools such as hover_element or fill_input, but the click semantics are unambiguous.

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?

It gives concrete selector guidance that changes how the tool should be called: prefer aria-ref from get_page_snapshot, and fall back to scoped selectors such as button:has-text("Login") rather than bare text=. It states no exclusion conditions (for example, when to use hover_element or press_key instead), so the guidance is contextual rather than complete.

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