Press a key
key_pressPress any keyboard key, including return, tab, escape, arrows, or characters, with optional command, option, control, or shift modifiers to trigger actions and shortcuts in macOS.
Instructions
Press a key (e.g. return, tab, escape, arrows, or a character) with optional modifiers (command/option/control/shift). Requires admin mode AND MACCTL_ALLOW_INPUT=true.
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": {
"key": "<key>"
},
"name": "key_press"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key name (return, tab, escape, up…) or a single character. | |
| modifiers | No | Modifier keys to hold. |