Skip to main content
Glama

key_event

Sends hardware key events, such as home, back, enter, volume, or raw keycodes, to an Android device via ADB for navigation and control.

Instructions

Send a hardware key: home, back, recent, enter, delete, wakeup, sleep, volume_up/down, power, tab, space, escape, or a raw keycode number.

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

NameRequiredDescriptionDefault
keyYesNamed key or numeric keycode

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It implies a device input action but does not disclose side effects, target context, failure behavior, or whether it affects only the foreground app.

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

Conciseness4/5

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

It is a single front-loaded sentence with no filler. The key list is somewhat redundant with the enum, but it remains readable and purposeful.

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 one-parameter input tool, the definition is minimally adequate: it says what is sent and what values exist. However, without annotations or output schema, it should say more about device targeting and behavioral effects.

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 coverage is 100%, so the enum already defines valid values and the schema note explains named keys versus numeric keycodes. The description adds little beyond restating examples, though it does mention raw keycode numbers in prose.

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 states a specific verb and resource: send a hardware key. It names named key options and raw keycodes, making the action clear and distinguishable from text input or gesture 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?

It explains what can be sent but gives no guidance on when to use this tool versus input_text, long_press, or other input methods. It also omits prerequisites such as whether a device must already be selected.

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