Skip to main content
Glama

mobile_list_apps

List installed applications on Android devices to retrieve package names and app labels for device management and automation tasks.

Instructions

List all installed applications on the Android device.

Returns a JSON array with package names and application labels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:236-250 (handler)
    The handler function decorated with @mcp.tool() that lists all launchable installed apps on the Android device. It retrieves the app list using uiautomator2's device.app_list(), filters using is_launchable_app, and returns a formatted JSON string.
    @mcp.tool()
    def mobile_list_apps() -> str:
        """List all installed applications on the Android device.
        
        Returns a JSON array with package names and application labels.
        """
        if device is None:
            return "Error: Device not initialized. Please call mobile_init() first to establish connection with Android device."
        try:
            apps = device.app_list()
            launchable_apps = [pkg for pkg in apps if is_launchable_app(pkg)]
            return json.dumps(launchable_apps, ensure_ascii=False, indent=2)
        except Exception as e:
            return f"Error listing apps: {str(e)}"
  • Helper function used by mobile_list_apps to filter only launchable apps by excluding system apps and checking if cmd package resolve-activity returns a valid activity.
    def is_launchable_app(package):
        if is_system_app(package):
            return False
        
        try:
            response = device.shell(f"cmd package resolve-activity --brief {package}")
            output = response.output
            return "/" in output
        except Exception:
            return False
  • Helper function to identify and exclude system apps based on package name regex patterns, used indirectly by mobile_list_apps.
    def is_system_app(package):
        exclude_patterns = [
            r"^com\.android\.systemui",
            r"^com\.android\.providers\.",
            r"^com\.android\.internal\.",
            r"^com\.android\.cellbroadcast",
            r"^com\.android\.phone",
            r"^com\.android\.bluetooth",
            r"^com\.google\.android\.overlay",
            r"^com\.google\.mainline",
            r"^com\.google\.android\.ext",
            r"\.auto_generated_rro_",
            r"^android$",
        ]
        return any(re.search(p, package) for p in exclude_patterns)
  • main.py:236-236 (registration)
    The @mcp.tool() decorator registers the mobile_list_apps function as an MCP tool.
    @mcp.tool()

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/erichung9060/Android-Mobile-MCP'

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