Skip to main content
Glama
mobile-next

Mobile Next MCP Server

Official
by mobile-next

Click Screen

mobile_click_on_screen_at_coordinates
Destructive

Simulate screen taps at specific pixel coordinates on mobile devices for automated testing and interaction with iOS and Android applications.

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
deviceYesThe device identifier to use. Use mobile_list_available_devices to find which devices are available to you.
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:340-354 (registration)
    Tool registration including schema definition (device, x, y) and thin handler that delegates to Robot.tap via getRobotFromDevice.
    tool(
    	"mobile_click_on_screen_at_coordinates",
    	"Click Screen",
    	"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.",
    	{
    		device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."),
    		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 ({ device, x, y }) => {
    		const robot = getRobotFromDevice(device);
    		await robot.tap(x, y);
    		return `Clicked on screen at coordinates: ${x}, ${y}`;
    	}
    );
  • Helper function that selects and returns the appropriate Robot implementation (AndroidRobot, IosRobot, or MobileDevice) based on the device ID.
    const getRobotFromDevice = (deviceId: string): Robot => {
    
    	// from now on, we must have mobilecli working
    	ensureMobilecliAvailable();
    
    	// Check if it's an iOS device
    	const iosManager = new IosManager();
    	const iosDevices = iosManager.listDevices();
    	const iosDevice = iosDevices.find(d => d.deviceId === deviceId);
    	if (iosDevice) {
    		return new IosRobot(deviceId);
    	}
    
    	// Check if it's an Android device
    	const androidManager = new AndroidDeviceManager();
    	const androidDevices = androidManager.getConnectedDevices();
    	const androidDevice = androidDevices.find(d => d.deviceId === deviceId);
    	if (androidDevice) {
    		return new AndroidRobot(deviceId);
    	}
    
    	// Check if it's a simulator (will later replace all other device types as well)
    	const response = mobilecli.getDevices({
    		platform: "ios",
    		type: "simulator",
    		includeOffline: false,
    	});
    
    	if (response.status === "ok" && response.data && response.data.devices) {
    		for (const device of response.data.devices) {
    			if (device.id === deviceId) {
    				return new MobileDevice(deviceId);
    			}
    		}
    	}
    
    	throw new ActionableError(`Device "${deviceId}" not found. Use the mobile_list_available_devices tool to see available devices.`);
    };
  • Platform-specific handler for tap in AndroidRobot using ADB shell input tap command.
    public async tap(x: number, y: number): Promise<void> {
    	this.adb("shell", "input", "tap", `${x}`, `${y}`);
    }
  • Platform-specific handler for tap in IosRobot delegating to WebDriverAgent.
    public async tap(x: number, y: number): Promise<void> {
    	const wda = await this.wda();
    	await wda.tap(x, y);
    }
  • Platform-specific handler for tap in MobileDevice using mobilecli runCommand.
    public async tap(x: number, y: number): Promise<void> {
    	this.runCommand(["io", "tap", `${x},${y}`]);
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations include destructiveHint: true, indicating a potentially disruptive action, but the description adds context by specifying it's a click action on a mobile screen, which aligns with the destructive hint. However, it doesn't detail side effects like app navigation or UI changes beyond what annotations imply, missing some behavioral nuances.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core action and followed by a specific usage tip. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (destructive action with 3 parameters) and no output schema, the description is mostly complete: it covers purpose, usage, and references other tools. However, it lacks details on error handling or what happens post-click, leaving minor gaps in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so parameters are well-documented there. The description adds minimal semantics by mentioning 'x,y coordinates' but doesn't provide extra details like coordinate system or validation rules. Baseline score of 3 is appropriate as the schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Click on the screen') with the resource ('at given x,y coordinates'), distinguishing it from siblings like mobile_double_tap_on_screen or mobile_long_press_on_screen_at_coordinates by specifying a single click action. It also references mobile_list_elements_on_screen for context, enhancing differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides when to use this tool ('Click on the screen at given x,y coordinates') and when to use an alternative ('If clicking on an element, use the list_elements_on_screen tool to find the coordinates'), offering clear guidance on tool selection versus siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/mobile-next/mobile-mcp'

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