Skip to main content
Glama

android_launch_app

Launch Android applications by specifying their package name, enabling quick app access for testing or automation workflows.

Instructions

Launch an Android app by package name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNameYesPackage name of the app to launch (e.g., com.example.app)
deviceSerialNoSpecific device serial number to target (optional)

Implementation Reference

  • Core handler function for the 'android_launch_app' tool. Validates arguments, calls ADBWrapper.launchApp, and returns success/error response.
    export async function launchAppHandler(
      adb: ADBWrapper,
      args: any
    ): Promise<{ content: Array<{ type: string; text: string }> }> {
      const { packageName, deviceSerial } = args as LaunchAppArgs;
    
      if (!packageName || typeof packageName !== 'string') {
        throw new Error('Invalid package name: packageName must be a non-empty string');
      }
    
      try {
        await adb.launchApp(packageName, deviceSerial);
    
        return {
          content: [
            {
              type: 'text',
              text: `Successfully launched app: ${packageName}`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`Launch app failed: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • MCP tool schema definition for 'android_launch_app', including input schema with packageName (required) and optional deviceSerial.
    {
      name: 'android_launch_app',
      description: 'Launch an Android app by package name',
      inputSchema: {
        type: 'object',
        properties: {
          packageName: {
            type: 'string',
            description: 'Package name of the app to launch (e.g., com.example.app)',
          },
          deviceSerial: {
            type: 'string',
            description: 'Specific device serial number to target (optional)',
          },
        },
        required: ['packageName'],
      },
    },
  • src/index.ts:470-471 (registration)
    Tool dispatch registration in the CallToolRequestSchema handler switch statement.
    case 'android_launch_app':
      return await launchAppHandler(this.adb, args);
  • TypeScript interface defining input arguments for the launchAppHandler.
    interface LaunchAppArgs {
      packageName: string;
      deviceSerial?: string;
    }
  • Low-level ADB command execution: launches app using 'adb shell monkey -p <package> -c android.intent.category.LAUNCHER 1'
    async launchApp(packageName: string, deviceSerial?: string): Promise<void> {
      const device = await this.getTargetDevice(deviceSerial);
      await this.exec(['shell', 'monkey', '-p', packageName, '-c', 'android.intent.category.LAUNCHER', '1'], device);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action ('Launch') but doesn't describe what happens (e.g., app opens on device, may fail if not installed, requires device to be connected/on), permissions needed, or error conditions. This is a significant gap for a tool with potential side effects.

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 waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool that performs an action with potential side effects. It lacks details on behavior (e.g., success/failure states, device requirements), return values, or error handling, which are crucial for an agent to use it correctly in context with sibling tools.

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 100%, with clear descriptions for both parameters (package name and optional device serial). The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate since the schema does the heavy lifting.

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 ('Launch') and target resource ('Android app by package name'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'android_list_packages' or 'android_execute_command' that might also interact with apps, leaving some ambiguity about its unique role.

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. It doesn't mention prerequisites (e.g., device connectivity), exclusions (e.g., apps not installed), or compare it to siblings like 'android_execute_command' for broader commands or 'android_list_packages' for discovery, leaving the agent to infer usage context.

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/jduartedj/android-mcp-server'

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