Skip to main content
Glama

cua_ui_tree

Reads the native Accessibility or UI Automation tree of the frontmost or named app, returning numbered element refs and exact (cx, cy) coordinates for UI automation.

Instructions

Read the native Accessibility / UI Automation tree (AXUIElement on macOS, UIAutomation on Windows) of the frontmost or named app with numbered element ref IDs and exact (cx, cy).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cua_ui_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
pidNo
app_nameNo
max_depthNo
max_nodesNo
interactive_onlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it discloses very little beyond the read itself. It does not say that accessibility permissions may be required, whether the call is strictly read-only, that ref IDs are typically transient and invalidated by subsequent UI changes, or that max_depth/max_nodes can silently truncate the returned tree. Only the return shape is conveyed.

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?

One dense sentence, front-loaded with the verb and resource, with no filler. It is packed rather tightly — platform API names and output detail all in one clause — but nothing is wasted.

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?

With five undocumented parameters, no annotations, and no output schema, the description leaves too much unstated for a tool whose behavior varies substantially with depth/node limits and the interactive_only filter. An agent cannot predict truncation behavior, permission failures, or ref-ID lifetime from this text.

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

Parameters1/5

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

Schema description coverage is 0% across five parameters, so the description must compensate and does not. It hints that 'frontmost or named app' corresponds to pid/app_name, but max_depth, max_nodes and interactive_only — the parameters that control tree size and filtering, and therefore cost and completeness of results — are given no meaning anywhere.

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 gives a specific verb ('Read') plus the exact resource ('native Accessibility / UI Automation tree') and names the concrete platform APIs (AXUIElement, UIAutomation). It also states the scope ('frontmost or named app') and the shape of what comes back (numbered element ref IDs and exact (cx, cy)). It stops short of distinguishing itself from siblings like cua_find_elements or cua_screenshot, so it does not reach a 5.

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?

Usage is only implied: the reader can infer this is the tool for enumerating on-screen elements when ref IDs and coordinates are needed. There is no explicit when-to-use statement, no mention of when to prefer cua_find_elements for targeted lookups, and no guidance on when a screenshot or OCR would be the better alternative.

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