Skip to main content
Glama

Press a phone hardware button once

hardware-button

Press a device button once—volume, power, mute, sleep/wake, or media—to trigger OS-level actions without activating the session app.

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 this command. Times out after 90s.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "button": "<button>"
    },
    "name": "hardware-button"
  }
}

Input Schema

NameRequiredDescriptionDefault
udidNoApple device or simulator UDID.
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; ids go in udid or serial.
serialNoAndroid, HarmonyOS, or Vega VVD serial.
sessionNoSession name.
noRecordNoDo not record this action.
platformNoDevice platform.
deviceTargetNoDevice form factor.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.21.38
    • removedInput schema / properties / debug
      Removed value: -{
      -  "description": "Enable debug diagnostics.",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / includeCost
      Removed value: -{
      -  "description": "Add agent cost (cost.wallClockMs, …) to the result, returned as JSON text.",
      -  "type": "boolean"
      -}
    • removedInput schema / properties / mcpOutputFormat
      Removed value: -{
      -  "description": "Result text: compact optimized (default) or the full result as JSON (larger).",
      -  "enum": [
      -    "optimized",
      -    "json"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / responseLevel
      Removed value: -{
      -  "description": "Result detail: digest (smallest) or full (largest), as JSON; default is compact text.",
      -  "enum": [
      -    "digest",
      -    "default",
      -    "full"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / target
      Removed value: -{
      -  "description": "Alias for deviceTarget.",
      -  "enum": [
      -    "mobile",
      -    "tv",
      -    "desktop"
      -  ],
      -  "type": "string"
      -}
  2. Changed15 schema fields changedv0.21.37
    • removedInput schema / properties / androidDeviceAllowlist
      Removed value: -{
      -  "description": "Android serial allowlist used for device resolution.",
      -  "type": "string"
      -}
    • changedInput schema / properties / device / description
      Previous value: -"Device name selector (a UDID belongs in udid, a serial in serial)."New value: +"Device name; ids go in udid or serial."
    • changedInput schema / properties / deviceTarget / description
      Previous value: -"Device target form. Maps to the CLI --target flag."New value: +"Device form factor."
    • changedInput schema / properties / includeCost / description
      Previous value: -"Include per-command agent-cost (cost.wallClockMs, …) in structuredContent. Defaults to off; the default response shape is unchanged."New value: +"Add agent cost (cost.wallClockMs, …) to the result, returned as JSON text."
    • removedInput schema / properties / leaseId
      Removed value: -{
      -  "description": "Existing lease identifier.",
      -  "type": "string"
      -}
    • changedInput schema / properties / mcpOutputFormat / description
      Previous value: -"MCP text content format. Defaults to optimized agent-friendly text; use json for JSON text. Structured content is always returned separately."New value: +"Result text: compact optimized (default) or the full result as JSON (larger)."
    • changedInput schema / properties / platform / description
      Previous value: -"Platform selector used to resolve a device."New value: +"Device platform."
    • changedInput schema / properties / responseLevel / description
      Previous value: -"Response verbosity: token-cheap digest / default (today) / full. Defaults to default; the default response shape is unchanged."New value: +"Result detail: digest (smallest) or full (largest), as JSON; default is compact text."
    • removedInput schema / properties / runId
      Removed value: -{
      -  "description": "Lease run identifier.",
      -  "type": "string"
      -}
    • changedInput schema / properties / serial / description
      Previous value: -"Android, HarmonyOS, or Vega VVD serial selector."New value: +"Android, HarmonyOS, or Vega VVD serial."
    • changedInput schema / properties / session / description
      Previous value: -"Agent-device session name."New value: +"Session name."
    • changedInput schema / properties / target / description
      Previous value: -"Alias for deviceTarget on commands without a UI target field. Interaction commands reserve target for the UI element."New value: +"Alias for deviceTarget."
    • removedInput schema / properties / tenant
      Removed value: -{
      -  "description": "Remote tenant identifier.",
      -  "type": "string"
      -}
    • changedInput schema / properties / udid / description
      Previous value: -"Apple device or simulator UDID; the selector that pins one device when several share a name."New value: +"Apple device or simulator UDID."
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "action": {
      -      "const": "hardware-button",
      -      "type": "string"
      -    },
      -    "button": {
      -      "enum": [
      -        "volume-up",
      -        "volume-down",
      -        "power",
      -        "mute",
      -        "sleep",
      -        "wake",
      -        "media-play-pause",
      -        "media-next",
      -        "media-previous",
      -        "media-rewind",
      -        "media-fast-forward"
      -      ],
      -      "type": "string"
      -    },
      -    "message": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "action",
      -    "button",
      -    "message"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Addedv0.21.29

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false) by disclosing that the press is dispatched without activating the session app, nothing is re-observed afterward, and the OS decides routing for volume/media keys. It also warns that power/sleep can leave the device on a locked screen for later commands, and states the 90s timeout.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the button list, which is good, but the middle sentences are tangled ('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') and the button list plus per-button semantics duplicate the schema descriptions verbatim in places.

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 an 8-parameter, no-output-schema action tool, the description covers the platform support matrix, per-button OS behavior, side effects on subsequent commands, and timeout — everything an agent needs to decide whether calling is safe and likely to succeed. Remaining parameters (session, udid, noRecord, platform) are fully documented in the schema.

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% and the enum values are already documented per-button, so the description's button list largely restates the schema. It adds only framing value — that the same key may map to different streams/sessions depending on the OS.

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?

States a concrete verb and resource ('Press a phone hardware button once') and immediately enumerates all eleven supported buttons, so an agent can tell whether its desired key is covered without opening the schema. The verb 'press once' also distinguishes the single-press semantics from longer gesture/sequence tools in the sibling set.

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?

Gives explicit when-it-works/when-it-fails conditions: Android via ADB and Appium presses all eleven, physical Apple devices press volume only through the local runner or Appium, and iOS Simulators, Android TV and tvOS refuse the command entirely. It does not name a sibling alternative (e.g. when to use 'press' or 'action-button' instead), which keeps it short of a 5.

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