Skip to main content
Glama

Wait for events

events_wait
Read-only

Waits for selected game events and returns as soon as one arrives or after timeout, using a returned cursor so no events are missed between calls.

Instructions

Waits for events of this game instance and returns AS SOON AS one of the wanted types arrives (all that arrived, up to limit), or after timeout_s with timed_out: true. Types: menu_ready, runtime_injected, realm_up, realm_down, realm_ready, map_loaded, disconnected, disconnect_reason, connection_failed, main_thread_stalled, main_thread_resumed, lua_error, runtime_error, report (a mcpagent.report value), focus_released, user: (sent by game code with mcpagent.event(type, data)). Without cursor it waits for events from now on; pass the returned next_cursor to the next call so nothing is missed in between. The instance keeps the last 5000 events (lost > 0 = some were dropped before you read them). Result: {events: [{seq, time (s since module start), type, data}], next_cursor, lost, timed_out}. Example: {"types": ["map_loaded", "lua_error"], "timeout_s": 60}.

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

Input Schema

NameRequiredDescriptionDefault
limitNoMax number of events (default 100).
typesNoTypes to wait for (empty = all).
cursorNoCursor (next_cursor from a previous call).
instanceNoOptional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance.
timeout_sNoMax wait (default 30).

Output Schema

NameRequiredDescriptionDefault
lostNo
nextNo
noteNo
eventsYes
warningNo
next_callNo
timed_outNo
answered_byNo
next_cursorYes
truncated_noteNo
version_warningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations by disclosing the 5000-event ring buffer, that lost > 0 means earlier events were dropped before reading, the cursor continuation model, and the exact result shape {events, next_cursor, lost, timed_out}. The only gap is that the result-shape sentence is duplicated by the output schema rather than adding new behavior detail.

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-loads the return condition, then type list, then cursor workflow, then result shape, ending with a copy-pasteable example. It is a single dense block rather than scannable sections, and the result-shape sentence largely restates the output schema, but no sentence is filler.

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?

With 5 optional parameters, an output schema, and a stateful cursor protocol, the description covers everything an agent needs: trigger semantics, type vocabulary including the user:<type> extension, buffer-loss signaling, timeout behavior, and example invocation. Nothing required to call it correctly is missing.

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 description coverage is 100%, so the baseline is 3; the description still adds real meaning by explaining cursor lifecycle (what omitting it does and where next_cursor comes from), that empty types means all, and that timeout_s produces timed_out: true. It does not explain limit truncation ordering beyond 'up to limit', so not a 5.

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 specific verb and resource ('Waits for events of this game instance') plus the exact resolution condition: returns as soon as one wanted type arrives, or after timeout_s with timed_out: true. The enumerated type list (menu_ready, realm_up, lua_error, user:<type>, ...) makes it unmistakably the event-stream waiter rather than a frame or console waiter.

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 calling guidance: empty types = all, omit cursor to start from now, pass the returned next_cursor on the next call 'so nothing is missed in between', and a worked example payload. It stops short of naming when to prefer a sibling such as console_wait or wait_frames, so it is clear context without explicit exclusions.

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