macos_keyboard_press
Press a single named key or modifier shortcut on macOS, such as Enter, Tab, arrows, F1-F12, Cmd+S, or Cmd+Shift+P. Use it for non-text key actions and keyboard shortcuts.
Instructions
macOS only. Press a single named key, optionally as a shortcut chord with modifiers. Use for keys that are not text (Enter, Tab, Escape, arrows, function keys) and for shortcuts like Cmd+S or Cmd+Shift+P. To type words or symbols, use macos_keyboard_type instead. Requires Accessibility permission.
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": "macos_keyboard_press"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The key to press by name: Enter, Escape, Tab, Space, Backspace, Delete, ArrowUp/Down/Left/Right, Home, End, PageUp, PageDown, F1-F12, a letter (A-Z), or a digit (0-9). | |
| modifiers | No | Modifiers held around the key to form a shortcut: Control (ctrl), Shift, Alt (option), Meta (cmd/command). Example: key "S" with modifiers ["Meta"] is Cmd+S. On macOS, Meta is Command. |