Skip to main content
Glama

android_assert

Poll the Android UI hierarchy for a target element while monitoring logcat for crashes or ANRs, so you can verify UI state during automation.

Instructions

Poll UI hierarchy for a target element while watching logcat for crashes/ANRs.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "android_assert"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNo
packageNo
resource_idNo
timeout_secNo
poll_interval_secNo

Output Schema

NameRequiredDescriptionDefault
okYes
errorNo
matchedNo
elapsed_secNo
matched_refNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full behavioral burden, and it does disclose two non-obvious traits: repeated polling and concurrent logcat monitoring for crashes/ANRs. It does not say what happens when the element is not found within the timeout, whether crashes abort the poll, or whether failure surfaces as an error or a value.

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?

A single tight sentence with the primary action front-loaded and the side-channel behavior second. Nothing is wasted, though the brevity leaves room that could have been spent on failure semantics.

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

Completeness2/5

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

This is a fairly complex tool — five undocumented parameters, no annotations, dual responsibilities (UI polling plus crash detection) — and the description covers only the surface behavior. An output schema exists so return values needn't be explained, but timeout/failure behavior and parameter roles are missing.

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

Parameters2/5

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

Schema description coverage is 0% across five parameters, so the description must compensate and largely does not. The words 'target element' and 'poll' only loosely imply that text/package/resource_id are match criteria and timeout_sec/poll_interval_sec control the loop; no parameter is named or explained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a concrete verb and resource — 'poll UI hierarchy for a target element' — plus a secondary behavior, 'watching logcat for crashes/ANRs'. It is clear what the tool does, but it never differentiates itself from siblings like android_act or android_snapshot, so an agent must infer when assertion-waiting is preferred over acting or dumping.

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?

There is no explicit when-to-use guidance, no mention of what to do on timeout or failure, and no reference to alternatives. The only hint is the implicit 'wait for element to appear' pattern, which the agent must reconstruct itself.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.