Skip to main content
Glama

keyevent

Trigger Android device key presses using a numeric code or a name such as BACK, HOME, ENTER, or VOLUME_UP.

Instructions

Send a key event. Accepts a numeric keycode or a name like BACK, HOME, ENTER, TAB, DEL, APP_SWITCH, VOLUME_UP (KEYCODE_ prefix optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serialNo
keycodeYes
longpressNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden, yet it discloses only the input format. It says nothing about side effects (e.g., that HOME/APP_SWITCH will change foreground state), what longpress does, whether a device serial is needed for multi-device setups, or what the tool returns. The behavioral profile is largely absent.

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 tight sentences with the core action front-loaded and the keycode examples immediately following. No filler, though the example list is dense and could be trimmed slightly.

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 return values need not be described, and the keycode format is well covered. But with no annotations, 0% schema coverage, and undocumented serial/longpress parameters, the definition is not complete enough for a tool whose key events can have meaningful device side effects.

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 0%, so the description must compensate. It does a good job on keycode (numeric or named, with examples and the optional KEYCODE_ prefix), but 'serial' and 'longpress' receive no explanation at all, leaving two of three parameters undocumented in both schema and description.

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 ('Send a key event') and enumerates accepted keycode forms. However, it does not distinguish itself from the many overlapping siblings (press_home, press_back, press_enter, tap, long_press), so an agent cannot tell from the description when to prefer this generic tool over those convenience wrappers.

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?

The description explains input format but gives no when-to-use guidance, no prerequisites, and no mention of the sibling alternatives that do the same thing for specific keys. The agent must infer usage entirely from context.

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