Skip to main content
Glama

Wait for Run Activity

deerflow_wait_activity
Read-onlyIdempotent

Block until a DeerFlow run yields new activity, completes, or times out, replacing many status polls with one call that returns as soon as activity appears.

Instructions

Block server-side until the run produces new activity, reaches a terminal status, or the timeout elapses — one call replaces many status polls. The server joins the run's live event stream (falling back to polling when the stream is unavailable), so it returns the moment new activity appears rather than on a fixed tick. Returns reason ('terminal' | 'activity' | 'timeout'), waited_seconds, timeout_seconds, the new activity since since_seq (one-line summaries), the plan-mode todo checklist, quiet/stall detection, and a next_step hint. Pass the returned last_event_seq as since_seq on the next call to continue from where you left off. While waiting it emits MCP progress notifications (elapsed/timeout) when the client supplies a progress token. Cancelling the request from the client aborts the wait and returns stop_reason 'cancelled_by_client'. Requires session or internal-token auth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYesThe run id.
since_seqNoOnly report events with seq greater than this (use last_event_seq from a previous response; 0 or omitted = latest events).
thread_idYesThe thread id.
timeout_secondsNoMaximum seconds to wait before returning (default 30, capped server-side).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hintNo
errorNo
quietYes
todosYes
reasonYes
run_idYes
statusYes
stalledYes
activityYes
terminalYes
next_stepNo
thread_idYes
created_atNo
updated_atNo
stop_reasonNo
total_tokensNo
message_countNo
last_event_seqNo
llm_call_countNo
waited_secondsYes
elapsed_secondsYes
timeout_secondsYes
last_activity_atNo
seconds_since_updateNo
seconds_since_activityNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.5

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: server-side blocking with live event-stream join and polling fallback, immediate return on activity rather than fixed ticks, cancellation semantics (stop_reason 'cancelled_by_client'), MCP progress notifications, and the auth requirement. Annotations only cover the read-only/idempotent profile, so this extra detail is genuinely valuable.

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?

Dense but front-loaded: the core purpose and replacement-for-polling claim come first, followed by return shape, continuation, notifications, and auth. Long, but nearly every sentence carries behavioral information; minor packing could trim the enumeration of return fields.

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?

An output schema exists so return values needn't be explained, yet the description still enumerates the key fields (reason, waited_seconds, last_event_seq) an agent needs to chain calls. Auth, cancellation, and fallback behavior are all covered, leaving no gaps for a long-polling tool.

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 the baseline is 3. The description goes beyond it by explaining the continuation workflow for since_seq (feed back last_event_seq) and the timeout framing, adding meaning the schema alone does not convey.

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?

Names a specific verb+resource ('block server-side until the run produces new activity') and immediately differentiates itself from the sibling status tools by stating it 'replaces many status polls.' An agent can distinguish this from deerflow_run_status and deerflow_run_progress without opening schemas.

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?

Clearly states the context of use (use instead of repeated status polling) and gives the continuation pattern: 'Pass the returned last_event_seq as since_seq on the next call.' It does not name a specific alternative tool or state when-not to use it, but the usage context is unambiguous.

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