Skip to main content
Glama

mobile_list_available_devices

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({});

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/EmpathySlainLovers/MCP'

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