mobile_click
Click on specific screen coordinates to automate Android device interactions. Use this tool to perform precise touch actions by providing X and Y coordinates for targeted UI manipulation.
Instructions
Click on a specific coordinate on the Android screen.
Args: x: X coordinate to click y: Y coordinate to click
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes |
Implementation Reference
- main.py:124-143 (handler)The main handler function for the 'mobile_click' tool. It performs a click at the specified coordinates after validating the device connection and UI coordinates.@mcp.tool() def mobile_click(x: int, y: int) -> str: """Click on a specific coordinate on the Android screen. Args: x: X coordinate to click y: Y coordinate to click """ if device is None: return "Error: Device not initialized. Please call mobile_init() first to establish connection with Android device." try: _mobile_dump_ui() global ui_coords if (x, y) not in ui_coords: return "Invalid elements coordinates. Please use mobile_dump_ui to get the latest UI state first." device.click(x, y) return f"Successfully clicked on coordinate ({x}, {y})" except Exception as e: return f"Error clicking coordinate ({x}, {y}): {str(e)}"
- main.py:124-124 (registration)The @mcp.tool() decorator registers the mobile_click function as an MCP tool.@mcp.tool()