Skip to main content
Glama

wait_for_result

Read-onlyIdempotent

Blocks until a task thread produces its stored result and returns that record, or null when the timeout lapses; use it to await results by thread_id.

Instructions

Block until the task named by thread_id produces its result (thread_result_set) and return the result record {thread_id, result, produced_by, produced_at}, or null when the timeout lapses; this is the wait in spawn, wait, aggregate. Unlike the event waits it returns the stored result rather than an event, and it needs a thread_id. A live wait does not see a result that already exists: read it with get_thread_result first, or use get_dependency_results for every dependency result of a parent at once. since_log_id replays a result set on this thread after that log_id before waiting live. To put a deadline on a thread instead, use set_wait. Requires workspace:read.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "thread_id": "<thread_id>"
    },
    "name": "wait_for_result"
  }
}

Input Schema

NameRequiredDescriptionDefault
thread_idYesUUID of the task thread whose result to await. You must be able to read it.
timeout_msNoWait window in milliseconds, from 1 to 300000 (default 30000). When it lapses the tool returns null.
since_log_idNoYour high-water log_id. The log is replayed for a matching event with a log_id greater than this before the wait goes live, so an event in the gap between two calls is caught. Omitted, only events after the call count.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv479.0.2
    • changedInput schema / properties / since_log_id / description
      Previous value: -"lookback anchor: replay the log for a matching event with log_id greater than this before parking live"New value: +"Your high-water log_id. The log is replayed for a matching event with a log_id greater than this before the wait goes live, so an event in the gap between two calls is caught. Omitted, only events after the call count."
    • addedInput schema / properties / thread_id / description
      Added value: +"UUID of the task thread whose result to await. You must be able to read it."
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"wait window ms (default 30000, clamped 1000-300000)"New value: +"Wait window in milliseconds, from 1 to 300000 (default 30000). When it lapses the tool returns null."
  2. First observedv479.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the readOnlyHint/idempotent annotations, the description discloses the blocking behavior, the null-on-timeout outcome, the exact return record shape, and the required workspace:read scope. The one non-obvious caveat that a live wait cannot observe a pre-existing result is also flagged. Slight gap: nothing about concurrency or whether multiple waiters are allowed.

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 core behavior is front-loaded in the first clause, and the follow-on sentences each carry a distinct caveat or alternative. It runs long and includes mild redundancy such as restating that thread_id is required, but no sentence is pure filler.

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?

With no output schema, the description compensates by spelling out the returned record fields and the null-on-timeout case. Combined with the permission requirement and alternatives, an agent has enough to call this correctly; only edge-case behavior under concurrent waiters is unaddressed.

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?

Schema coverage is 100%, so timeout_ms bounds and the since_log_id high-water meaning are already documented. The description reinforces since_log_id's replay semantics ('replayed before the wait goes live') and the timeout-lapse null return, but adds little that the schema doesn't already say. Baseline 3 is appropriate.

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 (block until the thread produces its result), names the returned record fields, and explicitly distinguishes itself from the event waits and from get_thread_result. An agent can identify this tool's role in the spawn/wait/aggregate flow without opening the schema.

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?

Gives explicit when-to-use and when-not-to-use guidance with named alternatives: use get_thread_result for an already-existing result, get_dependency_results for all dependency results at once, and set_wait to put a deadline on a thread. The preconditions (needs thread_id, requires workspace:read) are stated outright.

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

Deploy Server

Other Tools