Skip to main content
Glama

Press Key

press_key

Press hardware or system keys on a mobile device using friendly names like 'home', 'back', 'volume_up', or raw Android keycodes. Triggers device actions for automation and testing.

Instructions

Press a hardware or system key on the device. Accepts friendly key names such as 'home', 'back', 'enter', 'volume_up', 'volume_down', 'power', 'tab', 'delete', 'menu', 'search', 'app_switch', 'dpad_up', 'dpad_down', 'dpad_left', 'dpad_right', 'camera', 'escape', 'space', 'media_play_pause', 'media_next', 'media_previous'. You may also pass a raw Android keycode number as a string (e.g. '3' for HOME).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYesDevice serial ID
keyYesAndroid keycode name like 'home', 'back', 'enter', 'volume_up', 'power', 'tab', 'delete', 'menu', or a numeric keycode
Behavior4/5

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

Description accurately describes pressing a key, listing many specific keys. No annotations exist, so description carries full burden. Provides good detail without contradiction.

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?

Two sentences: first states purpose, second lists accepted formats. No wasted words. Could be slightly shorter but effective.

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 simplicity (2 required params, no output schema) and informative sibling context, description covers essentials. No need for additional details like return value or error cases.

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 coverage is 100% so baseline is 3. Description adds example values for 'key' parameter but no new semantics beyond what schema description provides.

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?

Description clearly states it presses a hardware/system key. Lists many friendly names and raw keycode option. Distinct from sibling tools like tap, double_tap, long_press which are touch-based, and type_text which inputs text characters.

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?

Description explains accepted key formats (friendly names or raw keycode). Does not explicitly say when to use vs alternatives, but given sibling names, context is clear.

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/saranshbamania/mobile-device-mcp'

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