Skip to main content
Glama

wait_for

Read-only

Wait for a GUI or file condition instead of sleeping: a window, stable screen, announcement, focus, image match, change, or log line; fail after timeout.

Instructions

Wait, instead of sleeping, for: a window (value: its title, exactly or a regex, or app=RE, or the name of a program spawn_program started, for a window of that program's, whatever its title; giving up, it lists the windows there are), stable (the screen, or the window, unchanged for value seconds, 0.5, up to 60: after a click, for the repaint), an announcement (value: a regex in what was announced to a screen reader; each announcement is waited for once), focus (value: the name of the node with the keyboard focus, as click_element takes one), match (value: a PNG, by its path from the allow file's directory, that the screen, or the window, cropped to crop, should look like), change (from how it looked when the wait started), or line (value: a regex found in a line of file, written after the wait starts, or with from_start, anywhere in it: for a program that logs its events, rather than a sleep; a file not there yet is waited for, and one rotated or rewritten is read from the top). match and change say how long they took; line answers with the line. Fails after timeout seconds, saying so.

Input Schema

NameRequiredDescriptionDefault
cropNoWIDTHxHEIGHT+X+Y, inside what's taken
fileNoline's, by its path from the allow file's directory
fuzzNomatch, change: percent a pixel may differ by (0)
mostNomatch, change: pixels past fuzz allowed (0)
whatYesThe kind of wait
valueNoWhat to wait for, as what says
windowNoA window's title, exactly or a regex matched in full, or app=RE for its app id
sessionYesIts name, from start_session
timeoutNoSeconds before it fails (10)
from_startNoline: anywhere in file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, and the description adds real behavioral context: failure after timeout 'saying so', match/change reporting elapsed time, line returning the line, announcements waited for only once, and rotated/rewritten files read from the top. These are substantive traits beyond the structured fields, though the result of a successful window/stable/focus wait is left implicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is dense and largely earns its place for a seven-mode tool, but it is delivered as a single sprawling sentence with nested parentheticals, so key facts like the timeout failure and return values are buried rather than front-loaded. Size is defensible; structure is not.

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?

Given ten parameters, seven modes, and no output schema, the description covers calling semantics and edge cases (missing/rotated files, one-shot announcements) well and states returns for match, change, and line. It leaves the return behavior of window, stable, announcement, and focus to inference, which is the one remaining gap.

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 per-parameter meaning is already documented and the baseline is 3. The description goes further by tying parameters together across modes — which value format each 'what' requires, that crop applies inside what's taken, that fuzz/most are match/change-only, and that from_start changes line's scan origin.

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 opens with a specific verb and resource ('Wait, instead of sleeping, for:') and then enumerates the seven wait kinds (window, stable, announcement, focus, match, change, line) with the value each expects. That is enough to tell it apart from siblings like take_screenshot or get_accessible_tree, though no sibling is named as an alternative.

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?

It anchors usage against the obvious alternative ('instead of sleeping') and gives per-mode triggers such as 'after a click, for the repaint' for stable and 'for a program that logs its events, rather than a sleep' for line. There is no explicit when-not-to-use guidance or routing between the seven modes, so it stops short of a 5.

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