Skip to main content
Glama

Press Button

mobile_press_button
Destructive

Press buttons on mobile devices to navigate interfaces, control volume, or execute commands during automated testing or interaction workflows.

Instructions

Press a button on device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceYesThe device identifier to use. Use mobile_list_available_devices to find which devices are available to you.
buttonYesThe button to press. Supported buttons: BACK (android only), HOME, VOLUME_UP, VOLUME_DOWN, ENTER, DPAD_CENTER (android tv only), DPAD_UP (android tv only), DPAD_DOWN (android tv only), DPAD_LEFT (android tv only), DPAD_RIGHT (android tv only)

Implementation Reference

  • The handler function for the mobile_press_button tool. It requires a device/robot to be selected and calls the pressButton method on it with the provided button argument.
    async ({ button }) => {
    	requireRobot();
    	await robot!.pressButton(button);
    	return `Pressed the button: ${button}`;
    }
  • Zod input schema for the tool, defining the 'button' parameter as a string with description of supported buttons.
    {
    	button: z.string().describe("The button to press. Supported buttons: BACK (android only), HOME, VOLUME_UP, VOLUME_DOWN, ENTER, DPAD_CENTER (android tv only), DPAD_UP (android tv only), DPAD_DOWN (android tv only), DPAD_LEFT (android tv only), DPAD_RIGHT (android tv only)"),
    },
  • src/server.ts:314-325 (registration)
    Registration of the mobile_press_button tool using the custom tool() helper function, which internally registers it with the MCP server.
    tool(
    	"mobile_press_button",
    	"Press a button on device",
    	{
    		button: z.string().describe("The button to press. Supported buttons: BACK (android only), HOME, VOLUME_UP, VOLUME_DOWN, ENTER, DPAD_CENTER (android tv only), DPAD_UP (android tv only), DPAD_DOWN (android tv only), DPAD_LEFT (android tv only), DPAD_RIGHT (android tv only)"),
    	},
    	async ({ button }) => {
    		requireRobot();
    		await robot!.pressButton(button);
    		return `Pressed the button: ${button}`;
    	}
    );
Behavior3/5

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

The annotations include destructiveHint: true, indicating potential side effects, but the description adds minimal behavioral context beyond the basic action. It doesn't explain what 'destructive' entails (e.g., might interrupt apps, change device state) or mention rate limits, permissions, or error conditions. With annotations covering safety, the description meets a low bar but lacks depth.

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 a single, efficient sentence with zero wasted words—'Press a button on device' directly conveys the core action. It's front-loaded and appropriately sized for a simple tool, avoiding unnecessary elaboration.

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?

Given the tool's moderate complexity (destructive action with device interaction), no output schema, and rich schema coverage, the description is minimally adequate. It covers the basic purpose but lacks context on outcomes (e.g., what happens after pressing), error handling, or integration with siblings like mobile_list_available_devices. Annotations help, but more completeness would be beneficial.

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%, with clear docs for 'device' and 'button' parameters, including supported button values. The description adds no extra semantic meaning beyond what's in the schema (e.g., no examples of button usage or device constraints). Baseline 3 is appropriate since the schema does the heavy lifting.

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?

The description clearly states the action ('Press') and target ('a button on device'), which is specific and unambiguous. It distinguishes from siblings like mobile_click_on_screen_at_coordinates or mobile_type_keys by focusing on button interactions rather than screen taps or keyboard input. However, it doesn't explicitly mention device types (e.g., Android vs. iOS) or differentiate from mobile_swipe_on_screen, which is a minor gap.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., device must be connected), exclusions (e.g., not for virtual buttons), or compare to siblings like mobile_double_tap_on_screen. The input schema hints at device availability via mobile_list_available_devices, but the description itself lacks explicit usage context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EmpathySlainLovers/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server