Skip to main content
Glama

List Devices

mobile_list_available_devices
Read-only

Lists available iOS and Android devices and simulators for mobile automation testing, enabling users to select a target device.

Instructions

List all available devices. This includes both physical devices and simulators. If there is more than one device returned, you need to let the user select one of them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noParamsYes

Implementation Reference

  • Handler function that lists available devices by querying iOS, Android managers and simulators, categorizing them into iOS simulators, iOS devices, Android mobile, Android TV, and formats a response string.
    async ({}) => {
    	const iosManager = new IosManager();
    	const androidManager = new AndroidDeviceManager();
    	const simulators = simulatorManager.listBootedSimulators();
    	const simulatorNames = simulators.map(d => d.name);
    	const androidDevices = androidManager.getConnectedDevices();
    	const iosDevices = await iosManager.listDevices();
    	const iosDeviceNames = iosDevices.map(d => d.deviceId);
    	const androidTvDevices = androidDevices.filter(d => d.deviceType === "tv").map(d => d.deviceId);
    	const androidMobileDevices = androidDevices.filter(d => d.deviceType === "mobile").map(d => d.deviceId);
    
    	const resp = ["Found these devices:"];
    	if (simulatorNames.length > 0) {
    		resp.push(`iOS simulators: [${simulatorNames.join(".")}]`);
    	}
    
    	if (iosDevices.length > 0) {
    		resp.push(`iOS devices: [${iosDeviceNames.join(",")}]`);
    	}
    
    	if (androidMobileDevices.length > 0) {
    		resp.push(`Android devices: [${androidMobileDevices.join(",")}]`);
    	}
    
    	if (androidTvDevices.length > 0) {
    		resp.push(`Android TV devices: [${androidTvDevices.join(",")}]`);
    	}
    
    	return resp.join("\n");
    }
  • src/server.ts:149-185 (registration)
    Tool registration call that defines the name, description, empty input schema (noParams = z.object({})), and references the handler function.
    tool(
    	"mobile_list_available_devices",
    	"List all available devices. This includes both physical devices and simulators. If there is more than one device returned, you need to let the user select one of them.",
    	{
    		noParams
    	},
    	async ({}) => {
    		const iosManager = new IosManager();
    		const androidManager = new AndroidDeviceManager();
    		const simulators = simulatorManager.listBootedSimulators();
    		const simulatorNames = simulators.map(d => d.name);
    		const androidDevices = androidManager.getConnectedDevices();
    		const iosDevices = await iosManager.listDevices();
    		const iosDeviceNames = iosDevices.map(d => d.deviceId);
    		const androidTvDevices = androidDevices.filter(d => d.deviceType === "tv").map(d => d.deviceId);
    		const androidMobileDevices = androidDevices.filter(d => d.deviceType === "mobile").map(d => d.deviceId);
    
    		const resp = ["Found these devices:"];
    		if (simulatorNames.length > 0) {
    			resp.push(`iOS simulators: [${simulatorNames.join(".")}]`);
    		}
    
    		if (iosDevices.length > 0) {
    			resp.push(`iOS devices: [${iosDeviceNames.join(",")}]`);
    		}
    
    		if (androidMobileDevices.length > 0) {
    			resp.push(`Android devices: [${androidMobileDevices.join(",")}]`);
    		}
    
    		if (androidTvDevices.length > 0) {
    			resp.push(`Android TV devices: [${androidTvDevices.join(",")}]`);
    		}
    
    		return resp.join("\n");
    	}
    );
  • Shared empty schema object used as input parameters for tools with no arguments, including mobile_list_available_devices.
    const noParams = z.object({});

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / noParams / additionalProperties
      Removed value: -false
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

The description adds behavioral context beyond annotations: it specifies that the list includes 'both physical devices and simulators' and mentions user interaction for selection when multiple devices are returned. Annotations provide readOnlyHint=true, indicating a safe read operation, which the description doesn't contradict. However, it doesn't disclose other traits like rate limits, pagination, or error handling, leaving some gaps.

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

Conciseness4/5

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

The description is concise and front-loaded: the first sentence states the core purpose, and the second adds necessary behavioral detail. Both sentences earn their place by providing essential information without redundancy. However, it could be slightly more structured by explicitly separating purpose from guidelines.

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 (no parameters, read-only operation) and lack of output schema, the description is moderately complete. It covers the purpose and some behavioral aspects but doesn't explain the return format (e.g., device identifiers, types) or error conditions. With annotations handling safety, it's adequate but has clear gaps in output expectations.

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

Parameters4/5

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

The input schema has 1 parameter (noParams) with 0% description coverage, meaning the schema provides no semantic information. The description compensates by implying no parameters are needed for listing devices, as it doesn't mention any inputs. This effectively clarifies the tool's parameterless nature, though it could be more explicit about the empty parameter requirement.

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 tool's purpose: 'List all available devices' with the scope 'both physical devices and simulators'. It specifies the verb ('List') and resource ('available devices'), distinguishing it from sibling tools that perform actions on devices (e.g., mobile_click_on_screen_at_coordinates) or list other resources (e.g., mobile_list_apps). However, it doesn't explicitly differentiate from mobile_list_apps in terms of resource type, which slightly reduces specificity.

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 by stating 'If there is more than one device returned, you need to let the user select one of them', which suggests this tool is for initial device discovery before other operations. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., no mention of prerequisites or comparisons to sibling tools like mobile_get_orientation). The context is clear but not comprehensive.

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