Skip to main content
Glama

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
NameRequiredDescriptionDefault
xYes
yYes

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()

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/erichung9060/Android-Mobile-MCP'

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