Skip to main content
Glama

click_element

Clicks a page element with real mouse input after scrolling it into view, waiting for it to appear or be enabled. Fails without clicking when the element is hidden, covered, or disabled.

Instructions

Clicks an element with real mouse input after scrolling it into view; waits up to 2 s for a CSS selector's element to appear or be enabled, and fails without clicking when it is hidden, covered (naming the overlay) or disabled. A dialog or breakpoint the click triggers is noted in the reply ({dialog} or {paused, location}), not an error: continue with handle_dialog or resume (evaluate_on_call_frame, with --tool-groups debug, reads the paused frame).

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": "click_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
buttonNoMouse button ('right' opens context menus). Default: 'left'.
tab_idNoDefault: the active tab.
selectorYesCSS selector, 'host >>> inner' (into an open shadow root or same-origin iframe) or snapshot ref (e12).
modifiersNoKeys held during the click.
click_countNo1, 2 (double click) or 3. Default: 1.
instance_idNoDefault: 'default'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.1

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and covers most of it: real mouse input, pre-click scroll, a bounded 2 s wait, and deterministic failure modes that name the blocking overlay. It also discloses the reply shape ({dialog} or {paused, location}). It does not say whether a click can navigate away or destroy page state, which is the main remaining behavioral gap for a mutation-style tool.

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?

Two dense sentences, both front-loaded with the highest-value facts (real mouse input, wait, failure conditions, next steps). The trailing parenthetical about evaluate_on_call_frame and --tool-groups debug is heavy but does earn its place by making the paused-frame recovery actionable.

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?

For a 6-parameter click tool with no output schema, the description covers timing, failure, and two non-error reply shapes, which is the information an agent most needs. The omission is the ordinary success path — whether the reply reports navigation, element state, or nothing at all.

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 button, modifiers, click_count, tab_id, selector, and instance_id are already documented in the schema. The description adds only the notion of selector targeting for the wait behavior and nothing about button, modifiers, or click_count semantics, so baseline 3 applies.

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 names a specific verb and resource ('Clicks an element with real mouse input') and immediately qualifies it with mechanics that separate it from siblings: scroll-into-view, a 2 s wait, and hard failure on hidden/covered/disabled targets. An agent can tell this apart from hover, drag, or evaluate_js without opening another schema.

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 explicit downstream routing for the tricky case: when a click triggers a dialog or breakpoint that is 'not an error', continue with handle_dialog or resume. It does not state when to prefer a sibling instead (e.g. hover for mouseover-only menus, or press_key for keyboard activation), so it falls short of full when/when-not guidance.

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