ui_describe_all
Retrieve accessibility information for the entire screen in iOS Simulator to inspect UI elements and analyze screen content for testing and development purposes.
Instructions
Describes accessibility information for the entire screen in the iOS Simulator
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | No | Udid of target, can also be set with the IDB_UDID env var |
Implementation Reference
- src/index.ts:225-268 (registration)Registration of the 'ui_describe_all' tool using server.tool(), conditional on not being filtered. Includes schema validation and handler function.if (!isToolFiltered("ui_describe_all")) { server.tool( "ui_describe_all", "Describes accessibility information for the entire screen in the iOS Simulator", { udid: z .string() .regex(UDID_REGEX) .optional() .describe("Udid of target, can also be set with the IDB_UDID env var"), }, async ({ udid }) => { try { const actualUdid = await getBootedDeviceId(udid); const { stdout } = await idb( "ui", "describe-all", "--udid", actualUdid, "--json", "--nested" ); return { isError: false, content: [{ type: "text", text: stdout }], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error describing all of the ui: ${toError(error).message}` ), }, ], }; } } ); }
- src/index.ts:236-266 (handler)Handler function executes idb 'ui describe-all --json --nested' on the target UDID (defaulting to booted simulator) and returns the stdout as text content, with error handling.async ({ udid }) => { try { const actualUdid = await getBootedDeviceId(udid); const { stdout } = await idb( "ui", "describe-all", "--udid", actualUdid, "--json", "--nested" ); return { isError: false, content: [{ type: "text", text: stdout }], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error describing all of the ui: ${toError(error).message}` ), }, ], }; } }
- src/index.ts:229-235 (schema)Input schema using Zod: optional 'udid' string matching UDID_REGEX.{ udid: z .string() .regex(UDID_REGEX) .optional() .describe("Udid of target, can also be set with the IDB_UDID env var"), },
- src/index.ts:17-18 (helper)UDID_REGEX constant used for validating the udid parameter in the schema.const UDID_REGEX = /^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;
- src/index.ts:141-154 (helper)getBootedDeviceId helper function used in the handler to resolve the target UDID.async function getBootedDeviceId( deviceId: string | undefined ): Promise<string> { // If deviceId not provided, get the currently booted simulator let actualDeviceId = deviceId; if (!actualDeviceId) { const { id } = await getBootedDevice(); actualDeviceId = id; } if (!actualDeviceId) { throw new Error("No booted simulator found and no deviceId provided"); } return actualDeviceId; }