Skip to main content
Glama

click

Click elements by reference, CSS selector, visible text, or exact viewport coordinates. Uses real CDP mouse events, reports new tabs, and optionally returns the DOM diff.

Instructions

Click an element by ref, CSS selector, visible text, or viewport x/y (canvas, pixel-precise targets). Dispatches real CDP mouse events. A click that opens a new tab is reported in the response. The DOM diff (NEW/REMOVED/CHANGED) arrives with the next page action, or here with wait_for_diff: true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoViewport X in px; with y, not ref/selector
yNoViewport Y in px; use with x
refNoElement ref (preferred)
textNoVisible text (a11y name); no view_page needed, prefers interactive
selectorNoCSS selector (fallback)
wait_for_diffNoWait for the DOM diff before returning (default false, slower)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv2.10.5
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / ref / description
      Previous value: -"A11y-Tree element ref (e.g. 'e5') — preferred over selector"New value: +"Element ref (preferred)"
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector (e.g. '#submit-btn') — fallback when ref is not available"New value: +"CSS selector (fallback)"
    • changedInput schema / properties / text / description
      Previous value: -"Visible text to match (e.g. 'Submit'). Finds element by name in the A11y tree — no prior view_page needed. Prefers interactive elements (buttons, links)."New value: +"Visible text (a11y name); no view_page needed, prefers interactive"
    • changedInput schema / properties / wait_for_diff / description
      Previous value: -"When true, wait for the DOM diff synchronously before returning (slower but diff is in this response). Default: false — diff piggybacks on the next tool response."New value: +"Wait for the DOM diff before returning (default false, slower)"
    • changedInput schema / properties / x / description
      Previous value: -"X coordinate (viewport pixels) — for canvas or pixel-precise clicks. Use with y instead of ref/selector."New value: +"Viewport X in px; with y, not ref/selector"
    • changedInput schema / properties / y / description
      Previous value: -"Y coordinate (viewport pixels) — for canvas or pixel-precise clicks. Use with x instead of ref/selector."New value: +"Viewport Y in px; use with x"
  2. First observedv2.7.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden. It discloses multiple non-obvious traits: clicks dispatch 'real CDP mouse events' (not synthetic), new-tab openings are reported in the response, and the DOM diff arrives either with the next page action or immediately if wait_for_diff is true. This is substantial transparency, though it omits potential error conditions or permission requirements.

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?

The description is two sentences with no filler. The first sentence packs the core action and targeting modes, the second covers side effects and diff timing. It is appropriately dense and front-loaded with the main purpose, though the second sentence is long and could be split for even clearer scannability.

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 tool with no output schema and no annotations, the description covers the essential operational context: how to target, what events are dispatched, what happens on new-tab opens, and when DOM diffs appear. It does not describe the exact response payload for a normal click, but the mention of new-tab reporting partially addresses return behavior. Overall, an agent has enough to invoke it correctly in most scenarios.

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 coverage is 100%, so the baseline is 3. The description adds value beyond the schema by explaining that viewport x/y are for 'canvas, pixel-precise targets' and that the 'text' targeting mode 'prefers interactive' elements and requires no prior view_page call. This enrichment helps an agent choose the correct targeting parameter without opening the schema.

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 states a specific verb ('Click') and resource ('an element'), and enumerates four distinct targeting modes (ref, CSS selector, visible text, viewport x/y). It differentiates itself from siblings like 'drag' and 'press_key' by mentioning 'real CDP mouse events' and 'canvas, pixel-precise targets', leaving no ambiguity about what the tool does.

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 clearly implies when to use the tool – whenever a click action is needed – and gives targeting options, but it never explicitly names alternatives or states conditions for choosing click over a sibling like 'press_key' or 'drag'. It provides no when-not-to-use guidance, so usage is implied rather than explicit.

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