Click tool
Click by element or pixel.
Click by element or pixel.
Served by cua-driver mcp; see MCP tools for every tool.
click#Effect: destructive. Platforms: macOS, Linux, Windows.
Click a target pid. Prefer element_token (from get_window_state): it identifies one snapshot element, works on backgrounded, minimized or off-Space windows, and moves no cursor or focus. Use x, y only for canvas / video / WebGL / custom-drawn surfaces missing from the AX tree.
modifier takes cmd/shift/option/ctrl.button defaults to left; on the AX path "right" maps to AXShowMenu and "middle" falls back to a pixel click at the element center. action: press (default), show_menu, pick, confirm, cancel, open. from_zoom:true translates zoom-image pixels after a zoom call. Pressing a popup button opens its menu and leaves it open (holding key focus) until dismissed; to choose an option use set_value.
macOS parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
action | string | AX action. | |
button | "left" | "right" | "middle" | Mouse button. Default left. | |
capture_id | string | Optional capture ID from get_window_state or get_desktop_state. With x,y it is consumed atomically; stale or mismatched captures are refused. | |
count | integer | Click count (pixel path only). Default 1. | |
debug_image_out | string | Write a screenshot with a crosshair at (x, y) to this path. Needs window_id; not with from_zoom. | |
delivery_mode | "background" | "foreground" | Default "background" (no fronting). "foreground" briefly fronts the window, acts, then restores the prior app; needs window_id and is required for modified clicks. Escalate in order: AX element_token, background pixel, foreground, checking state between rungs; a click has no read-back except list-row selection. | |
from_zoom | boolean | x and y are in the last zoom image for this pid. | |
modifier | string[] | Modifier keys: cmd, shift, option/alt, ctrl. | |
pid | integer | Target process ID. Optional with element_token (it carries the pid). | |
scope | "window" | "desktop" | Default "window". "desktop": x,y with no pid/window_id are true screen pixels from get_desktop_state. | |
session | string | For multi-call work, prefer a short public session label and repeat it on every call that accepts it. | |
window_id | integer | Target window ID. Omit with element_token. | |
x | number | X in screenshot pixels (get_window_state PNG, or get_desktop_state PNG for a desktop target). | |
y | number | Y in screenshot pixels from the image selected by target. |
Parameters on every platform
| Parameter | Type | Default | Description |
|---|---|---|---|
element_token | string | Element handle <snapshot_id>:<row> from get_window_state: row [11] of a read whose snapshot_id is s0000002a is "s0000002a:11" (also in structuredContent.elements[].element_token). Returns an explicit stale error naming the current snapshots once a newer read supersedes it. | |
target | window target | desktop target | Exact capture/input target selected independently for each action. display_id="primary" is the portable desktop target in this release. Platforms that cannot address another display reject it explicitly rather than silently changing coordinate spaces. |