Skip to main content
Glama
mobile-next

Mobile Next MCP Server

Official
by mobile-next

mobile_swipe_on_screen

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`; } } );

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