Skip to main content
Glama

kill_app

Terminate a running app on a mobile device by providing its bundle ID or package name.

Instructions

Ferme une app sur le device actif.

Input Schema

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

Implementation Reference

  • Main tool handler for 'kill_app' - resolves the active device, then dispatches to iOS or Android platform-specific kill function. Registered as an MCP tool with Zod schema expecting 'bundle_id' string parameter.
    export function registerKillApp(server: McpServer): void {
      server.tool(
        "kill_app",
        "Ferme une app sur le device actif.",
        {
          bundle_id: z.string().describe("Bundle ID (iOS) ou package name (Android)"),
        },
        async ({ bundle_id }) => {
          const killResult = await resolveDevice();
          if ("error" in killResult) return { content: [{ type: "text", text: killResult.error }], isError: true };
          const dev = killResult.device;
    
          try {
            if (dev.platform === "ios") await iosKillApp(dev.id, bundle_id);
            else await androidKillApp(bundle_id);
    
            logAction("kill_app", `App fermée : ${bundle_id}`, false, dev.platform, dev.id, dev.name);
            return { content: [{ type: "text", text: `App fermée : ${bundle_id}` }] };
          } catch (err) {
            const msg = err instanceof Error ? err.message : String(err);
            return { content: [{ type: "text", text: `Erreur kill_app: ${msg}` }], isError: true };
          }
        }
      );
  • Multi-device handler for 'kill_app' action - iterates over specified devices and calls platform-specific kill function for each.
    case "kill_app": {
      if (dev.platform === "ios") await iosKillApp(dev.id, bundle_id!);
      else await androidKillApp(bundle_id!);
      content.push({ type: "text", text: `${header} — ${bundle_id} ferme\n` });
      break;
    }
  • iOS implementation - terminates an app on a simulator using `xcrun simctl terminate <udid> <bundleId>`.
    export async function iosKillApp(deviceUdid: string, bundleId: string): Promise<void> {
      validateUdid(deviceUdid);
      validateBundleId(bundleId);
      await simctl(["terminate", deviceUdid, bundleId]);
    }
  • Android implementation - force-stops an app using `adb shell am force-stop <packageName>`.
    export async function androidKillApp(packageName: string): Promise<void> {
      validatePackageName(packageName);
      await adb(["shell", "am", "force-stop", packageName]);
    }
  • src/index.ts:64-64 (registration)
    Registration of the kill_app tool via registerKillApp(server) on the MCP server. The function is imported from ./tools/app.js at line 14.
    registerKillApp(server);
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It only says 'Ferme une app' without detailing whether it terminates the process, saves state, or affects background tasks. This is insufficient for a destructive action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence with no extraneous words. However, the French language may reduce clarity for English-speaking agents, and the structure does not front-load key information beyond the verb.

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?

For a simple tool with one parameter and no output schema or annotations, the description is too sparse. It omits mention of success/failure indications, error conditions, or device readiness, leaving the agent underinformed.

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% and the schema already describes the single parameter (bundle_id). The description adds no additional meaning or usage advice, meeting the baseline for high coverage but not exceeding it.

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 ('Ferme une app') and the target ('sur le device actif'), effectively distinguishing it from sibling tools like launch_app. However, it lacks nuance such as whether it performs a graceful close or a force kill.

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 implies use to close an app, but provides no explicit guidance on when to use it versus alternatives, nor any mention of prerequisites or when not to use it. The context is clear but omit exclusions.

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