Skip to main content
Glama
Mobile Device Farm MCP

Mobile Device Farm MCP

adb_key_event

Send key events such as HOME, BACK, or ENTER to an Android device to navigate menus, dismiss screens, or trigger actions during automated testing.

Instructions

Send a key event (e.g., HOME, BACK, ENTER) to the device.

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": "adb_key_event"
  }
}

Input Schema

NameRequiredDescriptionDefault
keycodeYesKey code or name (e.g., KEYCODE_HOME, 3, BACK, ENTER)
deviceIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden and falls short. It does not state that the call mutates device state (an irreversible key dispatch), whether the device must be connected/unlocked, whether it waits or returns immediately, or what happens when the deviceId is omitted and multiple devices are attached.

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?

A single short sentence that is front-loaded with the action and ends with the target resource. There is no filler, though it could have used the remaining space to cover deviceId behavior rather than restating keycode examples.

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

Completeness2/5

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

For a state-changing device tool with no annotations, no output schema, and an undocumented optional deviceId, the definition leaves too much unspecified. An agent cannot determine multi-device behavior, success/failure signaling, or prerequisites before calling it.

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

Parameters2/5

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

Schema coverage is only 50%: the keycode parameter is documented in the schema and the description merely repeats the same examples. The deviceId parameter has no description anywhere, so the description does not compensate for the coverage gap by explaining default device selection or what form the ID takes.

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?

States a specific verb and resource ('Send a key event ... to the device') and gives concrete examples (HOME, BACK, ENTER) that make the action unambiguous. It does not explicitly distinguish itself from siblings like adb_input_text or adb_tap, so the agent must infer that this tool is for discrete hardware/navigation keys rather than text or coordinate taps.

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?

The description provides no when-to-use or when-not-to-use guidance and names no alternatives. The only implicit signal is the example key names, leaving the agent to guess how this differs from adb_input_text for typing or adb_tap for pressing on-screen targets.

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