ui_describe_all
Retrieves accessibility information for all UI elements visible on the iOS Simulator screen.
Instructions
Describes accessibility information for the entire screen in the iOS Simulator
Input 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:281-284 (registration)Conditional registration of the ui_describe_all tool, wrapped in isToolFiltered check
if (!isToolFiltered("ui_describe_all")) { server.tool( "ui_describe_all", "Describes accessibility information for the entire screen in the iOS Simulator", - src/index.ts:285-291 (schema)Input schema for ui_describe_all: accepts an optional udid parameter (UUID format)
{ udid: z .string() .regex(UDID_REGEX) .optional() .describe("Udid of target, can also be set with the IDB_UDID env var"), }, - src/index.ts:293-324 (handler)Handler function for ui_describe_all: resolves UDID, calls idb ui describe-all --udid --json --nested, returns accessibility info as text
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:713-741 (helper)ui_describe_all result reused by ui_view tool to get screen dimensions (width/height in points) for screenshot resizing
// Get screen dimensions in points from ui_describe_all const { stdout: uiDescribeOutput } = await idb( "ui", "describe-all", "--udid", actualUdid, "--json", "--nested" ); let uiData: unknown; try { uiData = JSON.parse(uiDescribeOutput); } catch { throw new Error("Failed to parse screen dimensions: idb returned invalid JSON"); } const screenFrame = (uiData as Array<{ frame?: { width: unknown; height: unknown } }>)[0]?.frame; if ( !screenFrame || typeof screenFrame.width !== "number" || typeof screenFrame.height !== "number" || screenFrame.width <= 0 || screenFrame.height <= 0 ) { throw new Error("Could not determine valid screen dimensions from idb output"); } const pointWidth = screenFrame.width; const pointHeight = screenFrame.height;