press_key
Press hardware, navigation, or raw Android keys on mobile devices, with optional repeat for multiple presses in one call.
Instructions
Press a hardware or navigation key, or send a raw Android keycode. Supports repeat for multiple presses in one call.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Key to press. Either key or keycode must be provided. | |
| repeat | No | Press the key this many times (e.g. delete x10). Default: 1 | |
| keycode | No | Android keycode number (0-999). Use for keys not in the named list. See https://developer.android.com/reference/android/view/KeyEvent. Ignored on iOS. | |
| observe | No | Capture screen state after the action. "on_change" returns the first tree that differs — catches a toast a fixed delay would miss. Default: none | |
| platform | No | Target platform. Inferred if omitted. | |
| device_id | No | Device ID. Omit for the connected device. | |
| observe_delay_ms | No | Ms to wait before observing. Default: 500 | |
| observe_stabilize | No | Wait for the UI to settle instead of a fixed delay. Default: false |