Skip to main content
Glama

wait_for_element

Waits for an iOS UI element to appear or disappear without tapping, helping confirm screens or spinners after an action; optionally scrolls while searching.

Instructions

Wait until an element appears, or disappears with gone=true, without tapping it. Use it after an action to wait for a screen or for a spinner to go away; use tap_element to wait and tap. Pass at least one of text, id or type. Returns the element's description and center, and fails when the timeout (5 s by default) passes. With scrollDirection it scrolls the screen while looking.

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
idNoExact accessibility identifier
goneNoWait for the element to disappear instead (default false)
textNoCase-insensitive. Exact matches on label, identifier, value or placeholder rank first, then whole-word matches inside a short label, identifier or placeholder
typeNoElement type, e.g. Button, TextField, Cell, Switch
exactNoRequire an exact text match
indexNoPick the Nth best match (0-based)
deviceNoDevice UDID or name substring. Defaults to the select_device choice, then IOS_DEVICE_MCP_DEVICE, else the single USB-connected device.
timeoutNoSeconds to wait for the element (default 5)
maxScrollsNoScroll attempts when scrollDirection is set (default 8)
scrollDirectionNoIf not found, scroll this way and look again (lists load lazily, so off-screen rows may not exist yet)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.2
    • addedInput schema / properties / gone / description
      Added value: +"Wait for the element to disappear instead (default false)"
    • changedInput schema / properties / text / description
      Previous value: -"Matches label, identifier, value or placeholder (exact first, then substring, case-insensitive)"New value: +"Case-insensitive. Exact matches on label, identifier, value or placeholder rank first, then whole-word matches inside a short label, identifier or placeholder"
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: it explains that the call blocks until found, fails when the default 5 s timeout passes, returns the element's description and center, and that scrollDirection causes the screen to be scrolled while searching. That scrolling side effect explains the readOnlyHint=false annotation. It stops short of describing what a timed-out failure response looks like or any device-state implications, so a 4 rather than a 5.

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?

Three dense sentences, front-loaded with the core behavior, then routing, then preconditions, then return/timeout semantics. Every clause carries information and none repeats the schema verbatim.

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, no-output-schema polling tool, the description covers purpose, alternative, preconditions, defaults, failure mode, and return shape. It leaves the device-selection fallback chain and the exact/index interaction to the schema, which is acceptable given 100% coverage but keeps it from a top score.

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 coverage is 100%, so the baseline is 3, but the description adds a genuine constraint not expressed in the schema: at least one of text, id or type must be supplied despite required being empty. It also clarifies gone=true semantics and the default 5 s timeout and the scroll-while-looking behavior of scrollDirection. Other parameters (exact, index, device fallback chain) are left entirely to the schema.

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?

States a specific verb and resource ('Wait until an element appears, or disappears with gone=true') plus the defining constraint 'without tapping it'. It then contrasts directly with the sibling 'tap_element to wait and tap', so an agent can distinguish the two without opening either schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance ('Use it after an action to wait for a screen or for a spinner to go away') and names the alternative tool with the condition that selects it ('use tap_element to wait and tap'). The precondition constraint 'Pass at least one of text, id or type' is also stated.

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