Skip to main content
Glama

elements

Retrieve UI elements from accessibility trees to analyze application interfaces. Filter by role, state, hierarchy, and source for comprehensive UI exploration.

Instructions

Get UI elements from the accessibility tree.

Returns a broad view of available elements.  Use find() instead
when you know the element's name -- it is faster and ranked.

Args:
    app: Scope to this application.
    window_id: Scope to this window.
    tree: If true, include parent/child hierarchy.
    max_depth: Maximum tree depth (0 = immediate children only).
    root_element: Start from this element ID (drill into a container).
    max_elements: Maximum elements to return (prevents huge results).
    role: Only include this role (e.g. "button", "text_field").
    states: Only include elements with ALL these states.
    named_only: If true, exclude elements with empty names.
    sort_by: None (default, tree order) or "position" for reading order (top-to-bottom, left-to-right).
    source: "full" (default, merged native+web), "ax" (CDP AX tree only), "native" (platform only), or "dom" (live DOM).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNo
window_idNo
treeNo
max_depthNo
root_elementNo
max_elementsNo
roleNo
statesNo
named_onlyNo
sort_byNo
sourceNofull

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden. It adds valuable behavioral context: find() is 'faster and ranked' (implying this is slower/unranked), max_elements 'prevents huge results' (safety guard), and explains the four source options (full, ax, native, dom) and their meanings. However, it omits explicit statements about read-only nature, error handling, or whether this operation has side effects.

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?

Well-structured with purpose first, usage guidelines second, and parameter documentation in Args block. Every sentence earns its place given the 0% schema coverage. Slightly verbose but necessary to document 11 undocumented parameters. The front-loading of purpose and guidelines before the Args block is effective.

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 11 parameters with complex filtering options (role, states, source) and existence of an output schema (so return values need not be described), the description is complete. It covers all parameters, explains sibling distinctions, and documents behavioral traits. No gaps remain that would impede correct invocation.

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

Parameters5/5

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

The input schema has 0% description coverage (only titles). The Args block comprehensively documents all 11 parameters with semantic meaning: app/window_id scoping, tree hierarchy inclusion, max_depth semantics (0 = immediate children), root_element drilling behavior, role filtering examples, states logic (ALL), and sort_by options. Fully compensates for schema deficiency.

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 opening sentence 'Get UI elements from the accessibility tree' provides a specific verb (Get), resource (UI elements), and source context (accessibility tree). It clearly distinguishes from sibling tool 'find' by stating 'Use find() instead when you know the element's name', establishing a clear scope boundary.

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?

Explicitly defines when to use the alternative sibling tool: 'Use find() instead when you know the element's name -- it is faster and ranked.' This provides clear guidance on the performance and ranking trade-offs between the two discovery methods.

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/Touchpoint-Labs/Touchpoint'

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