Skip to main content
Glama

agentest_get_ui_tree

Retrieve a current UI tree with interaction points as @ref tokens for element selection in tests. Supports compact or full format, depth limits, and filtering to interactive elements.

Instructions

Get a fresh snapshot of the current UI screen. Returns compact text with @ref tokens by default.

Use refs in selectors: { "ref": "@b1" }. If a ref is stale (screen changed), you'll get a clear error — just call this tool again for fresh refs.

Options:

  • format: "compact" (default) or "full" (legacy JSON tree with bounds + classNames — use for debugging or layout inspection)

  • depth: max tree depth (omit for unlimited)

  • onlyInteractive: true to drop plain text lines (hoisted labels still appear on interactives)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNoMax tree depth. Deeper subtrees are summarized as "+N interactive elements".
formatNoOutput format: "compact" (default, indented text with @refs) or "full" (JSON tree with bounds/classNames for debugging)
onlyInteractiveNoDrop plain text lines — only show interactive elements with refs. Labels are still hoisted onto interactives.
Behavior4/5

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

No annotations exist, so description must disclose behavior. It explains that each call returns a fresh snapshot, refs can become stale with clear errors, and provides output formats. Could mention that it's read-only and has no side effects, but sufficient for safe invocation.

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 bullet points for options. First sentence could be tighter but is effective. Every sentence adds value without redundancy. Awarding 4 due to minor verbosity in the introductory sentence.

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?

Despite no output schema, description explains return formats (compact text with @refs, full JSON tree). Covers error conditions (stale refs) and usage patterns. Lacks details on bounds/classNames in full format, but sufficient for agent to understand output.

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?

Schema covers all 3 parameters with descriptions. The tool description adds value by explaining defaults ('compact'), usage tips ('use full for debugging'), and context for options ('onlyInteractive drops plain text'). Descriptions enhance beyond schema alone.

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 fetches a fresh UI screen snapshot with compact text by default. It distinguishes from sibling tools like screenshot (visual) or device_info (metadata) by focusing on interactive element hierarchy and refs.

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?

Provides clear guidance on when to call this tool (to get fresh refs) and how to use refs in selectors with error handling. Lacks explicit when-not-to-use or comparison with alternatives, but usage context is well implied.

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/arjun-vegeta/agenTest'

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