Skip to main content
Glama
mobile-next

Mobile Next MCP Server

Official
by mobile-next

List Apps

mobile_list_apps
Read-only

Retrieve a list of installed applications on a mobile device for automation testing or device management purposes.

Instructions

List all the installed apps on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceYesThe device identifier to use. Use mobile_list_available_devices to find which devices are available to you.

Implementation Reference

  • src/server.ts:252-264 (registration)
    Registers the MCP tool 'mobile_list_apps' with Zod input schema (device ID) and a thin handler that delegates to the appropriate Robot.listApps() implementation.
    tool(
    	"mobile_list_apps",
    	"List Apps",
    	"List all the installed apps on the device",
    	{
    		device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you.")
    	},
    	async ({ device }) => {
    		const robot = getRobotFromDevice(device);
    		const result = await robot.listApps();
    		return `Found these apps on device: ${result.map(app => `${app.appName} (${app.packageName})`).join(", ")}`;
    	}
    );
  • AndroidRobot.listApps(): Retrieves list of installed apps with launcher activities using adb shell command.
    public async listApps(): Promise<InstalledApp[]> {
    	// only apps that have a launcher activity are returned
    	return this.adb("shell", "cmd", "package", "query-activities", "-a", "android.intent.action.MAIN", "-c", "android.intent.category.LAUNCHER")
    		.toString()
    		.split("\n")
    		.map(line => line.trim())
    		.filter(line => line.startsWith("packageName="))
    		.map(line => line.substring("packageName=".length))
    		.filter((value, index, self) => self.indexOf(value) === index)
    		.map(packageName => ({
    			packageName,
    			appName: packageName,
    		}));
    }
  • IosRobot.listApps(): Retrieves list of all installed apps using go-ios 'apps --all --list' command.
    public async listApps(): Promise<InstalledApp[]> {
    	await this.assertTunnelRunning();
    
    	const output = await this.ios("apps", "--all", "--list");
    	return output
    		.split("\n")
    		.map(line => {
    			const [packageName, appName] = line.split(" ");
    			return {
    				packageName,
    				appName,
    			};
    		});
    }
  • MobileDevice.listApps(): Retrieves list of installed apps using mobilecli 'apps list' command via JSON response.
    public async listApps(): Promise<InstalledApp[]> {
    	const response = JSON.parse(this.runCommand(["apps", "list"])) as InstalledAppsResponse;
    	return response.data.map(app => ({
    		appName: app.appName || app.packageName,
    		packageName: app.packageName,
    	})) as InstalledApp[];
    }
  • Helper function to resolve device ID to the correct Robot instance (IosRobot, AndroidRobot, or MobileDevice) for executing listApps() and other methods.
    const getRobotFromDevice = (deviceId: string): Robot => {
    
    	// from now on, we must have mobilecli working
    	ensureMobilecliAvailable();
    
    	// Check if it's an iOS device
    	const iosManager = new IosManager();
    	const iosDevices = iosManager.listDevices();
    	const iosDevice = iosDevices.find(d => d.deviceId === deviceId);
    	if (iosDevice) {
    		return new IosRobot(deviceId);
    	}
    
    	// Check if it's an Android device
    	const androidManager = new AndroidDeviceManager();
    	const androidDevices = androidManager.getConnectedDevices();
    	const androidDevice = androidDevices.find(d => d.deviceId === deviceId);
    	if (androidDevice) {
    		return new AndroidRobot(deviceId);
    	}
    
    	// Check if it's a simulator (will later replace all other device types as well)
    	const response = mobilecli.getDevices({
    		platform: "ios",
    		type: "simulator",
    		includeOffline: false,
    	});
    
    	if (response.status === "ok" && response.data && response.data.devices) {
    		for (const device of response.data.devices) {
    			if (device.id === deviceId) {
    				return new MobileDevice(deviceId);
    			}
    		}
    	}
    
    	throw new ActionableError(`Device "${deviceId}" not found. Use the mobile_list_available_devices tool to see available devices.`);
    };
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=true, indicating a safe read operation. The description adds context by specifying 'installed apps on the device', which clarifies the scope beyond just listing. However, it lacks details on behavioral traits like return format, pagination, or error conditions, which are not covered by annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded with the core action and resource, making it easy to understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, read-only), no output schema, and good annotations, the description is minimally adequate. However, it could be more complete by addressing output expectations or error handling, which are not covered elsewhere.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'device' fully documented in the schema. The description does not add any semantic details beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and the resource 'installed apps on the device', making the purpose unambiguous. However, it does not explicitly differentiate from sibling tools like 'mobile_list_available_devices' or 'mobile_list_elements_on_screen', which also list things but different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to see installed apps, but provides no explicit guidance on when to use this tool versus alternatives like 'mobile_launch_app' or 'mobile_install_app'. The input schema hints at using 'mobile_list_available_devices' first, but this is not stated in the description itself.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/mobile-next/mobile-mcp'

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