Skip to main content
Glama

assert_ui_node

Read-only

Verifies if the current Android UI hierarchy contains a node matching specified text, resource-id, content-desc, or focus state. Set should_exist to false to assert that no such node exists.

Instructions

Assert that the current Android UI Automator hierarchy does or does not contain a matching node.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoExact node text to match
focusedNoWhether the node must currently be focused
resource_idNoExact UI Automator resource-id to match
content_descNoExact content-desc to match
should_existNoSet false to assert that no matching node exists
device_serialNoADB serial such as emulator-5554, a USB serial, or host:port. If omitted, the active device is used; a sole ready device is selected automatically.
Behavior3/5

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

The description discloses that this is an assertion on the current UI hierarchy, which aligns with the readOnlyHint. However, it does not explain what happens on assertion failure (e.g., throwing an error, returning false), which is crucial for an assertion tool and not covered by annotations.

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 a single, concise sentence that directly communicates the tool's function without unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich schema and annotations, the description covers the core behavior but omits important contextual details like failure semantics and return values. This is a notable gap for an assertion tool, but the overall context is otherwise sufficient.

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?

Schema descriptions already cover 100% of parameters with clear semantics (e.g., 'Exact node text to match', 'Set false to assert that no matching node exists'). The description adds no additional parameter-level meaning, so baseline 3 is appropriate.

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's purpose: asserting whether the current Android UI Automator hierarchy contains or does not contain a matching node. It uses a specific verb ('Assert') and resource, and the 'does or does not' phrasing distinguishes it from dumping or waiting operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like wait_for_ui_node or dump_ui. It does not mention prerequisites, typical scenarios, or exclusions, leaving usage context entirely 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/francbonet/Adb-MCP-Server'

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