list_apps
Retrieve a list of all installed applications on a connected Android device using the 'list_apps' tool within the espresso-mcp server. Ideal for monitoring and managing app inventory.
Instructions
List all installed apps on the connected Android device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/espresso_mcp/server.py:102-111 (handler)Handler function for the 'list_apps' tool. Uses 'adb shell pm list packages' to retrieve the list of installed packages on the connected Android device and returns them as a list of package names.@mcp.tool() def list_apps() -> list: """List all installed apps on the connected Android device""" result = subprocess.run( ["adb", "shell", "pm", "list", "packages"], capture_output=True, text=True ) if result.returncode != 0: raise RuntimeError(f"Error listing installed apps: {result.stderr}") apps = [line.replace("package:", "").strip() for line in result.stdout.splitlines()] return apps
- src/espresso_mcp/server.py:102-102 (registration)The @mcp.tool() decorator registers the list_apps function as an MCP tool.@mcp.tool()