Skip to main content
Glama

Ui Click

ui_click

Clicks an element (by element_ref, at its center) or a screen coordinate (by coords). button left|right, count 2 = double-click. Returns {clicked, at:{x,y}} — clicked means the click event was POSTED at those coordinates, NOT that the app acted on it: CGEvent carries no delivery confirmation, so a busy, modal or input-ignoring app reports exactly the same success. Confirm the effect with ui_wait_for_element or ui_read_tree rather than trusting clicked. element_disabled is returned ONLY when the app actually publishes AXEnabled=false; a control that does not publish AXEnabled at all is treated as unknown and clicked. Requires Accessibility permission.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNoDefault element if element_ref given, else coords.
countNo1 (default) or 2 for double-click.
buttonNoDefault left.
coordsNo{x,y} in global screen points.
element_refNoElement handle returned by ui_find_element or ui_read_tree; the click lands at that element's center. Needed when by=element, which is the default whenever element_ref is present.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / element_ref / description
      Added value: +"Element handle returned by ui_find_element or ui_read_tree; the click lands at that element's center. Needed when by=element, which is the default whenever element_ref is present."
  2. Changed1 schema field changed
    • removedInput schema / properties / element_ref / description
      Removed value: -"Element handle returned by ui_find_element or ui_read_tree; the click lands at that element's center. Needed when by=element, which is the default whenever element_ref is present."
  3. Changed1 schema field changed
    • addedInput schema / properties / element_ref / description
      Added value: +"Element handle returned by ui_find_element or ui_read_tree; the click lands at that element's center. Needed when by=element, which is the default whenever element_ref is present."
  4. Added

TDQS

A4.3/5.0
Behavior5/5

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

The description goes far beyond the annotations (which only mark non-readOnly and non-destructive). It reveals the critical limitation that 'clicked' only means the event was posted, not that the app acted, and explains the CGEvent delivery mechanism. It also clarifies the behavior of element_disabled when AXEnabled is not published. This is rich, honest behavioral disclosure that prevents misinterpretation.

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 moderately long but every sentence earns its place. The core functionality is front-loaded, followed by crucial caveats about the return value and permission requirements. It avoids redundancy and keeps the most important operational details prominent. Slightly verbose but justified by the pitfalls it explains.

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?

Given the absence of an output schema, the description fully explains the return value ({clicked, at}) and its interpretation, including the element_disabled edge case. It also states the Accessibility permission requirement. Missing are details about behavior when element_ref is invalid or not found, but the essential information for an agent to call this correctly is present. The complexity is moderate, and the description covers it well.

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%, but the description adds meaningful details: it specifies that clicks land at the element's center, that coords are in global screen points, and clarifies the default behavior when element_ref is present. It also explains the count semantics (2 = double-click) and button options beyond just the schema's enum labels. This adds value over 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 clearly states the action ('clicks') and the two possible targets: an element (by element_ref) or screen coordinates (by coords). It also specifies the click button and count variants. This distinguishes it from sibling tools like ui_keystroke (types) and ui_wait_for_element (waits), making the purpose unambiguous.

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 implies usage by explaining how to click elements or coordinates, but it does not explicitly state when to choose this tool over alternatives (e.g., ui_menu_bar_click for menu items or web_click for web elements). It does provide useful follow-up guidance on verifying the effect with ui_wait_for_element or ui_read_tree, but lacks direct when-to-use vs. when-not-to-use guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources