Skip to main content
Glama

wait_for

Read-only

Blocks until a real Hyprland compositor event occurs, such as a window opening, closing, title change, or layer opening. Filter by match and timeout to return event data without 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

NameRequiredDescriptionDefault
eventYes
matchNo
timeout_sNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.0
  2. Removedv0.9.4
  3. Addedv0.2.1

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses non-polling semantics, the timeout range and default, the return shape (event payload or timeout note), and the important 'already: true' fast-path for conditions that already hold — a subtle behavior that would otherwise cause spurious misses. This is exactly the kind of context annotations cannot carry.

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?

Front-loaded with the core behavior and information-dense throughout; every sentence earns its place. It is, however, one long run-on paragraph with deeply nested parentheticals, which costs some readability for an agent parsing it.

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?

Covers the event vocabulary, filtering semantics, timeout bounds, the already-true edge case, and invocation context. An output schema exists, yet the return behavior is still summarized usefully — nothing needed to call this correctly is missing.

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?

Schema description coverage is 0%, so the description carries the full burden and does: it enumerates all seven valid event values with explanations, defines match as a case-insensitive substring filter over class/title/workspace name/address/namespace, and pins timeout_s to 1-60 with default 10. This is richer than what an annotated schema would typically provide.

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?

States a precise verb and resource ('Block until a desktop event happens') and immediately scopes it as real compositor events rather than polling, then enumerates the exact event set. An agent can tell this apart from action-oriented siblings like launch, click_ui, or binds without opening any schema.

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?

Gives concrete when-to-use triggers: 'after actions with delayed effects: app startups, page loads that change a window title, a launcher bind that pops a layer.' That routes the agent from siblings like launch/binds into this tool. It does not name an explicit alternative or state a when-not-to-use condition, 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.