computer
Use raw keyboard and mouse actions to click, type, scroll, drag, press keys, and capture screenshots when named accessibility targets are unavailable.
Instructions
Raw keyboard and mouse: type, keys, scroll, drag. To click a button, field or menu use accessibility invoke or smart_click, not this tool; click x,y and screenshot are the last resort, for a target with no name and no visible text. Pick an action: click, double_click, right_click, middle_click, triple_click, hover, move, mouse_move, move_relative, scroll, scroll_horizontal, drag, drag_path, mouse_down, mouse_up, type, key, key_press, key_down, key_up, wait, screenshot, screenshot_region, zoom. Coordinates default to image-space pixels of the latest screenshot; pass space:"screen" for a position reported by accessibility or ocr.
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": "computer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X position. From a screenshot: as read off the image. From accessibility or ocr: pass space:"screen". | |
| y | No | Y position. From a screenshot: as read off the image. From accessibility or ocr: pass space:"screen". | |
| dx | No | X offset in image-space pixels | |
| dy | No | Y offset in image-space pixels | |
| key | No | Alias for combo: the key or chord to press. | |
| endX | No | End X in image-space | |
| endY | No | End Y in image-space | |
| path | No | Array of {"x":n,"y":n} points (same space as x,y). click: clicks each point in turn (pen points: one call), interval_ms apart. drag_path: drags through them, min 2. | |
| shot | No | Optional, image-space pointer actions: the id of the screenshot the coordinates were read off (each screenshot reply names it, e.g. "s3"). Refused when it is not the latest screenshot. | |
| text | No | The text to type | |
| combo | No | Key/combo to press (e.g. "Return", "mod+s"). Space-separate for a sequence. | |
| count | No | 1=single (default), 2=double, 3=triple | |
| space | No | Coordinate space. Omit (default) → image-space coords from the latest screenshot (the tool scales them to the screen). Pass "screen" → the positions an accessibility tree / find reports (@x,y), passed as reported, unscaled: physical pixels on Windows and Linux, POINTS on macOS (a Retina screenshot's "real" size is twice the point size). | |
| width | No | Width in image-space pixels | |
| action | Yes | Which sub-action to perform. See this tool's description for the enum of valid values. Required: double_click/right_click/middle_click/triple_click/hover/move/mouse_move: x, y; move_relative: dx, dy; scroll: direction; scroll_horizontal: x, y, direction; drag_path: path; type: text; key_down/key_up: combo; wait: seconds; screenshot_region/zoom: x, y, width, height. | |
| amount | No | Wheel ticks (default 3) | |
| button | No | Mouse button: "left" (default), "right" or "middle". | |
| expect | No | Checks run after the action; a failed check returns DEVIATION. Example: [{"type":"window_title_contains","value":"Inbox"}]. Fields: value for *_contains; name for app_running and element_exists; name+value for element_value_contains; path for file_*. State an outcome you can observe, not the text you typed. | |
| height | No | Height in image-space pixels | |
| repeat | No | Press it this many times (default 1). | |
| startX | No | Start X in image-space | |
| startY | No | Start Y in image-space | |
| display | No | Monitor to capture (index from window list_displays). Default: the monitor clawdcursor last worked on, else the primary. | |
| seconds | No | Duration to wait (0.1 to 30) | |
| max_edge | No | Longest edge of the returned image in px (64–1280, default 1280). Smaller costs fewer image tokens; small text may become unreadable. | |
| direction | No | Scroll direction | |
| interval_ms | No | With path: milliseconds between clicks (default 100, max 5000). |