Skip to main content
Glama

Get UI tree

get_ui_tree

Dump the semantic view tree of a macOS window as JSON to inspect UI roles, labels, values, states, frames, and stable ids.

Instructions

Dump the semantic view tree of a window as JSON: roles, labels, values, enabled/focused state, frames, and stable ids. Use compact for a terse outline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowNoWindow id; defaults to the key window.
compactNoReturn an indented outline instead of full JSON.
Behavior3/5

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

With no annotations, the description is the only source of behavioral information. It implies a read-only operation (dump) but never explicitly states that it does not modify the UI or that it requires no special permissions. It also does not disclose potential performance implications or error behavior. The description is not misleading, but it leaves room for clarification.

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?

Two sentences with no redundancy. The main purpose is front-loaded, and the compact option is mentioned as a secondary note. Every clause adds information, and the structure is efficient.

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

Completeness4/5

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

Since there is no output schema, the description adequately describes the return content (roles, labels, values, state, frames, stable ids). It does not mention error cases (e.g., invalid window) or what happens if the window is unavailable, but for a read-only inspection tool this is a reasonable level of completeness. The main missing piece is explicit guidance on when to use this tool, which is already penalized under usage guidelines.

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?

Both parameters are fully documented in the schema with 100% coverage. The description only reiterates the effect of 'compact' ('terse outline') which matches the schema description. It adds no additional semantic value beyond what the schema already conveys, so the baseline of 3 applies.

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 dumps the semantic view tree of a window as JSON, enumerating specific attributes (roles, labels, values, state, frames, stable ids). It is distinct from siblings like screenshot or click, since it focuses on reading the UI structure. The verb 'dump' is specific and the resource is unambiguous.

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 list_windows or screenshot. It only mentions the 'compact' parameter for a terser output, but does not explain scenarios where the tree is preferable or how it relates to other inspection tools. This is a clear gap.

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/thangduonghuu/macos-ui-mcp'

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