Skip to main content
Glama

press_key

Press a hardware or navigation key (enter, back, home, etc.) or raw keycode to trigger system actions like form submission, keyboard dismissal, or screen on/off. Optionally detect UI change.

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.

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).
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that keys can be silently consumed (e.g., back during biometric prompt) and recommends verify_change=true to detect UI changes. It also explains the difference between wakeup and power. This is good but could mention error handling for invalid keys.

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 compact and efficient: four sentences, no filler. It starts with the main action, lists examples, and then provides critical behavioral caveats. Every sentence adds value.

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?

Given the tool's simplicity (3 params, no output schema, no annotations), the description is fairly complete. It covers the keypress action, silent consumption, and the verify_change option. Missing details on return behavior (beyond ui_changed) and error handling, but overall adequate for an agent to use correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so baseline is 3. The description adds value by listing example key names and explaining the wakeup/power nuance, but for 'serial' and 'verify_change', it mostly reinforces the schema. The added context is helpful but not transformative.

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 clearly states the tool's purpose: 'Press a hardware/navigation key by name... or a raw Android keycode number.' It provides a list of examples and distinguishes from sibling tools like input_key_combo, input_text, tap, and long_press by focusing on single key presses.

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

Usage Guidelines4/5

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

The description includes practical usage scenarios: 'Handy to submit a form (enter), dismiss the keyboard (escape), or go back (back).' It also advises on wakeup vs power, but does not explicitly compare to alternatives like input_key_combo or input_text, leaving some room for ambiguity.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iksnerd/adb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server