Skip to main content
Glama

key_event

Send key events to an Android device, such as HOME, BACK, or VOLUME_UP, using keycode names or numeric values.

Instructions

Send a key event to the device. Supports keycodes like HOME, BACK, ENTER, VOLUME_UP, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keycodeYesKeycode name (e.g., 'HOME', 'BACK') or numeric value
serialNoDevice serial number
Behavior2/5

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

Beyond stating it sends a key event, the description provides no behavioral details such as whether it is synchronous, how the device responds to invalid keycodes, or side effects (e.g., waking the device). With no annotations, more transparency is needed.

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 extremely concise (two sentences) with no redundant information. It front-loads the action and immediately provides useful examples, wasting no words.

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?

For a simple tool, the description covers the basics (action and keycode examples) but lacks details on error behavior, device connectivity, or when to use it over sibling tools. With no output schema, the agent is left guessing about the result of the operation.

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

Parameters4/5

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

The description adds value by listing example keycode names (HOME, BACK, ENTER) which supplement the schema's broad type definition. However, it does not mention the optional 'serial' parameter, leaving its purpose implicit.

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

Purpose4/5

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

The description clearly states the action ('Send a key event to the device') and provides examples of supported keycodes, making the purpose specific and discernible from siblings like tap or swipe. However, it does not explicitly differentiate it from similar tools.

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

Usage Guidelines2/5

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

No guidance is given on when to use this tool versus alternatives (e.g., shell_exec, tap). The description does not mention prerequisites, device state requirements, or scenarios where key_event is preferred over other input methods.

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/JuanCF/scrcpy-mcp'

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