Skip to main content
Glama

Ui Read Tree

ui_read_tree
Read-only

Returns a COMPACT accessibility tree of a running native app's labeled + interactive elements (buttons, links, text fields, checkboxes, menus…) — the native equivalent of web_read's a11y mode. Use it to DISCOVER what to act on in an unfamiliar app when you don't already know an element's role/label (ui_find_element needs one up front). Each interactive node carries a ref you can pass straight to ui_click. Pass app_bundle_id of a running app (e.g. com.apple.finder — see list_windows); the tree is pruned to signal-bearing nodes and bounded by max_depth (default 12) and a node budget, so very large windows return partial. The app's macOS menu bar is skipped by default (it's hundreds of menu-item nodes) — pass include_menu_bar=true if you specifically need to act on menu-bar items.

Input Schema

NameRequiredDescriptionDefault
max_depthNoMax tree depth to descend (default 12, max 20)
window_idNoAlternative to app_bundle_id: a window id from list_windows (targets that window's app). When that app shows no window to accessibility (the window is on another Space or in full screen), its app is activated and the tree read again; the result then carries activated:true.
app_bundle_idNoBundle id of a RUNNING app (e.g. com.apple.finder)
include_menu_barNoInclude the app's macOS menu bar (hundreds of menu-item nodes). Default false.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / window_id / description
      Previous value: -"Alternative to app_bundle_id: a window id from list_windows (targets that window's app)"New value: +"Alternative to app_bundle_id: a window id from list_windows (targets that window's app). When that app shows no window to accessibility (the window is on another Space or in full screen), its app is activated and the tree read again; the result then carries activated:true."
  2. Changed1 schema field changed
    • addedInput schema / properties / include_menu_bar
      Added value: +{
      +  "description": "Include the app's macOS menu bar (hundreds of menu-item nodes). Default false.",
      +  "type": "boolean"
      +}
  3. Added

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the readOnly/destructive annotations: discloses that the tree is pruned to signal-bearing nodes and bounded by max_depth plus a node budget, so very large windows return partial results. Also explains that the macOS menu bar is skipped by default because it contributes hundreds of nodes, which is a real behavioral caveat an agent needs.

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?

Front-loaded with purpose and the ui_click ref payoff, then alternatives, then caveats. Dense with parentheticals and em-dashes, but every clause carries information; nothing is filler.

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?

For a zero-required-parameter discovery tool with an output schema, it covers everything an agent needs: what comes back, that the result may be partial, what a node's ref is good for, and how to widen scope. No gaps remain that would cause a misinvocation.

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

Parameters4/5

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

With 100% schema coverage the baseline is 3, but the description adds rationale the schema lacks: why include_menu_bar defaults false (hundreds of menu-item nodes), the default depth of 12, and where to get app_bundle_id (list_windows). It does not add much for window_id, whose activation caveat already lives in the schema.

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?

States a specific verb+resource (returns a compact accessibility tree of a running native app's labeled and interactive elements) and scopes it precisely (pruned to signal-bearing nodes). It explicitly distinguishes itself from ui_find_element and from web_read's a11y mode, so an agent can pick it without opening the schema.

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?

Gives an explicit use case — discover what to act on in an unfamiliar app when the element's role/label isn't known — and names the sibling it is not for, with the reason (ui_find_element needs a label up front). It also states the condition for the non-default include_menu_bar flag rather than leaving it to the schema.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources