Skip to main content
Glama

adb_list_apps

List installed applications on an Android device to manage apps or troubleshoot issues. Use this tool to retrieve app packages and names from connected devices.

Instructions

List installed apps on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdNoDevice ID (optional)

Implementation Reference

  • The handler function `listInstalledApps` that lists installed third-party apps using `adb shell pm list packages -3`, parses the output, and returns a structured response.
    async listInstalledApps(deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot list apps - device is not connected' }; } const command = 'shell pm list packages -3'; const result = await this.adbClient.executeCommand(command, deviceId); if (!result.success) { return { success: false, error: result.error, message: 'Failed to list installed apps' }; } const packages = result.output .split('\n') .map(line => line.replace('package:', '').trim()) .filter(line => line.length > 0); return { success: true, data: { packages, count: packages.length, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `Found ${packages.length} installed apps` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to list installed apps' }; } }
  • Tool schema definition in the ListTools response, specifying name, description, and optional deviceId input.
    { name: 'adb_list_apps', description: 'List installed apps on the device', inputSchema: { type: 'object', properties: { deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: [], }, },
  • src/index.ts:461-462 (registration)
    Registration and dispatch in the CallToolRequest switch statement, mapping the tool name to the AppTools.listInstalledApps handler.
    case 'adb_list_apps': return await this.handleToolCall(this.appTools.listInstalledApps(args?.deviceId as string));

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