Skip to main content
Glama

press_key

Press Android hardware or navigation keys by name or keycode to submit forms, dismiss keyboards, navigate back, and control power or volume. Verify UI changes to detect silently consumed presses.

Instructions

Press a hardware/navigation key by name (enter, back, home, menu, tab, del, escape, up, down, left, right, dpad_center, app_switch, search, power, wakeup, sleep, volume_up, volume_down, ...) or a raw Android keycode number. Handy to submit a form (enter), dismiss the keyboard (escape), or go back (back). To turn the screen ON use wakeup (not power, which toggles and may sleep an awake screen); sleep turns it off. A key can be silently consumed with no effect (e.g. back while a biometric prompt is up) — pass verify_change=true to get ui_changed: true/false instead of guessing. Batching several presses (or a press whose timing matters relative to other actions) belongs in run_sequence, not in separate calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesKey name (enter, back, home, menu, tab, del, escape, up, down, left, right, ...) or a raw keycode number.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
verify_changeNoAlso report whether the UI hierarchy changed after the key press (ui_changed: true/false). Costs two extra hierarchy reads (~2-3s); use when the key may be silently consumed (e.g. back while a biometric prompt is up).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden. It discloses that a key press can be silently consumed with no effect (e.g., back during a biometric prompt), that power toggles rather than simply turning on, and that verify_change adds two extra hierarchy reads. These are non-obvious behaviors an agent needs to know.

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 dense but well-organized: core action first, then examples, then caveats, then batching guidance. Every sentence contributes useful information, and there is no redundant repetition of the schema.

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

Completeness4/5

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

It covers key names, behavioral caveats, alternative routing, and the verify_change option thoroughly. The only gap is that, with no output schema, the normal return value/immediate result of a press is not described, though verify_change's return is. This is minor relative to the tool's simplicity.

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 value by enumerating common key names, explaining wakeup vs power semantics, and clarifying the cost and purpose of verify_change. It does not add much about serial, but the schema already explains that clearly.

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 uses a specific verb ('press') with a precise resource ('hardware/navigation key' or 'raw Android keycode number') and gives concrete examples. It also distinguishes itself from related tools by explicitly pointing to run_sequence for batched actions and contrasting wakeup vs power.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides direct when-to-use guidance: submit a form with enter, dismiss keyboard with escape, go back with back. It explicitly warns that power toggles and may sleep an awake screen, recommending wakeup instead, and says time-sensitive or batched presses belong in run_sequence, not separate calls.

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