xcresult_get_ui_hierarchy
Extract UI hierarchy from Xcode test results (.xcresult) by specifying test ID. Returns raw accessibility tree, slim AI-readable JSON, or full JSON with optional timestamp.
Instructions
Get UI hierarchy attachment from test. Returns raw accessibility tree (best for AI), slim AI-readable JSON (default), or full JSON.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"xcresult_path": "<xcresult_path>",
"test_id": "<test_id>"
},
"name": "xcresult_get_ui_hierarchy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xcresult_path | Yes | Absolute path to the .xcresult file | |
| test_id | Yes | Test ID or index number to get UI hierarchy for | |
| timestamp | No | Optional timestamp in seconds to find the closest UI snapshot. If not provided, uses the first available UI snapshot. | |
| full_hierarchy | No | Set to true to get the full hierarchy (several MB). Default is false for AI-readable slim version. | |
| raw_format | No | Set to true to get the raw accessibility tree text (most AI-friendly). Default is false for JSON format. |