Skip to main content
Glama

mobile_list_available_devices

Retrieve and display all available devices, including physical devices and simulators, for mobile automation. Facilitates user selection when multiple devices are identified.

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 all available devices including iOS simulators, physical iOS devices, Android mobile devices, and Android TV devices by querying the respective device managers.
    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 for 'mobile_list_available_devices' using the internal 'tool' wrapper function, specifying name, description, empty input schema (noParams), and inline handler.
    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 for tools with no input parameters, 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