Skip to main content
Glama

mobile_swipe

Execute swipe gestures on Android screens by specifying start and end coordinates to navigate interfaces, scroll content, or trigger actions through automated touch interactions.

Instructions

Perform a swipe gesture on the Android screen.

Args: start_x: Starting X coordinate start_y: Starting Y coordinate end_x: Ending X coordinate end_y: Ending Y coordinate duration: Duration of swipe in seconds (default: 0.5)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_xYes
start_yYes
end_xYes
end_yYes
durationNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:188-207 (handler)
    Handler function for the 'mobile_swipe' tool, including decorator for registration. Executes swipe gesture on Android device using shell command.
    @mcp.tool()
    def mobile_swipe(start_x: int, start_y: int, end_x: int, end_y: int, duration: float = 0.5) -> str:
        """Perform a swipe gesture on the Android screen.
        
        Args:
            start_x: Starting X coordinate
            start_y: Starting Y coordinate
            end_x: Ending X coordinate
            end_y: Ending Y coordinate
            duration: Duration of swipe in seconds (default: 0.5)
        """
        if device is None:
            return "Error: Device not initialized. Please call mobile_init() first to establish connection with Android device."
        try:
            duration_ms = int(duration * 1000)
            cmd = f"input swipe {start_x} {start_y} {end_x} {end_y} {duration_ms}"
            device.shell(cmd)
            return f"Successfully swiped from ({start_x}, {start_y}) to ({end_x}, {end_y}) in {duration}s"
        except Exception as e:
            return f"Error swiping: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits. It doesn't mention potential side effects (e.g., screen changes, app navigation), error conditions, or dependencies like requiring an active Android session, which is critical for a mutation tool.

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

Conciseness4/5

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

The description is front-loaded with the core purpose in the first sentence, followed by a structured Args section. It's efficient with minimal waste, though the parameter explanations could be slightly more informative without sacrificing brevity.

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

Completeness3/5

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

Given 5 parameters with 0% schema coverage and no annotations, the description provides basic parameter info but lacks behavioral context. The presence of an output schema (not detailed here) might help, but for a mutation tool in a mobile automation context, more guidance on effects and prerequisites is needed for full completeness.

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?

Schema description coverage is 0%, so the description must compensate. It lists all 5 parameters with brief explanations (e.g., 'Starting X coordinate'), adding basic meaning beyond the bare schema. However, it lacks details like coordinate ranges (e.g., screen resolution limits) or units, leaving gaps in understanding.

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

Purpose4/5

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

The description clearly states the action ('perform a swipe gesture') and target ('on the Android screen'), which is specific and distinguishes it from siblings like mobile_click or mobile_type. However, it doesn't explicitly differentiate from mobile_dump_ui or mobile_take_screenshot in terms of interaction type, keeping it from a perfect score.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like mobile_click for taps or mobile_key_press for keyboard inputs. The description lacks context about prerequisites (e.g., needing mobile_init first) or typical use cases, leaving the agent to infer usage.

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

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