Skip to main content
Glama

hardware-button

Press a phone hardware button once: volume-up, volume-down, power, mute, sleep, wake, media-play-pause, media-next, media-previous, media-rewind, or media-fast-forward.

Instructions

Press a phone hardware button once: volume-up, volume-down, power, mute, sleep, wake, media-play-pause, media-next, media-previous, media-rewind, or media-fast-forward. The press is dispatched without activating the session app and nothing is re-observed afterwards, so the OS decides what the key does — which audio stream a volume press moves, which media session a media key reaches, and whether the HUD shows, is device behavior this command does not claim. Power toggles the Android screen; sleep and wake are the explicit Android events that turn it off or on without toggling, and after a press that turns it off, later commands may hit a locked screen. Android (ADB-backed and Appium) presses all eleven on phones and tablets; a physical iPhone or iPad presses volume only through the local runner or Appium, never power, mute, sleep, wake, or media. iOS Simulators, Android TV and tvOS targets refuse: on TV targets use tv-remote. Times out after 90s.

Input Schema

NameRequiredDescriptionDefault
udidNoApple device or simulator UDID; the selector that pins one device when several share a name.
debugNoEnable debug diagnostics.
runIdNoLease run identifier.
buttonYesOne press each. volume-up and volume-down move the system volume stream the OS selects; power toggles the screen on Android; sleep and wake are the explicit Android events that turn the screen off or on without toggling; mute, media-play-pause, media-next, media-previous, media-rewind, and media-fast-forward are Android keys the OS routes to its own streams and media sessions. All of these except volume are refused on every Apple leaf.
deviceNoDevice name selector (a UDID belongs in udid, a serial in serial).
serialNoAndroid, HarmonyOS, or Vega VVD serial selector.
targetNoAlias for deviceTarget on commands without a UI target field. Interaction commands reserve target for the UI element.
tenantNoRemote tenant identifier.
leaseIdNoExisting lease identifier.
sessionNoAgent-device session name.
noRecordNoDo not record this action.
platformNoPlatform selector used to resolve a device.
includeCostNoInclude per-command agent-cost (cost.wallClockMs, …) in structuredContent. Defaults to off; the default response shape is unchanged.
deviceTargetNoDevice target form. Maps to the CLI --target flag.
responseLevelNoResponse verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged.
mcpOutputFormatNoMCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately.
androidDeviceAllowlistNoAndroid serial allowlist used for device resolution.

Output Schema

NameRequiredDescriptionDefault
actionYes
buttonYes
messageYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.21.29

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: it explains that the press is dispatched without activating the session app, nothing is re-observed, the OS decides routing, power toggles the screen, sleep/wake are explicit events, screen-off may cause later commands to hit a locked screen, and the command times out after 90s.

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?

The description is front-loaded with the core action and button list, then layers on constraints and side effects. It is dense and a bit long, but most sentences carry relevant operational detail for a complex hardware-control tool.

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?

Given no annotations, a rich input schema, and an output schema, the description is complete enough to call the tool correctly. It covers platform support, refusal cases, side effects, timeout behavior, and the command's non-observational nature.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds useful meaning around the button parameter by explaining OS routing, Android versus Apple support, and device-behavior limits. It does not add much for the many selector/session parameters beyond what the schema already documents.

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 specific verb and resource: 'Press a phone hardware button once,' then enumerates the supported buttons. It also distinguishes itself from television controls by directing TV targets to tv-remote, so an agent can identify its scope without opening the schema.

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?

It gives explicit platform conditions: Android supports all eleven buttons, physical Apple devices support only volume, iOS Simulators and TV targets refuse, and TV users should use tv-remote. This provides clear when-to-use and when-not-to-use guidance plus an alternative.

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