Skip to main content
Glama

press_key

Send Android system or virtual key events such as Back, Home, Recents, Enter, and Power/Wake, then optionally return the latest UI hierarchy for the next action.

Instructions

发送系统物理/虚拟按键(返回、主页、多任务、回车、电源唤醒等),并自动返回最新界面结构。

Input Schema

NameRequiredDescriptionDefault
keyNo按键名称或代码:'BACK'、'HOME'、'APP_SWITCH'、'ENTER'、'DEL'、'VOLUME_UP'、'VOLUME_DOWN'、'POWER'、'WAKEUP'、'SLEEP'BACK
wait_after_msNo按键后等待毫秒数,默认 0
return_ui_afterNo按键后是否附带完整 UI 树。默认 False——按返回键后通常只需知道动作已送达,需要时再 ui_snapshot

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It claims the tool automatically returns the latest UI structure, which conflicts with the schema's return_ui_after default of false, and it says nothing about permission requirements or side effects of POWER/SLEEP presses on device state, nor how long the call blocks when wait_after_ms is used.

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 that states the action and its postcondition without padding. The trailing 'etc.' and the vague '等' slightly blur the exact key set, but overall the wording is efficient.

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?

An output schema exists, so the description need not explain return values, and the operation itself is simple. However, for a tool capable of POWER/SLEEP and WAKEUP — device-state-affecting keys — the absence of any note on permissions, irreversibility, or how the UI-return behavior relates to the return_ui_after parameter leaves meaningful gaps.

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 all three parameters (key, wait_after_ms, return_ui_after) are already documented in the schema and a baseline of 3 applies. The description's mention of key names merely echoes the schema's enum-like examples and adds no syntax, format, or default-behavior detail beyond it.

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 gives a concrete verb+resource — sending physical/virtual system key presses — and lists representative keys (BACK, HOME, APP_SWITCH, ENTER, POWER/WAKEUP), so the agent knows exactly what operation this performs. It does not distinguish itself from sibling input tools such as swipe_screen, tap_element, perform_gesture or send_intent, which keeps it 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 Guidelines2/5

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

There is no explicit when-to-use guidance: nothing says when a key press is preferable to perform_gesture, element_action, or send_intent, and no prerequisites or exclusions are given. The key list implies navigation scenarios, but the agent must infer selection criteria on its own.

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