Skip to main content
Glama
rahulkr
by rahulkr

scroll_down

Scroll down on the current Android device screen using ADB commands. This tool helps navigate content during Flutter development, UI testing, or visual QA workflows.

Instructions

Scroll down on the current screen

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_serialNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'scroll_down' tool. It calculates screen dimensions using get_screen_specs, determines swipe coordinates (center horizontally, from 70% down to 30% vertically), and performs a swipe gesture using the swipe helper function. The @mcp.tool() decorator registers this function as an MCP tool named 'scroll_down'.
    @mcp.tool()
    def scroll_down(device_serial: str | None = None) -> str:
        """Scroll down on the current screen"""
        specs = get_screen_specs(device_serial)
        center_x = specs['width_px'] // 2
        start_y = int(specs['height_px'] * 0.7)
        end_y = int(specs['height_px'] * 0.3)
        return swipe(center_x, start_y, center_x, end_y, 300, device_serial)
  • The @mcp.tool() decorator registers the scroll_down function as an MCP tool.
    @mcp.tool()
  • The swipe function used by scroll_down to perform the actual gesture.
    def swipe(
        start_x: int, 
        start_y: int, 
        end_x: int, 
        end_y: int, 
        duration_ms: int = 300,
        device_serial: str | None = None
    ) -> str:
        """Swipe from start to end coordinates"""
        return run_adb([
            "shell", "input", "swipe",
            str(start_x), str(start_y),
            str(end_x), str(end_y),
            str(duration_ms)
        ], device_serial)
  • The get_screen_specs function called by scroll_down to obtain screen dimensions for calculating swipe coordinates.
    @mcp.tool()
    def get_screen_specs(device_serial: str | None = None) -> dict:
        """Get detailed screen specifications - useful for responsive design"""
        size_output = run_adb(["shell", "wm", "size"], device_serial)
        density_output = run_adb(["shell", "wm", "density"], device_serial)
        
        # Parse physical size
        size_match = re.search(r'Physical size: (\d+)x(\d+)', size_output)
        override_match = re.search(r'Override size: (\d+)x(\d+)', size_output)
        
        width, height = 0, 0
        if override_match:
            width, height = int(override_match.group(1)), int(override_match.group(2))
        elif size_match:
            width, height = int(size_match.group(1)), int(size_match.group(2))
        
        # Parse density
        density = 0
        density_match = re.search(r'Physical density: (\d+)', density_output)
        if density_match:
            density = int(density_match.group(1))
        
        # Calculate useful metrics
        dp_width = (width / density) * 160 if density else 0
        dp_height = (height / density) * 160 if density else 0
        
        return {
            "width_px": width,
            "height_px": height,
            "density_dpi": density,
            "width_dp": round(dp_width, 1),
            "height_dp": round(dp_height, 1),
            "aspect_ratio": f"{width}:{height}",
            "density_bucket": get_density_bucket(density)
        }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the action ('scroll down') but fails to describe how it behaves—such as scroll distance, speed, direction, or effects on UI state. For a UI interaction tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration, which is appropriate for a simple tool.

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 the tool's low complexity (one optional parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. However, with no annotations and incomplete parameter guidance, it lacks details on behavioral aspects like scroll behavior or device context, leaving gaps in overall completeness.

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

Parameters4/5

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

The input schema has one parameter ('device_serial') with 0% description coverage, and the description doesn't mention parameters at all. Since there's only one optional parameter, the baseline is high, but the description doesn't add any semantic context about when or why to specify the device serial, missing an opportunity to clarify its role.

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 ('scroll down') and the target ('on the current screen'), providing a specific verb+resource combination. However, it doesn't differentiate from its sibling 'scroll_up' or other navigation tools like 'swipe', leaving room for improvement in distinguishing between similar tools.

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?

The description provides no guidance on when to use this tool versus alternatives like 'scroll_up', 'swipe', or 'scroll_to_text'. It lacks context about prerequisites (e.g., needing a screen to be active) or exclusions, offering minimal usage direction beyond the basic action stated.

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/rahulkr/r_adb_mcp_server'

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