Desktop mouse and keyboard
computer_actionControl the graphical desktop in the sandbox: move, click and drag the mouse, scroll, type text and press keys – a batch of up to 50 actions run in order, by default followed by a screenshot. Coordinates are screen pixels (0,0 = top left). Use it for apps that have no command line or API, e.g. a desktop program or a web page in a visible browser. Needs a sandbox created from the 'desktop' template; Desktop & Computer Use must be enabled for your account (paid plans, or after topping up at least US$15). Without sandbox_id the last sandbox of this conversation is used – these tools never create one. Refused while a person controls the desktop from the portal; try again later.
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": {
"actions": "<actions>"
},
"name": "computer_action"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actions | Yes | Actions in order, e.g. [{"type":"click","x":200,"y":120},{"type":"type","text":"hello"},{"type":"key","keys":"Return"}]. At most 50. | |
| max_width | No | Width limit of that screenshot in pixels (default 1280). | |
| sandbox_id | No | Sandbox ID (sb_…). If omitted, the current sandbox of this session is used. A sandbox_id you pass becomes the current sandbox for later calls without sandbox_id. | |
| screenshot | No | Return a screenshot after the actions (default true). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | All actions were done. | |
| error | No | Which action failed and why (only when ok is false). | |
| results | Yes | Result of each action that was run, in order. | |
| sandbox_id | Yes | Sandbox ID. | |
| screenshot | No | Size of the screenshot returned as an image after the actions. | |
| failed_index | No | Index of the failed action. |