Skip to main content
Glama

elements

Retrieve UI elements from the accessibility tree, filtered by app, role, states, or source, with options for hierarchy and sorting.

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
Behavior3/5

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

No annotations are provided, so the description carries the burden of behavioral disclosure. It correctly implies a read-only operation (Get UI elements) but does not explicitly state safety or side effects. It mentions the tree hierarchy and max_elements to prevent huge results, but lacks details on output format, error behavior, or permissions. This is adequate but not thorough.

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?

The description is concise: two introductory sentences followed by a well-organized parameter list. Every sentence adds value, no redundancy. The structure is front-loaded with purpose and usage guidance, making it easy for an agent to parse.

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?

Given the tool's complexity (11 parameters) and the presence of an output schema (not shown), the description covers all parameters and usage hints. It could be improved by noting that this is a read-only operation or warning about performance with large trees, but overall it is sufficiently complete for an AI agent.

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, but the tool description's Args section provides clear, detailed explanations for all 11 parameters, including roles, states, source options, and sorting. This adds significant meaning beyond the raw schema, fully compensating for the lack of schema 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 clearly states the purpose: 'Get UI elements from the accessibility tree.' It uses a specific verb-resource pair and distinguishes from the sibling tool find() by contrasting 'broad view' with find's faster, ranked search by name. This is an exemplar of purpose clarity.

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?

The description explicitly advises using find() when element name is known, implying the primary usage scenario for elements is exploratory browsing. However, it does not mention any exclusions or when not to use it, nor does it compare with other siblings. The guidance is clear but not exhaustive.

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