Skip to main content
Glama

wait_for

Read-only

Avoid fixed sleeps by waiting for real desktop conditions: windows, text, widgets, focus, clipboard changes, or elapsed time. Returns when the condition is met or reports a timeout honestly.

Instructions

Wait until the desktop reaches a state, instead of sleeping a guessed number of seconds. Conditions: window_exists, window_gone, window_focused, focus_changes; text_appears (OCR polls a window for a string -- a reply arriving, a build finishing); widget_exists (an AT-SPI widget matching text/role shows up in app); clipboard_changed (a copy landed); elapsed (just wait N seconds -- for a long install with nothing to poll, and the honest alternative to watching for a string you know will never appear). Returns as soon as it is true, or reports honestly that it timed out. A timeout over 300s is clamped, not refused.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNoFor widget_exists: the AT-SPI application name
roleNoFor widget_exists: the widget role, e.g. 'push button'
textNoFor text_appears: the string to watch for. For widget_exists: the widget name to match.
targetNo
timeoutNo
conditionYes
Install Server

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description reveals how the tool behaves: it polls OCR, AT-SPI widgets, clipboard, or timers; it returns as soon as the condition is true; it honestly reports timeouts; and it clamps timeouts over 300s. This gives the agent a clear mental model of polling semantics.

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?

The description is dense and every sentence carries information, but the long run-on structure could be easier to parse. The core purpose is front-loaded, and the condition list is compact, so it remains effective.

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

Completeness3/5

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

For a tool with 6 parameters and no output schema, the description explains the major behavioral modes and timeout handling well. However, it omits a precise definition of target for several conditions and does not clarify the exact return value on success or timeout, which an agent would need for reliable downstream handling.

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?

The description adds useful meaning for condition values and timeout behavior, but it never clearly binds the target parameter to conditions such as window_exists or text_appears, despite schema coverage being only 50%. The parameter semantics are partially compensated, not fully.

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?

The description opens with a specific verb and resource: 'Wait until the desktop reaches a state.' It then enumerates all supported condition types, making the tool's scope immediately identifiable and distinguishing it from a simple sleep or blind wait.

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?

The description gives practical guidance for when to use specific conditions, such as using text_appears to detect a reply or build finishing and using elapsed when there is nothing to poll. It also contrasts this tool with sleeping a guessed number of seconds. It does not explicitly compare against sibling tools like assert_state, but the condition-level guidance is substantial.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tristanmuzzu/deskwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server