Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xcresult_pathYesAbsolute path to the .xcresult file
test_idYesTest ID or index number to get UI hierarchy for
timestampNoOptional timestamp in seconds to find the closest UI snapshot. If not provided, uses the first available UI snapshot.
full_hierarchyNoSet to true to get the full hierarchy (several MB). Default is false for AI-readable slim version.
raw_formatNoSet to true to get the raw accessibility tree text (most AI-friendly). Default is false for JSON format.
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It does not mention any behavioral traits beyond output format choices, such as side effects (none expected), permissions needed, or the fact that full hierarchy can be several MB large. The parameter description for full_hierarchy mentions size, but the main description lacks this warning.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently conveys the purpose and output variants. It is front-loaded with the action and resource, but could be slightly more structured to separate purpose from output details. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description explains the return format types, it lacks details on the structure of the hierarchy (e.g., tree node properties). Given there is no output schema, more information about the output structure would help an AI agent process the result. The description is adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so each parameter is already documented. The main description does not add additional meaning beyond what the schema provides. The baseline score of 3 is appropriate since the schema adequately describes parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get UI hierarchy attachment from test.' It specifies the output variants (raw accessibility tree, slim AI-readable JSON, full JSON), which distinguishes it from sibling tools like xcresult_get_ui_element (single element) or xcresult_get_screenshot (screenshot).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives some guidance on output format usage (e.g., 'best for AI', 'default'), but it does not explicitly state when to use this tool versus alternatives like xcresult_get_ui_element or xcresult_get_screenshot. No exclusions or prerequisites are mentioned, only implicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lapfelix/XcodeMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server