Skip to main content
Glama

press_key

Simulate hardware key presses on a connected Android device to control navigation, power, and volume. Send specific keys like home, back, or enter to automate device interactions.

Instructions

Press a hardware key: home, back, enter, menu, power, volume_up, volume_down, recent, wake, sleep, tab, delete, search, notifications. Raw KEYCODE_* names are also accepted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYes
deviceNoDevice serial from list_devices (omit when exactly one device is connected).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/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. 'Press' implies a state-changing input injection, but the description says nothing about whether a device connection is required, what happens on an unrecognized key, or whether keys like power/sleep are blocking or destructive. It only documents accepted input values, which is input semantics rather than behavior.

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 front-loaded sentence defining the action, followed by the necessary enumeration of valid values. The long value list is functional rather than padding, though a compactly formatted list would read more cleanly.

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 two-parameter input tool with no output schema and no annotations, the definition covers valid key values and links to list_devices via the schema. However, it omits error behavior for invalid keys and any indication of device-connection prerequisites, leaving gaps for an unannotated mutation-style tool.

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 50%: the device parameter is documented in the schema, but the key parameter has no schema description. The description compensates well by listing all accepted key names and noting that raw KEYCODE_* names are also accepted, which is real added meaning for the undocumented parameter.

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 ('Press a hardware key') and enumerates the accepted key names, so an agent immediately understands the operation. It does not explicitly contrast itself with sibling tools like tap or tap_text, which also inject input, so it stops short of a 5.

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?

Usage is implied by the enumerated key list (the agent can infer this is for device navigation keys rather than screen coordinates), but there is no explicit when-to-use statement nor any guidance on choosing this over tap/tap_text/shell. Minimum viable only.

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