Skip to main content
Glama

adb_package_manager

Manage Android app packages through ADB commands to install, uninstall, list, or modify permissions on connected devices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pmCommandYesPackage Manager subcommand, e.g. 'list', 'install', 'uninstall', 'grant', 'revoke', etc.
pmArgsNoArguments for the pm subcommand, e.g. 'packages', 'com.example.app android.permission.CAMERA'
deviceNoSpecific device ID (optional)

Implementation Reference

  • The handler function that implements the core logic of the adb_package_manager tool by constructing and executing the appropriate adb shell pm command.
    async (args: z.infer<typeof AdbPackageManagerSchema>, _extra: RequestHandlerExtra) => { log(LogLevel.INFO, `Executing Package Manager command: pm ${args.pmCommand} ${args.pmArgs || ''}`); const deviceArgs = buildDeviceArgs(args.device); const pmCommand = args.pmCommand.trim(); if (!pmCommand) { const message = "Package Manager command must not be empty"; log(LogLevel.ERROR, message); return { content: [{ type: "text" as const, text: message }], isError: true }; } const additionalArgs = args.pmArgs ? splitCommandArguments(args.pmArgs) : []; return executeAdbCommand([...deviceArgs, "shell", "pm", pmCommand, ...additionalArgs], "Error executing Package Manager command"); },
  • src/index.ts:753-773 (registration)
    The server.tool call that registers the adb_package_manager tool with the MCP server, including name, input schema, handler, and description.
    server.tool( "adb_package_manager", AdbPackageManagerSchema.shape, async (args: z.infer<typeof AdbPackageManagerSchema>, _extra: RequestHandlerExtra) => { log(LogLevel.INFO, `Executing Package Manager command: pm ${args.pmCommand} ${args.pmArgs || ''}`); const deviceArgs = buildDeviceArgs(args.device); const pmCommand = args.pmCommand.trim(); if (!pmCommand) { const message = "Package Manager command must not be empty"; log(LogLevel.ERROR, message); return { content: [{ type: "text" as const, text: message }], isError: true }; } const additionalArgs = args.pmArgs ? splitCommandArguments(args.pmArgs) : []; return executeAdbCommand([...deviceArgs, "shell", "pm", pmCommand, ...additionalArgs], "Error executing Package Manager command"); }, { description: ADB_PACKAGE_MANAGER_TOOL_DESCRIPTION } );
  • Zod schema defining the input shape for the adb_package_manager tool, including pmCommand, optional pmArgs, and optional device.
    export const adbPackageManagerSchema = z.object({ pmCommand: z.string().describe("Package Manager subcommand, e.g. 'list', 'install', 'uninstall', 'grant', 'revoke', etc."), pmArgs: z.string().optional().describe("Arguments for the pm subcommand, e.g. 'packages', 'com.example.app android.permission.CAMERA'"), device: z.string().optional().describe("Specific device ID (optional)") });

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

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