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, show_alternate_ui, show_default_ui; an element listing showalternateui reveals its hover-only controls with show_alternate_ui, in the background and without the pointer. from_zoom:true translates zoom-image pixels after a zoom call. Pressing a popup button opens its menu and leaves it open until an item is chosen or it is dismissed; in the background the user's front window keeps key focus meanwhile. To choose an option in one call use set_value.
macOS parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
action | string | AX action: press (default), show_menu, pick, confirm, cancel, open, show_alternate_ui, show_default_ui. show_alternate_ui reveals hover-only controls on an element that lists it, without the pointer. | |
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 | object | Exact window (kind "window", with pid and window_id) or desktop (kind "desktop", with display_id). "primary" is the portable desktop target. | |
target.display_id | string | Display id. Required when kind is desktop; use "primary". | |
target.kind | "window" | "desktop" | window requires pid and window_id; desktop requires display_id. | |
target.pid | integer | Process id. Required when kind is window. Minimum: 0. | |
target.window_id | integer | Window id from list_windows. Required when kind is window. Minimum: 0. |