Skip to main content
Glama
rahulkr
by rahulkr

scroll_to_text

Scroll on Android device screens to locate specific text content, supporting automated UI testing and development workflows.

Instructions

Scroll until text is found on screen

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
max_scrollsNo
device_serialNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'scroll_to_text' tool. It repeatedly checks the UI hierarchy for elements containing the target text using find_element_by_text, scrolls down if not found, and returns the location when found or after max_scrolls attempts.
    @mcp.tool()
    def scroll_to_text(
        text: str, 
        max_scrolls: int = 10,
        device_serial: str | None = None
    ) -> str:
        """Scroll until text is found on screen"""
        for i in range(max_scrolls):
            elements = find_element_by_text(text, partial_match=True, device_serial=device_serial)
            if elements:
                return f"Found '{text}' after {i} scrolls at {elements[0].get('center', 'unknown')}"
            scroll_down(device_serial)
            time.sleep(0.5)
        return f"Text '{text}' not found after {max_scrolls} scrolls"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions scrolling behavior but fails to explain what happens when text isn't found (e.g., error handling), whether scrolling is incremental or continuous, visual feedback during operation, or any performance implications. For a tool with interactive UI effects, this is inadequate.

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, efficient sentence with zero wasted words. It's front-loaded with the core functionality and appropriately sized for the tool's apparent complexity, making it easy to parse quickly.

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 moderate complexity (3 parameters, interactive UI operation) and the presence of an output schema (which should cover return values), the description is minimally adequate. However, with no annotations and incomplete parameter guidance, it leaves significant behavioral and contextual gaps that could hinder effective use.

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 but doesn't mention any parameters. However, with only 3 parameters (one required, two with defaults), the baseline is moderate. The description implies 'text' parameter usage but doesn't clarify 'max_scrolls' behavior or 'device_serial' context, leaving gaps in parameter 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 ('scroll until text is found') and target ('on screen'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from similar scrolling tools like 'scroll_down' or 'scroll_up', which would require sibling differentiation for a score of 5.

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 'find_element_by_text' or 'get_all_text_on_screen'. It lacks any context about prerequisites, when-not scenarios, or explicit alternatives, leaving usage decisions entirely to inference.

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