Skip to main content
Glama

android_keyevent

Send Android key events such as HOME, BACK, ENTER, APP_SWITCH, or POWER to control a connected device and drive DroidPath automation workflows without screenshot loops.

Instructions

Sends an Android keyevent (e.g. HOME, BACK, ENTER, APP_SWITCH, POWER).

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": {
      "keycode": "<keycode>"
    },
    "name": "android_keyevent"
  }
}

Input Schema

NameRequiredDescriptionDefault
keycodeYesKey name or integer keycode.
device_serialNoOptional ADB device serial. Defaults to the first connected device.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/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 burden of behavioral disclosure. It says a keyevent is sent but does not explain device targeting behavior beyond the schema, what the response looks like, whether the operation waits for completion, or any side effects of keys like POWER or BACK.

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, front-loaded sentence with no filler. It states the action and immediately provides illustrative key names.

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?

This is a simple two-parameter tool with fully documented input schema fields, so the description does not need to repeat parameter details. Still, with no annotations or output schema, it should say more about execution behavior, device selection failure modes, or return semantics to be fully complete.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds useful meaning by listing example key names, which helps the agent understand the expected keycode values beyond the schema's minimal 'Key name or integer keycode' description.

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 states a specific verb and resource: 'Sends an Android keyevent,' and gives concrete key examples such as HOME, BACK, ENTER, APP_SWITCH, and POWER. This clearly distinguishes the tool from sibling tap, swipe, and text-entry tools, though it does not explicitly name or contrast an alternative.

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 key examples imply when the tool is appropriate, such as triggering navigation or power controls without tapping a UI element. However, it gives no explicit guidance on when to use this instead of sibling UI interaction tools or when not to use it.

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