key_event
Send Android key events over ADB to press buttons like home, back, volume, power, or enter a numeric keycode. Use it to control device navigation and hardware keys.
Instructions
Send a key event. Names: home, back, call, endcall, up, down, left, right, center, volume_up, volume_down, power, camera, tab, enter, delete, menu, search, play_pause, mute, recents, app_switch, wakeup, sleep; or a numeric keycode
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_event"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| serial | No | Device serial (optional; defaults to first ADB_SERIAL entry or the only connected device) |