Skip to main content
Glama

get_ui_elements

Retrieve the unfiltered UI element tree from a window to access names, control types, automation IDs, and positions for automation tasks.

Instructions

Inspect the raw UIA element tree of a window — returns names, control types, automationIds, bounding rects, and interaction patterns. Each element includes viewportPosition ('in-view'|'above'|'below'|'left'|'right') relative to the window client region — use it to decide whether scroll_to_element is needed before clicking. Prefer screenshot(detail='text') for interactive automation (returns pre-filtered actionable[] with clickAt coords). Use get_ui_elements when you need the unfiltered tree or specific automationIds for click_element. Caveats: Large windows may return hundreds of elements — scope with windowTitle. Results are capped at maxElements (default 80, max 200) — increase if the target element is missing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowTitleYesPartial window title to find the target window
maxDepthNoMaximum depth of the element tree to traverse (default 4)
maxElementsNoMaximum number of elements to return (default 80)
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: it explains the viewportPosition field's purpose for scroll decisions, warns about potential large result sets, mentions result capping with defaults and limits, and advises scoping with windowTitle. It doesn't cover error conditions or performance characteristics, keeping it from a perfect score.

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 appropriately sized and front-loaded with core functionality, followed by usage guidance and caveats. Every sentence adds value, though it could be slightly more streamlined by combining some of the caveat statements.

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?

For a tool with no annotations and no output schema, the description does a good job covering purpose, usage guidelines, behavioral traits, and limitations. It explains the return data structure and practical considerations like scrolling needs and result capping. The main gap is lack of explicit output format details, but given the complexity, it's reasonably complete.

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?

The input schema has 100% description coverage, so the baseline is 3. The description adds some context about maxElements ('increase if the target element is missing') and implies windowTitle scoping for large windows, but doesn't provide additional semantic details beyond what the schema already documents for parameters.

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 inspects the raw UIA element tree of a window and enumerates specific return data (names, control types, automationIds, bounding rects, interaction patterns). It distinguishes itself from sibling tools like screenshot and click_element by specifying it provides the unfiltered tree rather than pre-filtered actionable elements.

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?

The description provides explicit guidance on when to use this tool versus alternatives: 'Prefer screenshot(detail='text') for interactive automation' and 'Use get_ui_elements when you need the unfiltered tree or specific automationIds for click_element.' It also mentions caveats about large windows and result capping that inform usage decisions.

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/Harusame64/desktop-touch-mcp'

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