list_devices
Retrieve registered iOS and macOS devices for your App Store Connect team, with options to filter, sort, and limit results for efficient device management.
Instructions
Get a list of all devices registered to your team
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of devices to return (default: 100, max: 200) | |
| sort | No | Sort order for the results | |
| filter | No | ||
| fields | No |
Implementation Reference
- src/handlers/devices.ts:13-35 (handler)The main handler function that implements the list_devices tool logic. It constructs query parameters from input args and calls the App Store Connect API endpoint '/devices'.
async listDevices(args: { limit?: number; sort?: DeviceSortOptions; filter?: DeviceFilters; fields?: { devices?: DeviceFieldOptions[]; }; } = {}): Promise<ListDevicesResponse> { const { limit = 100, sort, filter, fields } = args; const params: Record<string, any> = { limit: sanitizeLimit(limit) }; if (sort) { params.sort = sort; } Object.assign(params, buildFilterParams(filter)); Object.assign(params, buildFieldParams(fields)); return this.client.get<ListDevicesResponse>('/devices', params); } - src/types/devices.ts:1-47 (schema)TypeScript interfaces and types defining the input parameters (filters, sort, fields) and output response structure (ListDevicesResponse) for the list_devices tool.
export type DevicePlatform = "IOS" | "MAC_OS"; export type DeviceStatus = "ENABLED" | "DISABLED"; export type DeviceClass = "APPLE_WATCH" | "IPAD" | "IPHONE" | "IPOD" | "APPLE_TV" | "MAC"; export interface Device { id: string; type: string; attributes: { name: string; platform: DevicePlatform; udid: string; deviceClass: DeviceClass; status: DeviceStatus; model?: string; addedDate?: string; }; } export interface ListDevicesResponse { data: Device[]; } export interface DeviceFilters { name?: string; platform?: DevicePlatform; status?: DeviceStatus; udid?: string; deviceClass?: DeviceClass; } export type DeviceSortOptions = | "name" | "-name" | "platform" | "-platform" | "status" | "-status" | "udid" | "-udid" | "deviceClass" | "-deviceClass" | "model" | "-model" | "addedDate" | "-addedDate"; export type DeviceFieldOptions = | "name" | "platform" | "udid" | "deviceClass" | "status" | "model" | "addedDate"; - src/handlers/devices.ts:8-10 (helper)The DeviceHandlers class constructor that receives the AppStoreConnectClient instance, used to instantiate the handler.
import { sanitizeLimit, buildFilterParams, buildFieldParams } from '../utils/index.js'; export class DeviceHandlers {