Skip to main content
Glama

adb_stop_app

Stop a running Android application on a device by specifying its package name. This tool helps manage app processes and free device resources through the ADB MCP Server.

Instructions

Stop an app on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNameYesPackage name of the app to stop
deviceIdNoDevice ID (optional)

Implementation Reference

  • The main handler function that executes the ADB command to force-stop the specified app package.
    async stopApp(packageName: string, deviceId?: string) {
      try {
        const connected = await this.adbClient.isDeviceConnected(deviceId);
        if (!connected) {
          return {
            success: false,
            error: 'Device not connected',
            message: 'Cannot stop app - device is not connected'
          };
        }
    
        const command = `shell am force-stop ${packageName}`;
        const result = await this.adbClient.executeCommand(command, deviceId);
        
        if (!result.success) {
          return {
            success: false,
            error: result.error,
            message: 'Failed to stop app'
          };
        }
    
        return {
          success: true,
          data: { packageName, deviceId: deviceId || this.adbClient.getDefaultDevice() },
          message: `App ${packageName} stopped successfully`
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.message,
          message: 'Failed to stop app'
        };
      }
    }
  • Input schema definition for the adb_stop_app tool, specifying packageName as required and deviceId as optional.
    {
      name: 'adb_stop_app',
      description: 'Stop an app on the device',
      inputSchema: {
        type: 'object',
        properties: {
          packageName: {
            type: 'string',
            description: 'Package name of the app to stop',
          },
          deviceId: {
            type: 'string',
            description: 'Device ID (optional)',
          },
        },
        required: ['packageName'],
      },
    },
  • src/index.ts:459-460 (registration)
    Registration of the tool handler in the switch statement, dispatching calls to AppTools.stopApp method.
    case 'adb_stop_app':
      return await this.handleToolCall(this.appTools.stopApp(args?.packageName as string, args?.deviceId as string));
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. It states the action ('stop') but lacks critical behavioral details: it doesn't specify if this requires specific permissions, what 'stop' entails (e.g., force-stop vs. graceful shutdown), side effects (e.g., app data persistence), or error conditions. For a mutation tool with zero annotation coverage, 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 waste—it directly states the tool's purpose without fluff. It's appropriately sized for a simple tool and front-loaded with essential information. Every word earns its place.

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 the tool's complexity (a mutation operation with no annotations and no output schema), the description is incomplete. It doesn't cover behavioral aspects like permissions, effects, or error handling, and lacks output details. For a tool that stops apps, more context is needed to ensure safe and correct usage.

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 parameter descriptions in the schema. The description adds no additional meaning beyond the schema—it doesn't explain parameter interactions, default behaviors, or examples. Baseline 3 is appropriate since the schema does the heavy lifting, but the description doesn't compensate or enhance 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 ('stop') and target ('an app on the device'), which is specific and unambiguous. It distinguishes from siblings like 'adb_start_app' (opposite action) and 'adb_uninstall_app' (different operation), though it doesn't explicitly mention these distinctions. The purpose is clear but lacks explicit sibling differentiation.

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., the app must be running), when-not-to-use scenarios (e.g., system apps), or direct alternatives like 'adb_uninstall_app' for removal. Usage is implied from the tool name but not explicitly stated.

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/richard0913/adb-mcp'

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