Skip to main content
Glama

launch_app

Launch a mobile app on an active device using its bundle ID (iOS) or package name (Android).

Instructions

Lance une app sur le device actif. iOS : bundle ID (ex: com.monapp.ios). Android : package name (ex: com.monapp.android).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bundle_idYesBundle ID (iOS) ou package name (Android)

Implementation Reference

  • Main handler for the 'launch_app' tool. Registers the tool with an MCP server, accepts a 'bundle_id' parameter, resolves the active device, then calls the platform-specific launch function (iosLaunchApp or androidLaunchApp). Returns success/error messages.
    export function registerLaunchApp(server: McpServer): void {
      server.tool(
        "launch_app",
        "Lance une app sur le device actif. iOS : bundle ID (ex: com.monapp.ios). Android : package name (ex: com.monapp.android).",
        {
          bundle_id: z.string().describe("Bundle ID (iOS) ou package name (Android)"),
        },
        async ({ bundle_id }) => {
          const result = await resolveDevice();
          if ("error" in result) return { content: [{ type: "text", text: result.error }], isError: true };
          const dev = result.device;
    
          try {
            if (dev.platform === "ios") await iosLaunchApp(dev.id, bundle_id);
            else await androidLaunchApp(bundle_id);
    
            const platform = dev.platform === "ios" ? "🍎" : "🤖";
            const successMsg = `${platform} App lancée : ${bundle_id} sur ${dev.name}`;
            logAction("launch_app", successMsg, false, dev.platform, dev.id, dev.name);
            return { content: [{ type: "text", text: successMsg }] };
          } catch (err) {
            const msg = err instanceof Error ? err.message : String(err);
            logAction("launch_app", `Erreur: ${msg}`, true, dev.platform, dev.id, dev.name);
            return { content: [{ type: "text", text: `Erreur launch_app: ${msg}` }], isError: true };
          }
        }
      );
    }
  • Input schema for the launch_app tool. Defines 'bundle_id' as a required string parameter for bundle ID (iOS) or package name (Android).
    {
      bundle_id: z.string().describe("Bundle ID (iOS) ou package name (Android)"),
    },
  • src/index.ts:14-14 (registration)
    Import of the registerLaunchApp function from the tools/app module.
    import { registerLaunchApp, registerKillApp } from "./tools/app.js";
  • src/index.ts:63-63 (registration)
    Registration of the launch_app tool with the MCP server instance.
    registerLaunchApp(server);
  • iOS implementation of app launch. Validates UDID and bundle ID, then executes 'xcrun simctl launch <udid> <bundleId>'.
    export async function iosLaunchApp(deviceUdid: string, bundleId: string): Promise<void> {
      validateUdid(deviceUdid);
      validateBundleId(bundleId);
      await simctl(["launch", deviceUdid, bundleId]);
    }
  • Android implementation of app launch. Validates package name, then executes 'adb shell monkey -p <package> -c android.intent.category.LAUNCHER 1'.
    export async function androidLaunchApp(packageName: string): Promise<void> {
      validatePackageName(packageName);
      await adb(["shell", "monkey", "-p", packageName, "-c", "android.intent.category.LAUNCHER", "1"]);
    }
  • Marks 'launch_app' as a tool that always gets a screenshot in auto-reporting.
    const ALWAYS_SCREENSHOT_TOOLS = new Set(["assert_visible", "assert_not_visible", "accessibility_audit", "launch_app"]);
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only states the action without detailing side effects, waiting behavior, or what happens if the app is already running.

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?

Two sentences, no wasted words, effectively communicates purpose and platform-specific details. Ideal conciseness.

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?

For a simple 1-parameter tool with no output schema, the description covers purpose and input format. However, it omits behavioral details and error scenarios, leaving some gaps for an agent.

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 coverage is 100%, so the schema already documents the parameter. The description adds examples but no new meaning beyond the schema's description. Baseline of 3 is appropriate.

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 it launches an app on the active device, with specific instructions for iOS and Android. However, it does not explicitly differentiate from sibling tools like deep_link or kill_app.

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

Usage Guidelines3/5

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

The description provides platform-specific format information (bundle ID, package name) but lacks guidance on when to use this tool versus alternatives, nor does it mention prerequisites or 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/nthImpulse/phantom-mcp'

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