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
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | The x coordinate to click on the screen, in pixels | |
| y | Yes | The 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}`; } );
- src/android.ts:304-306 (handler)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}`); }
- src/ios.ts:165-168 (handler)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); }
- src/iphone-simulator.ts:113-116 (handler)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); }
- src/server.ts:266-269 (schema)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"), },