Skip to main content
Glama

wait_task

wait_task
Read-only

Poll a task until it reaches a terminal state or needs user input, then return a status snapshot. After a timeout, call it again to continue waiting without affecting the task.

Instructions

等待任务到达停点(阻塞只读原语):轮询至终态(succeeded/failed/needs_attention/cancelled/interrupted)或 needs_user,或超时(timeoutMs 缺省 50000ms、上限 600000ms)后返回当前状态快照。适合回合驱动的调用方:run_task 后在本回合内等待结果。超时返回时请再次调用本工具继续等待——本调用不影响任务本体,超时/中断均无害。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes
timeoutMsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.7

TDQS

A4.5/5.0
Behavior5/5

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

Annotations establish a safe read (readOnlyHint=true, destructiveHint=false), and the description adds substantial context beyond them: it is a blocking polling primitive, timeoutMs defaults to 50000ms with a 600000ms cap, and on timeout/interruption the call is harmless and does not affect the task. This tells the agent retrying is safe and the task state is untouched.

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?

A single dense paragraph with the core behavior, terminal states, and timeout rules front-loaded; every clause carries information. It is heavy in one block with limited visual separation, but nothing is padding.

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 covers the return sufficiently as a 'current state snapshot' and names the terminal states. Combined with the timeout and retry guidance, an agent has what it needs to call it correctly, though it could be clearer about what the snapshot contains.

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 0%, so the description must compensate, and it does for timeoutMs by giving both a default (50000ms) and an upper bound (600000ms) that the schema lacks. taskId semantics (which task to wait on) remain implicit, so it is strong but not exhaustive.

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 (wait for a task to reach a stop point), defines the blocking-read nature, and enumerates the exact terminal states it waits for (succeeded/failed/needs_attention/cancelled/interrupted/needs_user). An agent can distinguish it from siblings like get_task_report, query_task, and wait_any without inspecting 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?

Explicitly says it fits turn-driven callers that call run_task and then wait within the same turn, and instructs to call it again on timeout. It does not, however, address when to prefer it over the sibling wait_any, leaving that choice to inference.

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