Skip to main content
Glama

wait_for

Pause until a desktop event (window open/close, workspace change, layer, urgent, screencast) occurs, with optional match filter and timeout. Returns instantly if the condition already holds, avoiding missed events and polling.

Instructions

Block until a desktop event happens (real compositor events, not polling). event: 'window_open' | 'window_close' | 'workspace' | 'title_change' | 'layer_open' | 'layer_close' (layer-shell surfaces: launchers, notification popups; match on the namespace, e.g. 'wofi') | 'urgent' (a window demands attention) | 'screencast' (screen sharing started/stopped). match: optional case-insensitive substring filter over the event's fields (class/title/workspace name/address/namespace). timeout_s 1-60, default 10. Returns the event payload, or a timeout note; a filtered wait whose condition ALREADY holds (the window is already gone, the workspace already active, the layer already mapped) returns instantly with already: true instead of missing an event that fired before it could subscribe. Use it after actions with delayed effects: app startups, page loads that change a window title, a launcher bind that pops a layer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventYes
matchNo
timeout_sNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description fully carries the burden of behavioral disclosure. It details that it blocks on real compositor events (not polling), returns the event payload or a timeout note, and that a filtered wait whose condition already holds returns instantly with `already: true`. It also explains that matching is case-insensitive substring filtering. This is thorough behavioral transparency.

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?

The description is lengthy but every sentence adds value. It is front-loaded with the core purpose ('Block until a desktop event happens, not polling'), then details event types, matching, timeout, return behavior, and usage examples. There is no fluff; each clause conveys essential information. The structure is logical and efficient for the complexity of the tool.

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

Completeness5/5

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

Given the complexity of the tool (multiple event types, matching logic, timeout semantics, edge case for conditions already holding), the description covers all aspects necessary for an agent to use it correctly. It includes examples of when to use it and explains the behavior for every scenario. The presence of an output schema means return-value details are not required in the description, but it still mentions what the tool returns. This is fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must compensate. It does so comprehensively: the `event` parameter is fully enumerated with descriptions for each event type (e.g., 'layer-shell surfaces: launchers, notification popups; match on the namespace, e.g. wofi'), `match` is explained as an optional case-insensitive substring filter over the event's fields, and `timeout_s` is given a range (1-60) and default (10). This fully compensates for the bare 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?

The description clearly states the primary purpose: 'Block until a desktop event happens', and then enumerates the specific event types supported. It distinguishes this tool from its siblings (e.g., launch, use_bind, screenshot) by focusing on waiting for events rather than performing actions. The agent can immediately understand what the tool does and how it differs from the other tools.

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?

Provides explicit guidance on when to use the tool: 'Use it after actions with delayed effects: app startups, page loads that change a window title, a launcher bind that pops a layer.' It also explains the behavior when the condition already holds, which helps the agent anticipate edge cases. This is clear and actionable usage guidance.

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