Skip to main content
Glama

tap

Tap at specific screen coordinates on Android devices to automate touch interactions and perform UI testing.

Instructions

Tap at specific screen coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
device_idNoDevice ID (optional if only one device)

Implementation Reference

  • The implementation of the tap command, which executes the shell input tap command via ADB.
    async tap(x: number, y: number, deviceId?: string): Promise<void> {
      await this.exec(["shell", "input", "tap", String(x), String(y)], deviceId);
    }
  • src/index.ts:160-172 (registration)
    The registration of the 'tap' MCP tool, which calls the adb.tap helper method.
    server.tool(
      "tap",
      "Tap at specific screen coordinates",
      {
        x: z.number().describe("X coordinate"),
        y: z.number().describe("Y coordinate"),
        device_id: z.string().optional().describe("Device ID (optional if only one device)"),
      },
      async ({ x, y, device_id }) => {
        await adb.tap(x, y, device_id);
        return { content: [{ type: "text", text: `Tapped at (${x}, ${y})` }] };
      },
    );

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/martingeidobler/android-mcp-server'

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