Skip to main content
Glama

click_element

Click a GUI element by accessible name, waiting for it to appear, or click a point by x/y. It can hold a button and gives the clicked window keyboard focus.

Instructions

Click an element by its accessible name, or a point by x and y, on the screen or inside a window. By name is the one to use: it waits up to timeout seconds for the node, raises its window and clicks its middle, and the answer gives the node and its bounds. When two nodes match it lists them, with where they are; when none does, the nearest names. A click gives a window the keyboard, which nothing else does on X11. hold and state, by x and y, hold the button as press_keys holds keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoPixels from the left
yNoPixels from the top
holdNoSeconds to keep it down before letting go
nameNoA node's name, as get_accessible_tree gives it: exactly, or a regex matched in full
roleNoNarrows name: exactly, or a regex
stateNoOnly press, leaving it down until a call with up; or only let go
buttonNo1 left, 2 middle, 3 right
doubleNoClick twice, as a double click
windowNoA window's title, exactly or a regex matched in full, or app=RE for its app id
sessionYesIts name, from start_session
timeoutNoBy name, seconds to wait for the node (10)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.1

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and destructiveHint=false; the description supplies the real behavioral picture: it waits up to timeout for the node, raises its window before clicking, and the click transfers keyboard focus on X11 — a side effect nothing else in the toolset performs. It also discloses ambiguity handling (lists multiple matches with locations, returns nearest names on failure) and the expected response payload.

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?

Front-loaded with the primary mode and the recommendation, and no sentence is padding. The telegraphic phrasing at the end ("hold and state, by x and y, hold the button as press_keys holds keys") is compact but slightly elliptical, costing a bit of readability.

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 11 parameters, no output schema, and only sparse annotations, the description does the heavy lifting: it explains target resolution, waiting, window raising, focus side effect, ambiguity and failure behavior, and the return payload. It omits any permission/prerequisite notes or visibility requirements, but the essentials for correct invocation are present.

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 prose adds meaning the schema does not: hold and state are stated to apply with x and y (a mode coupling the schema never expresses), and hold is tied to press_keys semantics. That genuine cross-parameter clarification lifts it above baseline.

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?

States a specific verb (click) plus two concrete targeting modes (accessible name, or x/y point) with screen/window scope. It is trivially distinguishable from siblings like type_text, scroll_wheel, and press_keys, and even explains its relationship to press_keys.

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?

"By name is the one to use" explicitly steers the agent to the preferred mode and implicitly relegates the x/y path (with hold/state) to a secondary case. It stops short of naming when to prefer sibling tools such as type_text for focusing a field, so alternative-tool guidance is partial rather than complete.

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