Skip to main content
Glama

button

Press hardware keys on iOS simulators/devices and Android emulators/devices by device ID and key name; returns the pressed key or a clear error for unsupported or unreachable targets.

Instructions

Press a device hardware button (iOS simulator or physical device, Android emulator or device). Supported buttons depend on the platform: buttons not present on the target (e.g. 'back' on iOS, 'actionButton' on Android, 'power' or 'appSwitch' on a physical iPhone) are rejected with a clear error. Use when you need to trigger hardware button events. Returns { pressed: buttonName }. Fails if the device backend is not reachable: the simulator-server for iOS, or adb for Android.

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": {
      "udid": "<udid>",
      "button": "<button>"
    },
    "name": "button"
  }
}

Input Schema

NameRequiredDescriptionDefault
udidYesTarget device id from `list-devices` (iOS UDID or Android serial).
buttonYesHardware button to press

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A4/5.0
Behavior4/5

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

No annotations exist to lean on, and the description steps up: it discloses that unsupported buttons are rejected with a clear error, examples of unsupported cases per platform (back on iOS, actionButton on Android, power/appSwitch on a physical iPhone), and the backend dependency failure mode. It omits side effects such as the app being backgrounded by 'home', which a mutation-style action tool would ideally state.

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?

Front-loaded with the action, followed by platform constraints, return shape, and failure mode in a logical order. The sentence 'Use when you need to trigger hardware button events' repeats the already-clear purpose and could be cut, but overall there is little waste.

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

Completeness4/5

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

Covers purpose, platform-dependent validity, return value ('{ pressed: buttonName }'), and backend failure conditions, which is nearly everything needed for a two-parameter action tool with no output schema. Only the effect on app state after the press is left unexplained.

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 baseline is 3, but the description adds real meaning beyond the enum by explaining that enum values are conditionally valid depending on target platform. It does not elaborate on the udid parameter beyond what the schema already says.

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 ('Press a device hardware button') and scopes it across simulator/emulator/physical devices. The distinction from sibling input tools (keyboard, gesture-tap) is implicit in 'hardware button' rather than stated, so it falls just short of explicit sibling differentiation.

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 a clear when-to-use line ('Use when you need to trigger hardware button events') plus per-platform availability rules and error behavior for missing buttons. It does not name an alternative tool for on-screen interaction, so the routing guidance is contextual rather than explicit.

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