Skip to main content
Glama

Robot Actions — Remote Device Control

device_key

Send a keycode to a device. Accepts numeric keycode OR named key (HOME, BACK, ENTER, VOLUME_UP, VOLUME_DOWN, POWER, APP_SWITCH, ESCAPE, DELETE, TAB, SEARCH, MENU). System-policy keys (APP_SWITCH/187, MENU/82, POWER/26) are always sent via shell — they require policy-level handling that the control channel cannot reach. Other keys try the control channel first and fall back to shell on error/timeout. Every route here is injected — this tool has no kernel input path. Use device_uhid_key_press instead when the target app filters or ignores injected key events and the press has to land as real kernel input.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesDevice serial number (UDID)
keycodeYesAndroid keycode number OR name (HOME, BACK, ENTER, VOLUME_UP, VOLUME_DOWN, POWER, APP_SWITCH, ESCAPE, DELETE, TAB, SEARCH, MENU)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries full behavioral disclosure. It clearly states that system-policy keys (APP_SWITCH, MENU, POWER) are always sent via shell due to policy-level handling, that other keys try the control channel first and fall back to shell, and that every route is injected with no kernel input path. This is rich, transparent behavior documentation.

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—three sentences that start with the core action, then provide necessary routing and fallback details, then conclude with an alternative. Every sentence earns its place with no filler or repetition.

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

Completeness5/5

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

For a simple two-parameter tool with subtle routing behavior, the description covers everything an agent needs: valid inputs, routing logic, the injection limitation, and an explicit alternative. No output schema exists, but the description appropriately omits return-value details because they are not crucial for selecting and invoking this tool correctly.

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?

The schema already covers both parameters with clear descriptions (udid and keycode). The description adds value beyond the schema by explicitly noting numeric codes for system-policy keys (APP_SWITCH/187, MENU/82, POWER/26) and explaining routing implications. This goes beyond a simple restatement of schema fields, though it could have added more detail on error/idempotency behavior.

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 opens with a clear, specific verb and resource: 'Send a keycode to a device.' It distinguishes itself from siblings by listing accepted key types (numeric and named) and explicitly referencing the alternative device_uhid_key_press. This leaves no ambiguity about what the tool does.

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?

The description provides explicit guidance on when to use this tool versus the alternative: 'Use device_uhid_key_press instead when the target app filters or ignores injected key events...' It also explains the routing strategy (control channel first, shell fallback) and identifies system-policy keys that always use shell. This is exemplary usage guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources