Skip to main content
Glama

send_keyevent

Simulate Android hardware keys like Back, Home, and Power on connected devices. Send keyevent codes to control navigation and system functions.

Instructions

Send a keyevent (hardware/system key simulation) to the device (e.g. BACK=4, HOME=3, POWER=26, APP_SWITCH=187).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serialNoSpecific device serial number
keycodeYesThe Android keyevent integer code (e.g., Back=4, Home=3, Power=26, Tab=61, Enter=66)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'hardware/system key simulation' but does not explain potential side effects (e.g., POWER key affects device state, APP_SWITCH may trigger system UI) or error behavior when the device is not connected or the keycode is invalid. This is a significant gap for an input simulation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loaded with the core action and supported by relevant examples. Every word contributes to understanding, with no unnecessary detail or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 params, no output schema) and full schema documentation, the description is adequate for the essential purpose. However, it lacks guidance on device selection (serial) and failure modes, making it minimally complete but not thorough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The tool description adds extra keycode examples (APP_SWITCH=187) beyond the schema's examples, clarifying the range of accepted keys. However, it does not add meaning beyond the schema for serial or keycode semantics, relying heavily on the schema's own descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Send a keyevent (hardware/system key simulation) to the device' with concrete examples (BACK=4, HOME=3, POWER=26). This distinguishes it from sibling input tools like tap_screen, swipe_screen, and type_text, which handle different input types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for hardware/system key events via examples, but it does not explicitly state when to use this tool vs alternatives (e.g., execute_shell_command could send key events via adb shell). There is no mention of when not to use it or which sibling tools are preferred for other input types.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/abhinav7895/adb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server