devices
Lists connected Android devices for viewing and editing preferences during app development.
Instructions
Lists connected Android devices
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/common.ts:13-32 (registration)Registers the 'devices' tool on the MCP server. The inline handler lists connected Android devices by calling the external listDevices() function, maps device serials to text markdown content blocks, and handles errors gracefully.server.tool("devices", "Lists connected Android devices", async () => { try { return { content: (await listDevices()).map((device) => ({ type: "text", text: device.serial, })), }; } catch (error) { return { isError: true, content: [ { type: "text", text: error instanceof Error ? error.message : "Unknown error", }, ], }; } });
- src/schema.ts:3-5 (schema)Defines the DeviceSchema Zod schema for device connections, imported into common.ts and used for subsequent device-related tools like list_apps.export const DeviceSchema = z.object({ deviceId: z.string().describe("The device's serial number."), });
- src/index.ts:22-22 (registration)Calls configureCommonTools(server), which executes the registration of the 'devices' tool and other common tools.configureCommonTools(server);