Skip to main content
Glama
mobile-next

Mobile Next MCP Server

Official
by mobile-next

Swipe Screen

mobile_swipe_on_screen
Destructive

Perform screen swipes on mobile devices for automation testing. Swipe in specified directions from defined coordinates to interact with iOS and Android applications.

Instructions

Swipe on the screen

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceYesThe device identifier to use. Use mobile_list_available_devices to find which devices are available to you.
directionYesThe direction to swipe
xNoThe x coordinate to start the swipe from, in pixels. If not provided, uses center of screen
yNoThe y coordinate to start the swipe from, in pixels. If not provided, uses center of screen
distanceNoThe distance to swipe in pixels. Defaults to 400 pixels for iOS or 30% of screen dimension for Android

Implementation Reference

  • src/server.ts:456-481 (registration)
    Registration of the 'mobile_swipe_on_screen' tool, including input schema definition and handler function that delegates to the appropriate Robot instance's swipe or swipeFromCoordinate method based on provided coordinates.
    tool(
    	"mobile_swipe_on_screen",
    	"Swipe Screen",
    	"Swipe on the screen",
    	{
    		device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you."),
    		direction: z.enum(["up", "down", "left", "right"]).describe("The direction to swipe"),
    		x: z.number().optional().describe("The x coordinate to start the swipe from, in pixels. If not provided, uses center of screen"),
    		y: z.number().optional().describe("The y coordinate to start the swipe from, in pixels. If not provided, uses center of screen"),
    		distance: z.number().optional().describe("The distance to swipe in pixels. Defaults to 400 pixels for iOS or 30% of screen dimension for Android"),
    	},
    	async ({ device, direction, x, y, distance }) => {
    		const robot = getRobotFromDevice(device);
    
    		if (x !== undefined && y !== undefined) {
    			// Use coordinate-based swipe
    			await robot.swipeFromCoordinate(x, y, direction, distance);
    			const distanceText = distance ? ` ${distance} pixels` : "";
    			return `Swiped ${direction}${distanceText} from coordinates: ${x}, ${y}`;
    		} else {
    			// Use center-based swipe
    			await robot.swipe(direction);
    			return `Swiped ${direction} on screen`;
    		}
    	}
    );
Behavior3/5

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

The annotations include destructiveHint: true, which already indicates this tool performs a potentially destructive action. The description doesn't add any behavioral context beyond this, such as explaining what 'destructive' means in this context (e.g., it might change the device state or trigger unintended actions). However, it doesn't contradict the annotations, so it avoids a contradiction penalty. The description lacks additional details like rate limits, authentication needs, or specific effects.

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

Conciseness2/5

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

The description is extremely concise ('Swipe on the screen'), but this brevity comes at the cost of under-specification. It's a single phrase that fails to provide necessary context or structure. While it's not verbose, it doesn't effectively communicate the tool's purpose or usage, making it inefficient rather than appropriately concise. Every sentence should earn its place, and this one doesn't add value.

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

Completeness2/5

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

Given the tool's complexity (5 parameters, destructive hint, no output schema) and the rich schema coverage, the description is incomplete. It doesn't compensate for the lack of output schema by explaining return values or potential errors. The annotations cover safety aspects, but the description should add context about the tool's role in mobile testing or interaction workflows. It's inadequate for a tool with multiple parameters and behavioral implications.

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, with all parameters well-documented (e.g., device identifier, direction enum, coordinate defaults, distance defaults). The description 'Swipe on the screen' adds no meaning beyond what the schema provides—it doesn't explain parameter interactions, usage examples, or edge cases. According to the rules, with high schema coverage, the baseline is 3 even without param info in the description.

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

Purpose2/5

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

The description 'Swipe on the screen' is a tautology that essentially restates the tool name 'mobile_swipe_on_screen' and title 'Swipe Screen'. It doesn't specify what resource is being acted upon (e.g., a mobile device screen) or provide any meaningful differentiation from sibling tools like mobile_click_on_screen_at_coordinates or mobile_long_press_on_screen_at_coordinates. The description fails to articulate the tool's specific function beyond its name.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions. For example, it doesn't indicate that this is for interacting with mobile device screens, nor does it differentiate from other gesture-based tools like mobile_double_tap_on_screen. There's no explicit or implied usage advice, leaving the agent without direction.

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