Skip to main content
Glama
aipm-engine

AI Process Manager

by aipm-engine

get_ui_tree

Read-only

Retrieve the accessibility snapshot of a Windows window to inspect UI elements. Adjust depth and node limits to uncover content in native or Electron apps, and check truncated flag to adjust parameters.

Instructions

UI Automation tree of a window (roles, names, states) — the accessibility snapshot of a native Windows app. depth: default 4, max 30. max_nodes: default 200, max 1000 — max_nodes is the cost brake, NOT depth. Win32 apps expose content within 4-6 levels. Chromium/Electron apps (VS Code, Slack, Discord, Claude Desktop, Teams) bury real content under ~10 levels of Pane/Group wrappers: at low depth you get only empty Panes and conclude, wrongly, that the window is empty. Measured on Claude Desktop: depth=8 -> 15 useless nodes; depth=17 -> 115 nodes, 87 of them named (~8 KB) — the tree saturates at 17. So for Chromium/Electron ask for depth=15-20 and cap cost with max_nodes. The response reports depth, max_nodes, nodes, depth_reached and truncated; when truncated=true the tree was cut (read next_action) and you should repeat with a higher depth and/or max_nodes before concluding anything about the window. For finding a clickable target prefer ui_find (already filtered to interactive elements).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hwndNoExact window handle
depthNoMax tree depth (default 4, max 30). 4-6 for native Win32; 15-20 for Chromium/Electron apps, whose content sits under ~10 wrapper levels.
max_nodesNoMax nodes returned (default 200, max 1000). This is the token-cost brake — raise depth freely and cap cost here.
title_containsNoWindow title fragment
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses important behavioral traits: it explains that low depth in Chromium/Electron apps yields empty Panes that can mislead, that the tree saturates at a certain depth, and that max_nodes is a cost brake. It also describes the truncation behavior and the response fields, adding substantial context.

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?

The description is longer than typical but every sentence provides actionable detail: it defines the purpose, explains parameter defaults, gives app-specific guidance, and describes truncation. It is well-structured, front-loaded with the definition, and contains no 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?

Given that there is no output schema, the description adequately covers return values ('The response reports depth, max_nodes, nodes, depth_reached and truncated') and explains how to react to truncated trees. It also covers the main use cases and potential pitfalls, making it complete for a tool of this complexity.

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?

The schema already covers 100% of parameters, but the description adds value by explaining the empirical reasoning behind depth choices (e.g., 'depth=8 -> 15 useless nodes; depth=17 -> 115 nodes') and clarifying that max_nodes is a cost cap, not a depth limit. This enriches the parameter semantics beyond the schema's own descriptions.

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 opens with 'UI Automation tree of a window (roles, names, states) — the accessibility snapshot of a native Windows app,' which clearly states the tool's purpose with a specific verb and resource. It also explicitly distinguishes from ui_find by saying 'For finding a clickable target prefer ui_find,' showing differentiation from a sibling.

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?

It provides explicit when-to-use guidance: 'For finding a clickable target prefer ui_find' and instructs to repeat with higher depth/max_nodes when truncated=true. It also gives tailored depth recommendations for Win32 vs Chromium/Electron apps, making the usage context clear.

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/aipm-engine/AIPM'

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