Skip to main content
Glama

listDeviceImages

Retrieve available device images for Android or iOS platforms to support mobile automation testing and development.

Instructions

List all available device images for the specified platform

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesTarget platform

Implementation Reference

  • Main execution handler for the 'listDeviceImages' MCP tool. Instantiates DeviceUtils and calls listDeviceImages(platform), then formats response.
    const listDeviceImagesHandler = async (args: listDeviceImagesArgs) => { try { const deviceUtils = new DeviceUtils(); const imageList = await deviceUtils.listDeviceImages(args.platform); return createJSONToolResponse({ message: `Found ${imageList.length} available ${args.platform} AVDs`, images: imageList, count: imageList.length, platform: args.platform }); } catch (error) { throw new ActionableError(`Failed to list ${args.platform} AVDs: ${error}`); } };
  • Zod input schema validation for listDeviceImages tool: requires 'platform' as 'android' or 'ios'.
    export const listDeviceImagesSchema = z.object({ platform: z.enum(["android", "ios"]).describe("Target platform") });
  • ToolRegistry registration of 'listDeviceImages' with name, description, schema, and handler.
    ToolRegistry.register( "listDeviceImages", "List all available device images for the specified platform", listDeviceImagesSchema, listDeviceImagesHandler );
  • Core helper method DeviceUtils.listDeviceImages that routes to AndroidEmulator.listAvds() or Simctl.listSimulatorImages() based on platform.
    async listDeviceImages(platform: SomePlatform): Promise<DeviceInfo[]> { switch (platform) { case "android": return this.emulator.listAvds(); case "ios": return this.simctl.listSimulatorImages(); case "either": const emulators = await this.emulator.listAvds(); const simulators = await this.simctl.listSimulatorImages(); return [...emulators, ...simulators]; } }
  • Android-specific helper: executes 'avdmanager list avd', parses output to list available AVD images (used by AndroidEmulator.listAvds()).
    export async function listDeviceImages(dependencies = createDefaultDependencies()): Promise<AvdInfo[]> { try { const location = await ensureToolsAvailable(dependencies); const avdmanagerPath = getAvdManagerPath(location, dependencies); const result = await spawnCommand(avdmanagerPath, ["list", "avd"], {}, dependencies); if (result.exitCode !== 0) { throw new Error(`Failed to list AVDs: ${result.stderr}`); } return parseAvdList(result.stdout); } catch (error) { dependencies.logger.error(`Failed to list AVDs: ${(error as Error).message}`); throw error; } }

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/zillow/auto-mobile'

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