Skip to main content
Glama

click

Click elements using accessibility tree references, CSS selectors, text, or viewport coordinates. Dispatches real CDP mouse events and reports DOM changes automatically.

Instructions

Click an element by ref, CSS selector, or viewport coordinates. Dispatches real CDP mouse events (mouseMoved/mousePressed/mouseReleased). For canvas or pixel-precise targets, use x+y coordinates instead of ref. If the click opens a new tab, the response reports it automatically. The response already includes the DOM diff (NEW/REMOVED/CHANGED lines) — inspect those changes for success/failure signals instead of following up with evaluate to re-check state. If click fails with a stale-ref error, call view_page for fresh refs and retry. Avoid evaluate(querySelector + .click()) as default recovery — it bypasses the CDP pointer chain and hides real bugs. (Legitimate exception: explicitly testing synthetic JS event plumbing.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoA11y-Tree element ref (e.g. 'e5') — preferred over selector
selectorNoCSS selector (e.g. '#submit-btn') — fallback when ref is not available
textNoVisible text to match (e.g. 'Submit'). Finds element by name in the A11y tree — no prior view_page needed. Prefers interactive elements (buttons, links).
xNoX coordinate (viewport pixels) — for canvas or pixel-precise clicks. Use with y instead of ref/selector.
yNoY coordinate (viewport pixels) — for canvas or pixel-precise clicks. Use with x instead of ref/selector.
wait_for_diffNoWhen 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.
Behavior5/5

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

Discloses that it dispatches real CDP mouse events, reports new tabs automatically, includes DOM diff in response, and explains error recovery. No annotations so description carries full burden, and it does so thoroughly.

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?

Concise yet comprehensive; every sentence adds value. Front-loaded with main purpose, then behavioral details, then recovery guidance. No redundancy.

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

Completeness5/5

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

Covers all aspects: parameters, usage modes, response contents (DOM diff, new tab detection), error recovery, and anti-patterns. Complete for a click tool with no output schema.

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

Parameters5/5

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

Each parameter has a clear description in the schema (100% coverage), and the description adds extra context: ref vs selector priority, text targeting without view_page, x+y for canvas, and wait_for_diff behavior.

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?

Clearly states the action (click) and resources (element by ref, CSS selector, or coordinates). Distinguishes from siblings by specifying use cases for different target types.

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

Usage Guidelines5/5

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

Provides explicit guidance: use coordinates for canvas, recover from stale ref by calling view_page, avoid using evaluate click as default recovery. Also highlights when to use text-based targeting without prior view_page.

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/Silbercue/public-browser'

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