Skip to main content
Glama

wait_for_element

Read-only

Polls the mobile UI tree until an element matching text, type, resource ID, or clickable state appears, then returns matches with optional UI tree or screenshot.

Instructions

Poll the UI tree until an element matching the criteria appears on screen. Returns matched elements and optionally the full UI tree or screenshot.

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": "wait_for_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
observeNoAdditional observation after element found. Default: none
platformNoTarget platform. Inferred if omitted.
clickableNoIf set, only match elements with this clickable state
device_idNoDevice ID. Omit for the connected device.
text_exactNoWait for element whose text matches exactly
timeout_msNoMaximum time to wait in ms. Default: 30000 — app start, first network-backed list load and login flows routinely exceed 10s
resource_idNoWait for element whose resource_id contains this substring (case-insensitive)
text_containsNoWait for element whose text contains this substring (case-insensitive)
type_containsNoFilter by element type containing this substring (case-insensitive)
poll_interval_msNoPolling interval in ms. Default: 500

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

A3.6/5.0
Behavior3/5

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

readOnlyHint=true already tells the agent this is a non-mutating operation, so the description's added polling/return detail is modest extra value. It does not disclose what happens on timeout (error vs. empty result), whether matching is against the first or all matches, or the cost of polling with a large observe mode.

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?

Two sentences, no filler, with the core polling behavior front-loaded and the return contract second. Every clause carries information.

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?

For a 10-parameter tool with no output schema, the description does state what comes back (matched elements plus optional UI tree or screenshot), which is the key missing piece. It falls short on timeout/failure semantics, the one behavior an agent most needs to handle for a polling tool.

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 description coverage is 100% and each parameter already carries its own semantics, including the rationale for the 30s timeout default and the platform inference behavior. The description adds only the vague word 'criteria' and one mention of the optional tree/screenshot, so it does not meaningfully exceed the schema.

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 specific verb and resource: poll the UI tree until a matching element appears on screen, and it states the return payload (matched elements, optional tree or screenshot). It implicitly separates itself from wait_for_element_gone by describing the wait-for-appearance direction, but no sibling is named explicitly.

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

Usage Guidelines3/5

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

Usage is only implied by the verb 'wait until ... appears'; there is no explicit statement of when to prefer this over wait_for_element_gone, wait_for_stable, or find_element. No prerequisites (e.g. app must be launched, device connected) are stated.

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