Skip to main content
Glama

mobile_click_on_screen_at_coordinates

Trigger a click at specified x,y coordinates on a mobile screen. Use with the list_elements_on_screen tool to locate elements accurately for precise automation in mobile apps.

Instructions

Click on the screen at given x,y coordinates. If clicking on an element, use the list_elements_on_screen tool to find the coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesThe x coordinate to click on the screen, in pixels
yYesThe y coordinate to click on the screen, in pixels

Implementation Reference

  • src/server.ts:263-275 (registration)
    Registers the 'mobile_click_on_screen_at_coordinates' tool. Includes input schema for x and y coordinates, and a handler function that requires a selected robot/device and calls robot.tap(x, y) to perform the click, returning a confirmation message.
    tool( "mobile_click_on_screen_at_coordinates", "Click on the screen at given x,y coordinates. If clicking on an element, use the list_elements_on_screen tool to find the coordinates.", { x: z.number().describe("The x coordinate to click on the screen, in pixels"), y: z.number().describe("The y coordinate to click on the screen, in pixels"), }, async ({ x, y }) => { requireRobot(); await robot!.tap(x, y); return `Clicked on screen at coordinates: ${x}, ${y}`; } );
  • Android-specific implementation of the tap method in AndroidRobot class, using ADB shell input tap command.
    public async tap(x: number, y: number): Promise<void> { this.adb("shell", "input", "tap", `${x}`, `${y}`); }
  • iOS-specific implementation of the tap method in IosRobot class, delegating to WebDriverAgent.
    public async tap(x: number, y: number): Promise<void> { const wda = await this.wda(); await wda.tap(x, y); }
  • iOS Simulator-specific implementation of the tap method in Simctl class, delegating to WebDriverAgent.
    public async tap(x: number, y: number) { const wda = await this.wda(); return wda.tap(x, y); }
  • Zod schema defining input parameters x and y as numbers for the tool.
    { x: z.number().describe("The x coordinate to click on the screen, in pixels"), y: z.number().describe("The y coordinate to click on the screen, in pixels"), },

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