Skip to main content
Glama

uninstall_app

Remove applications from Android devices by specifying package names, enabling app management through the Android MCP Server's device control capabilities.

Instructions

Uninstall an application from the Android device. Requires allowDestructiveOps to be enabled in server configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
package_nameYesAndroid package name to uninstall
device_idNoDevice serial number

Implementation Reference

  • The actual implementation of the uninstall logic that executes the ADB command.
    export async function uninstallApp(packageName: string, deviceId?: string): Promise<string> {
      const config = getConfig();
      if (!config.allowDestructiveOps) {
        throw new SecurityError(
          'Uninstall is a destructive operation. Set allowDestructiveOps=true in config to enable.',
          { packageName }
        );
      }
    
      const resolved = await deviceManager.resolveDeviceId(deviceId);
      validatePackageName(packageName);
    
      const result = await adbShell(['pm', 'uninstall', packageName], resolved);
    
      if (result.stdout.includes('Success')) {
        log.info('App uninstalled', { packageName, deviceId: resolved });
        return `Successfully uninstalled: ${packageName}`;
      }
    
      throw new Error(`Uninstall failed: ${result.stdout} ${result.stderr}`);
    }
  • MCP tool registration for 'uninstall_app'.
    server.registerTool(
      'uninstall_app',
      {
        description: 'Uninstall an application from the Android device. Requires allowDestructiveOps to be enabled in server configuration.',
        inputSchema: {
          package_name: z.string().describe('Android package name to uninstall'),
          device_id: z.string().optional().describe('Device serial number'),
        },
      },
      async ({ package_name, device_id }) => {
        return await metrics.measure('uninstall_app', device_id || 'default', async () => {
          const result = await uninstallApp(package_name, device_id);
          return {
            content: [{
              type: 'text' as const,
              text: JSON.stringify({ success: true, message: result }, null, 2),
            }],
          };
        });
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden and discloses the destructive nature and server constraint via the allowDestructiveOps requirement. It fails to clarify whether app data is preserved, if the operation is reversible, or what happens when the package is not found.

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 consists of exactly two sentences with zero redundancy: the first declares the action and the second states the critical prerequisite. Information is front-loaded with the primary verb, and every word serves a necessary function.

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?

For a two-parameter destructive operation, the description adequately covers the essential safety guard (allowDestructiveOps) and the schema fully documents inputs. It is missing only details on failure modes and return values, which would be helpful given the lack of an output schema.

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?

The input schema achieves 100% description coverage with 'Android package name to uninstall' and 'Device serial number,' making the parameters self-documenting. The description does not add syntax details or examples beyond what the schema provides, meeting the baseline for high-coverage schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with the specific verb 'Uninstall' followed by the clear resource target 'an application from the Android device,' precisely defining the scope. This effectively distinguishes the tool from siblings like close_app (which merely stops apps) or install_apk (which adds rather than removes software).

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

Usage Guidelines4/5

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

The description provides critical usage context by stating 'Requires allowDestructiveOps to be enabled in server configuration,' establishing a necessary prerequisite. However, it lacks explicit guidance on when to prefer this over close_app for temporary shutdowns or alternatives for system apps.

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/divineDev-dotcom/android_mcp'

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