Skip to main content
Glama

Click Screen

mobile_click_on_screen_at_coordinates
Destructive

Simulate screen taps at specific coordinates for mobile automation testing and interaction. Use with element detection tools to locate precise positions.

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:263-275 (registration)
    Registers the MCP tool 'mobile_click_on_screen_at_coordinates' with Zod input schema for x and y coordinates (numbers in pixels). The handler requires a selected robot/device and delegates the tap action to the platform-specific Robot implementation, 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}`;
    	}
    );
  • Interface definition for the tap method in the Robot class, which all platform implementations (Android, iOS, Simulator) must provide. This is the core abstraction used by the tool handler.
     */
    tap(x: number, y: number): Promise<void>;
  • Android-specific handler implementation using ADB shell 'input tap' command with the provided x,y coordinates.
    public async tap(x: number, y: number): Promise<void> {
    	this.adb("shell", "input", "tap", `${x}`, `${y}`);
    }
  • iOS physical device handler: delegates tap to WebDriverAgent after ensuring tunnel and WDA are running.
    public async tap(x: number, y: number): Promise<void> {
    	const wda = await this.wda();
    	await wda.tap(x, y);
    }
  • Core tap implementation for iOS/Simulator via WebDriverAgent: sends pointer actions (move to x,y, down, pause 100ms, up) to WDA /actions endpoint within a session.
    public async tap(x: number, y: number) {
    	await this.withinSession(async sessionUrl => {
    		const url = `${sessionUrl}/actions`;
    		await fetch(url, {
    			method: "POST",
    			headers: {
    				"Content-Type": "application/json",
    			},
    			body: JSON.stringify({
    				actions: [
    					{
    						type: "pointer",
    						id: "finger1",
    						parameters: { pointerType: "touch" },
    						actions: [
    							{ type: "pointerMove", duration: 0, x, y },
    							{ type: "pointerDown", button: 0 },
    							{ type: "pause", duration: 100 },
    							{ type: "pointerUp", button: 0 }
    						]
    					}
    				]
    			}),
    		});
    	});
    }
Behavior4/5

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

The annotations include destructiveHint: true, indicating potential side effects, but the description adds valuable context by specifying that it's for clicking on coordinates and referencing element-based alternatives. It doesn't contradict annotations and provides additional behavioral insight beyond the destructive hint, though it could mention more about effects like app navigation or UI changes.

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 front-loaded with the core action in the first sentence and uses a second sentence for crucial guidance, with no wasted words. Every sentence adds value, making it efficient and well-structured for quick comprehension.

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 complexity (destructive action with 3 parameters) and lack of output schema, the description is mostly complete by stating the action, usage guidelines, and referencing related tools. However, it could improve by briefly mentioning expected outcomes or error cases, though annotations cover the destructive aspect adequately.

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?

With 100% schema description coverage, the input schema fully documents parameters (device, x, y). The description adds minimal semantics by implying coordinate-based interaction but doesn't provide extra details like coordinate ranges or device selection nuances. Baseline 3 is appropriate as the schema handles most of the parameter documentation.

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 target 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 alternative use cases, 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 not to ('If clicking on an element, use the list_elements_on_screen tool to find the coordinates'), offering clear alternatives and context for usage versus other tools in the sibling list.

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/EmpathySlainLovers/MCP'

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