Skip to main content
Glama

get_ui_tree

Retrieve the complete accessibility UI tree as structured JSON from iOS simulators for automation testing and interface analysis.

Instructions

Get the full accessibility/UI tree as structured JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidNoSimulator UDID (optional, defaults to booted simulator)

Implementation Reference

  • The handler function for the 'get_ui_tree' MCP tool, which resolves the target device UDID and fetches the UI tree.
    private async getUiTree(udid?: string) {
      const target = await resolveUdid(udid);
      try {
        const tree = await this.fetchUiTree(target);
        return {
          content: [{ type: 'text', text: JSON.stringify(tree, null, 2) }],
        };
      } catch (error: any) {
        throw new McpError(ErrorCode.InternalError, `Failed to get UI tree: ${error.message}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't specify permissions, rate limits, side effects, or what 'full' entails (e.g., depth, format details). This is insufficient for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain the structure or content of the returned JSON, potential errors, or how it relates to sibling tools. For a tool that retrieves complex UI data, more context is needed to guide effective use.

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 schema description coverage is 100%, with the single parameter 'udid' documented in the schema as optional and defaulting to the booted simulator. The description adds no additional parameter details beyond what the schema provides, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Get') and the resource ('full accessibility/UI tree as structured JSON'), making the tool's function understandable. However, it doesn't differentiate from siblings like 'get_screen_summary' or 'find_elements', which might also retrieve UI information, so it lacks sibling distinction for a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as 'get_screen_summary' or 'find_elements'. It mentions no prerequisites, exclusions, or specific contexts, leaving the agent to infer usage from the tool name alone.

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/xmuweili/app-screen-mcp'

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