Skip to main content
Glama

Wait for a UI control

sandbox_ui_wait

Waits for a specified UI control to appear and returns the matching element, or reports a timeout error if the control is not found.

Instructions

Wait until a control matching name / automationId / controlType appears (e.g. a result label, a dialog, a finished state). Returns the element, or an error after timeoutSec.

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

Input Schema

NameRequiredDescriptionDefault
pidNoProcess whose windows to search (from sandbox_launch).
nameNoElement name (visible label), exact match; falls back to contains.
timeoutSecNoDefault 30.
controlTypeNoButton, Edit, CheckBox, ComboBox, ListItem, MenuItem, TabItem, Text, ...
windowTitleNoOr: a window whose title contains this text.
automationIdNoAutomationId (control name in WinForms/WPF), exact match.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0-alpha.3

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the two most important behavioral facts: the call blocks until a match appears and fails with an error after timeoutSec, plus it returns the matched element. It omits polling behavior, whether the wait is read-only/non-mutating, and what the returned element contains.

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 compact sentences: the matching condition and examples first, then the return/failure contract. Nothing is redundant and the most decision-relevant information is front-loaded.

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 six-parameter, zero-required wait tool with no output schema and no annotations, the description supplies the essential contract: what is matched, that it blocks, the timeout failure mode, and that an element is returned. The remaining gap is the shape of the returned element and how multiple match criteria interact, which is minor for a simple wait primitive.

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 all six parameters are already documented in the schema, including the exact-match/contains fallback for name and the 30s default for timeoutSec. The description only echoes three of the matching keys and the timeout; it adds no semantics for pid or windowTitle and no guidance on combining criteria. Baseline 3 applies.

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 a control matching name / automationId / controlType appears') and gives concrete examples of what is being waited for (result label, dialog, finished state). It is clearly a polling/wait primitive rather than a tree dump or an action, though it never names a sibling to make that distinction explicit.

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?

The examples ('a result label, a dialog, a finished state') imply the intended use case: synchronizing on UI state after an action. There is no explicit when-to-use/when-not guidance and no pointer to alternatives such as sandbox_ui_tree for a one-shot read, so the agent must infer the choice.

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