Skip to main content
Glama

mobile_press_button

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}`;
    	}
    );

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