Find UI Element
idb-ui-find-elementFind UI elements by semantic search of the iOS accessibility tree using labels or identifiers, returning tap-ready coordinates without screenshots.
Instructions
idb-ui-find-element
Find UI elements by semantic search in accessibility tree - no screenshots needed.
Overview
Queries the accessibility tree and searches for elements matching a label or identifier. Returns matching elements with tap-ready coordinates (centerX, centerY), enabling agents to find specific UI controls without visual analysis. Fast semantic search replaces screenshot-based visual scanning for complex UIs.
Parameters
Required
query (string): Search term to match against element labels or identifiers
Optional
exact (boolean): Exact matching instead of substring matching
elementType (string): Filter by accessibility type; can be used without query
identifier (string): Exact identifier filter; can be used without query
index (integer): Zero-based selection returned as selectedElement
udid (string): Target identifier - auto-detects if omitted
Returns
Array of matching elements with:
Type, label, identifier
Tap-ready coordinates (centerX, centerY)
Full frame boundaries (x, y, width, height)
Returns empty array if no matches found.
Examples
Find login button
const result = await idbUiFindElementTool({
query: 'login'
});Find email field on specific device
const emailField = await idbUiFindElementTool({
query: 'email',
udid: 'DEVICE-UDID'
});Find by identifier partial match
const search = await idbUiFindElementTool({
query: 'submit'
});How It Works
Query accessibility tree: Calls
idb ui describe-all(~80ms)Filter by query: Searches element labels and identifiers (case-insensitive partial match)
Return coordinates: Provides tap-ready centerX/centerY for direct use with idb-ui-tap
Related Tools
accessibility-quality-check: Quick assessment of accessibility data richnessidb-ui-describe: Full accessibility tree with all element detailsidb-ui-tap: Tap elements using coordinatesscreenshot: Visual fallback if accessibility insufficient
Notes
Uses case-insensitive partial matching ("log" matches "Login")
Returns all matching elements (filter in agent logic if needed)
Only returns elements with valid frame coordinates
Much faster than visual analysis (~80ms vs 2000ms for screenshot)
5-6x cheaper token cost (~40 tokens vs ~170 for screenshot)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "idb-ui-find-element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | No | ||
| exact | No | ||
| index | No | ||
| query | No | ||
| identifier | No | ||
| elementType | No |