window_action
Perform clicks, typing, scrolling, dragging, and element actions on macOS windows and apps, including background operations that do not move the user's cursor.
Instructions
Perform an action on a macOS window or app (click, hover, move, set_value, type_text, press_key, paste with automatic clipboard restore, scroll, drag, select_text, perform_secondary_action) with smooth 60fps virtual cursor feedback. Element-index actions operate in the background without moving the user's physical cursor.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "window_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Window-relative X coordinate (matches 1:1 window screenshot & AX @(x,y)). | |
| y | No | Window-relative Y coordinate (matches 1:1 window screenshot & AX @(x,y)). | |
| app | No | Target app name or bundle ID. | |
| key | No | Key or chord (e.g. 'Return', 'cmd+s', 'ctrl+shift+p') for press_key or modified click. | |
| text | No | Text for type_text, paste, or select_text. | |
| to_x | No | Drag end window-relative X. | |
| to_y | No | Drag end window-relative Y. | |
| badge | No | Optional custom pill label next to the virtual cursor. | |
| pages | No | Scroll distance in pages (default 1). | |
| value | No | Value string for set_value. | |
| action | Yes | ||
| format | No | Paste format (default 'text'). | |
| from_x | No | Drag start window-relative X. | |
| from_y | No | Drag start window-relative Y. | |
| prefix | No | Disambiguating prefix for select_text. | |
| ripple | No | Emit click-style ripple ring on hover/move (default false). | |
| suffix | No | Disambiguating suffix for select_text. | |
| direction | No | Scroll direction. | |
| window_id | No | Target window ID. | |
| click_count | No | ||
| duration_ms | No | Hold duration in milliseconds. | |
| show_cursor | No | Animate the per-window virtual cursor & highlight overlay for this action (default true). | |
| mouse_button | No | ||
| return_state | No | Automatically return updated AX state diff after action (default true). | |
| window_title | No | Optional window title substring. | |
| element_index | No | Element index [N] from get_window_state (preferred). | |
| include_cursor | No | Include virtual cursor overlay in returned screenshot (default false). | |
| selection_type | No | ||
| activate_window | No | Activate target window before coordinate HID events (default false). | |
| coordinate_only | No | Force pure CGEvent coordinate dispatch on (x, y) click without Accessibility hit-test fallback (default false). | |
| secondary_action | No | AX action name (e.g. 'ShowMenu', 'Increment', 'Decrement', 'Expand', 'Collapse'). | |
| to_element_index | No | Optional drag destination element index [N]. | |
| from_element_index | No | Optional drag start element index [N]. | |
| global_coordinates | No | Interpret (x, y) / drag / scroll coordinates as global screen points instead of window-relative points (default false). | |
| include_screenshot | No | Include updated window screenshot (default false). | |
| dispatch_move_event | No | For hover/move, post a background mouseMoved event to the app PID (default true). |