Skip to main content
Glama

mobile_init

Establish connection to Android devices for UI automation, enabling screen interaction, app control, and testing capabilities through ADB.

Instructions

Initialize the Android device connection.

Must be called before using any other mobile tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:85-97 (handler)
    The handler function for the 'mobile_init' tool, decorated with @mcp.tool() which also serves as its registration in the FastMCP server. It initializes the connection to the Android device using uiautomator2.
    @mcp.tool()
    def mobile_init() -> str:
        """Initialize the Android device connection.
        
        Must be called before using any other mobile tools.
        """
        global device
        try:
            device = u2.connect()
            return "Device initialized successfully"
        except Exception as e:
            device = None
            return f"Error initializing device: {str(e)}"
  • main.py:85-85 (registration)
    The @mcp.tool() decorator registers the mobile_init function as an MCP tool.
    @mcp.tool()
Behavior3/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. It discloses that this is a setup/initialization tool with a prerequisite role, which is useful behavioral context. However, it doesn't mention potential side effects (e.g., establishing a session, requiring device availability), error conditions, or what 'initialize' entails operationally. For a tool with no annotations, this leaves gaps in behavioral understanding.

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 highly concise and well-structured: two sentences with zero waste. The first sentence states the purpose, and the second provides critical usage guidance. Every word earns its place, making it easy to parse and front-loaded with essential information.

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

Completeness4/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 (0 parameters, initialization role) and the presence of an output schema (which handles return values), the description is reasonably complete. It covers purpose and prerequisites adequately. However, for a tool with no annotations, it could benefit from more behavioral details (e.g., what happens on failure, session management), slightly reducing 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 0 parameters with 100% coverage, so the baseline is 4. The description adds no parameter information, which is appropriate since there are no parameters. It implicitly confirms the lack of parameters by not mentioning any, aligning with the schema.

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 tool's purpose: 'Initialize the Android device connection' specifies the verb (initialize) and resource (Android device connection). It distinguishes from siblings by being a prerequisite setup tool rather than an action tool like mobile_click or mobile_launch_app. However, it doesn't explicitly differentiate from potential other initialization tools (none in siblings), so it's not a perfect 5.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines: 'Must be called before using any other mobile tools' clearly states when to use this tool (as a prerequisite) and when not to use it (after initialization or for other purposes). It implies alternatives by indicating this is required for all sibling tools, making usage context unambiguous.

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