Skip to main content
Glama

press_key

Sends Android key events such as back, home, enter, volume, and D-pad to a connected emulator or device via adb, with optional screen observation after the action.

Instructions

Press a key: back, home, enter, del, backspace, forward_del, tab, escape, app_switch, menu, search, power, wakeup, volume_up, volume_down, dpad_up, dpad_down, dpad_left, dpad_right, dpad_center, move_home, move_end, any KEYCODE_* name, or a key code number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
serialNoadb serial; optional when exactly one device is connected
observeNoWhat to return after the action: changes (default: only what changed since you last saw the screen, full tree on a new screen), ui (full tree), screenshot, both (tree + screenshot), nonechanges
settle_msNoWait before observing

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/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 lists valid key values but does not disclose side effects, device requirements, whether key presses are state-changing, or how observation behavior works beyond what the schema already says.

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?

The description is a single front-loaded sentence. The long enumeration is necessary for the key parameter, though it dominates the description and leaves no room for usage or behavioral context.

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 key-press tool with schema-documented optional parameters, the description covers the required key values adequately. However, with no annotations and no output schema, it should do more to explain usage context and behavioral effects.

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 coverage is 75%, and the key parameter has no schema description. The description compensates by enumerating accepted key strings and KEYCODE_* forms, which is meaningful input guidance beyond the schema. The remaining optional parameters are already described in the schema.

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 ('Press a key') and enumerates accepted key names, making the resource concrete. It does not explicitly distinguish itself from siblings like type_text or tap, but the hardware/navigation-key framing is clear.

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?

There is no guidance on when to use this tool versus tap, type_text, or other input tools. The list of valid keys implies hardware/navigation key usage, but no alternatives or exclusions are stated.

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