Skip to main content
Glama

UI Automation tree

sandbox_ui_tree

Read an app's UI Automation tree in the sandbox to locate controls by pid or window title, with type, name, automation ID, value, toggle state, and available actions—no screenshot needed.

Instructions

Read the accessibility (UI Automation) tree of an app in the sandbox: one line per control with type, "name", #automationId, = value, [x] toggle state and {available actions}. Much cheaper and more precise than a screenshot for finding controls. Without pid/windowTitle it reads every top-level window (can be large).

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": "sandbox_ui_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
pidNoProcess whose windows to search (from sandbox_launch).
jsonNoReturn raw JSON (with screen rects) instead of the outline.
depthNoMax depth (default 12).
maxNodesNoMax elements (default 400).
windowTitleNoOr: a window whose title contains this text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0-alpha.3

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden and does well: it discloses the exact output line format (type, name, #automationId, = value, [x] toggle state, {available actions}), a relative cost comparison, and a size hazard for unscoped calls. It omits anything about permissions, latency, or read-only guarantees, so it stops short of full behavioral 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?

Three sentences, front-loaded with the verb and resource, then the compelling reason to prefer it, then the sizing caveat. The dense symbol-legend sentence is terse but every token in it conveys format information an agent needs.

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?

With no annotations and no output schema, the description must supply shape and safety context itself, and it does explain the return format and the cost of unscoped reads. It leaves minor gaps around whether the operation is strictly read-only and how the '{available actions}' tokens map to sandbox_ui_action.

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?

Schema coverage is 100%, so the schema already documents all five parameters including the 'Or:' alternative between pid and windowTitle. The description adds one genuinely new fact, that omitting both filters reads every top-level window, but says nothing about depth or maxNodes tuning, so it sits at the baseline rather than rising above it.

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 and resource: 'Read the accessibility (UI Automation) tree of an app in the sandbox'. It also distinguishes itself from the screenshot path by calling out that it is 'much cheaper and more precise than a screenshot for finding controls', so an agent can pick it without opening schemas.

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

Usage Guidelines4/5

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

Gives a clear use case (finding controls) and an explicit alternative to avoid (screenshots), plus a practical rule for when the call gets expensive: omitting pid/windowTitle reads every top-level window and 'can be large'. It does not mention sibling tools like sandbox_ui_action or sandbox_windows for follow-up work, which would have made it a 5.

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