key
Press a key or key combination (e.g., 'return', 'cmd+a') on macOS. Optionally repeat the press multiple times.
Instructions
Press a key or key combination (e.g. "return", "escape", "cmd+a", "ctrl+shift+tab"). The frontmost application must be in the session allowlist at the time of this call, or this tool returns an error and does nothing. System-level combos (quit app, switch app, lock screen) require the systemKeyCombos grant — without it they return an error. All other combos work.
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": {
"text": "<text>"
},
"name": "key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Modifiers joined with "+", e.g. "cmd+shift+a". | |
| repeat | No | Number of times to repeat the key press. Default is 1. |