Skip to main content
Glama

list_packages

List installed packages on Android devices with optional filtering by name or system status to identify applications for development, testing, or debugging workflows.

Instructions

List installed packages, optionally filtered

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_textNo
include_systemNo
device_serialNo

Implementation Reference

  • The handler function that implements the logic for the 'list_packages' MCP tool. It executes ADB commands to list installed packages, filters them based on parameters, and returns a sorted list of package names.
    @mcp.tool() def list_packages( filter_text: str = "", include_system: bool = False, device_serial: str | None = None ) -> list[str]: """List installed packages, optionally filtered""" args = ["shell", "pm", "list", "packages"] if not include_system: args.append("-3") # Third-party only output = run_adb(args, device_serial) packages = [line.replace("package:", "").strip() for line in output.split('\n') if line.strip()] if filter_text: packages = [p for p in packages if filter_text.lower() in p.lower()] return sorted(packages)

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/rahulkr/r_adb_mcp_server'

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