Skip to main content
Glama
mcp-server-macos

mcp-server-macos

Wait for an element

wait_for_ui_element
Read-only

Waits for a UI element such as a page, dialog, or button to appear and returns it, or null on timeout. Waits for a not-yet-running app too.

Instructions

Wait until an element shows up (a page loaded, a dialog opened, a button enabled), and return it; null if it doesn't within the timeout. An app that isn't running yet is waited for too.

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_ui_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNoThe app, by name, bundle identifier or path. The app in front by default.
nameNoA part of its name, label or text, in any case.
roleNoWhat it is: 'button', 'text field', 'link'...
timeout_secondsNoHow long to wait at most, in seconds.

Output Schema

NameRequiredDescriptionDefault
elementYesThe element. Null when there's none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.2

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered, but the description still adds real value by disclosing that the call blocks until the element appears and returns null on timeout, and that it waits for an app that isn't running yet. However, it says nothing about polling cadence, whether it re-queries state after the element appears, or what happens under concurrent UI changes.

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 waste, and the core behavior plus the null-on-timeout outcome are front-loaded. The parenthetical examples do real work rather than padding.

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?

An output schema exists and annotations cover safety, so the description need not explain the return shape beyond the null case, which it does. It is close to complete for a 4-optional-parameter blocking wait tool, with only blocking semantics and timeout interaction left implicit.

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%, so the baseline is 3; the schema already explains app, name, role and timeout_seconds with defaults and bounds. The description only indirectly touches parameter meaning via the note that an unlaunched app is waited for, adding little beyond the documented fields.

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?

States a specific verb and resource ('Wait until an element shows up ... and return it') and grounds it with concrete trigger examples (page loaded, dialog opened, button enabled). It is clear what the tool does, though it never contrasts itself with siblings like find_ui_elements or get_ui_elements, so an agent must infer when waiting is preferable to an immediate lookup.

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?

Usage context is clear from the enumerated appearance conditions plus the note that an app which isn't running yet is also waited for, which tells the agent this is safe to call before the UI exists. There are no explicit exclusions or named alternatives, so it stops short of full routing guidance.

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