Skip to main content
Glama

Click

click
Destructive

Activates a UI element by element ID or screen coordinates, performing real app actions and optionally returning updated state for verification.

Instructions

Click an element by element_id (preferred: it uses the accessibility press action, so it works even when the element is scrolled out of view) or at absolute screen coordinates taken from a screenshot or zoom. Pass element_id or x and y, not both. When element_id is clicked by position (web content, or no press action), the point is checked with the app's own hit test first, and the element is scrolled into view if needed; if something else is there the call fails without clicking. A checkbox or radio button says what it is now, and a click that left it unchanged is reported as an error. Use browser_click for pages in the agent's Chrome tabs, right_click for context menus, and drag for press-move-release. The click reaches the target app for real and can trigger any action the user could, so read the target with get_app_state first. The agent's own pointer overlay moves to the target. On macOS the user's mouse pointer never moves; on Windows and Linux a target that ignores background input gets real mouse input, which moves the user's pointer, and the result then says via cursor.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "click"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoScreen x coordinate in points, used together with y when no element_id is given
yNoScreen y coordinate in points, used together with x when no element_id is given
element_idNoElement id from the most recent get_app_state snapshot, e.g. e12. Preferred over coordinates.
click_countNo1 for a single click (default), 2 for a double-click
state_queryNoWith return_state, list only elements whose role, label or value contains this text, like get_app_state's query
return_stateNoAfter acting, wait for the app to finish reacting (up to 2 s) and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.1
    • changedInput schema / properties / return_state / description
      Previous value: -"After acting, wait briefly for the UI to settle and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id."New value: +"After acting, wait for the app to finish reacting (up to 2 s) and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id."
  2. Changed2 schema fields changedv0.5.2
    • addedInput schema / properties / return_state
      Added value: +{
      +  "description": "After acting, wait briefly for the UI to settle and append a fresh get_app_state of the app you last read, so you can check the result and pick the next target in the same call. Its ids replace every earlier id.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / state_query
      Added value: +{
      +  "description": "With return_state, list only elements whose role, label or value contains this text, like get_app_state's query",
      +  "type": "string"
      +}
  3. Changed4 schema fields changedv0.3.1
    • changedInput schema / properties / click_count / description
      Previous value: -"1 for single, 2 for double-click"New value: +"1 for a single click (default), 2 for a double-click"
    • changedInput schema / properties / element_id / description
      Previous value: -"Element id from get_app_state, e.g. e12"New value: +"Element id from the most recent get_app_state snapshot, e.g. e12. Preferred over coordinates."
    • addedInput schema / properties / x / description
      Added value: +"Screen x coordinate in points, used together with y when no element_id is given"
    • addedInput schema / properties / y / description
      Added value: +"Screen y coordinate in points, used together with x when no element_id is given"
  4. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations (which only declare destructive/not-idempotent/non-readonly), it discloses the accessibility press mechanism, the position-based fallback with the app's own hit test, scroll-into-view, that a blocked hit fails without clicking, that unchanged checkbox/radio state is reported as an error, and that macOS never moves the user's pointer while Windows/Linux may (signalled by 'via cursor' in the result). This is substantive behavior an agent cannot infer from the structured fields.

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?

It is a single dense paragraph with the preferred targeting path front-loaded, and nearly every clause carries operational information. It is long and slightly run-on across several concerns (targeting, failure modes, platform pointer behavior), which keeps it from a 5.

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?

With no output schema, the description still describes what comes back: state appended when return_state is used, ids being replaced, errors on blocked hit tests or unchanged toggles, and the 'via cursor' marker on Windows/Linux. For a destructive, real-input tool this covers everything an agent needs before invoking it.

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, but the description adds real meaning: why element_id is preferred (works when scrolled out of view), the mutual exclusion of element_id vs x/y, and the failure semantics of positional clicking. click_count, state_query, and return_state are left entirely to the schema, keeping it just short of a 5.

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 opens with a specific verb and resource ('Click an element by element_id ... or at absolute screen coordinates'), immediately stating both targeting modes and the preferred one. It is clearly distinguishable from siblings like right_click, drag, and browser_click, which are explicitly named.

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?

It gives explicit routing rules: 'Use browser_click for pages in the agent's Chrome tabs, right_click for context menus, and drag for press-move-release', plus the constraint 'Pass element_id or x and y, not both' and the prerequisite 'read the target with get_app_state first'. Both when-to-use and when-to-use-alternatives are covered.

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