Skip to main content
Glama

native-full-hierarchy

Get the complete UIKit view hierarchy of a running iOS app to debug layout issues, find views without accessibility labels, and inspect structure not exposed through the accessibility tree.

Instructions

Get the complete UIKit view tree for the running app. WARNING: Output can be extremely large (100KB–500KB+) for complex apps, especially those built with SwiftUI. Prefer native-find-views for targeted queries. Use skipClasses / skipClassPrefixes to prune SwiftUI internal subtrees and reduce output size. Use the fields param to request only the properties you need. Use when you need deep layout debugging, finding views with no accessibility labels, or verifying view structure not exposed through the accessibility tree. Returns { status: "ok", windows } with the full view hierarchy. If status is restart_required: follow the message (usually restart-app), then retry. If status is service_stale: the app is already injected, so restarting it cannot help — restart the tool-server (argent server stop && argent server start --detach) and retry. If the same status comes back after that restart, stop restarting: follow the message, which names the terminal fallback. If status is connect_pending: the app is injected and still connecting — do not restart it, wait a few seconds and retry. If status is init_failed: the simulator's native-devtools environment could not be initialised — follow the message (re-boot the simulator) rather than retrying this tool. A not-connected or not-running app comes back as one of those statuses rather than a failure. Failures are separate: an Apple system app is rejected outright (terminal — never retry it), and the hierarchy query itself can error or time out.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesSimulator UDID
fieldsNoView fields to include. Use EXACT names: className, frame, hidden, alpha, identifier, label, nativeID, userInteractionEnabled, depth, pointer, tag, windowFrame, bounds, center, opaque, clipsToBounds, transform, contentMode, backgroundColor, tintColor, layerName. Defaults to all of the first group when omitted.
bundleIdYesBundle ID of the app
maxDepthNoMaximum recursion depth (default 8). Increase for deeper inspection, decrease to reduce output size.
skipClassesNoExact UIView class names whose entire subtree should be pruned (e.g. ["UIImageView"] to drop image leaf nodes)
skipClassPrefixesNoClass name prefixes to prune entire subtrees. For SwiftUI apps use ["_TtGC7SwiftUI"] to drop mangled SwiftUI generic type subtrees while keeping _UIHostingView and UIKit bridges. Avoid broad prefixes like "_UI" — they prune useful system views.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.15.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries full responsibility for behavioral disclosure, and it does so thoroughly. It warns about extremely large output (100KB–500KB+), lists statuses (restart_required, service_stale, connect_pending, init_failed) with exact recovery actions, and clarifies that non-connected apps return statuses rather than failures. This goes far beyond the schema's static parameter descriptions.

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?

Though long, every section earns its place: warning first, then alternatives, parameter tuning advice, and careful status handling. The structure is front-loaded with the most critical information, and the status guidance is exhaustive enough to prevent dangerous retry loops.

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

Completeness5/5

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

Given the tool has no output schema and no annotations, the description is remarkably complete. It covers expected return shape, failure modes, status-value semantics, terminal cases, and advice about scaling output. An agent can invoke this tool correctly and know what to do after almost every possible result.

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

Parameters5/5

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

Schema coverage is 100%, and the description adds meaningful guidance on top: skipClasses/skipClassPrefixes examples, a concrete SwiftUI prefix value, a warning against broad prefixes like '_UI', a default for maxDepth, and a recommendation to use the fields parameter to limit output. This materially helps an agent pick and fill the right 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 first sentence states a specific verb and resource: 'Get the complete UIKit view tree for the running app.' It also distinguishes itself from the sibling tool by saying 'Prefer native-find-views for targeted queries' and notes when this tool is useful (deep layout debugging, accessibility label checks). This is unambiguous and avoids confusion with siblings.

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

Usage Guidelines5/5

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

The description explicitly tells the agent when to use this tool versus native-find-views and gives concrete use cases: 'deep layout debugging, finding views with no accessibility labels, or verifying view structure not exposed through the accessibility tree.' It also explains when not to retry, including terminal conditions for Apple system apps and specific instructions for each status code.

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

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/software-mansion/argent'

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