Skip to main content
Glama

wait_for_task

Blocks execution until an async operation reaches a terminal state—completed, failed, or canceled—and returns the final status without manual polling. Includes a timeout indicator.

Instructions

Block until an async operation reaches a terminal state.

Preferred over manual polling with get_task_status. Returns quickly when the op is fast; otherwise polls at poll_interval_seconds until Completed, Failed, or Canceled — or until timeout_seconds is reached, in which case the last observed status is returned with timed_out=true so the caller can decide whether to keep waiting.

Args: operation_token: Token from the originating async tool. timeout_seconds: Maximum time to wait (default 60). Set higher for large folder deletes or large copies. poll_interval_seconds: Delay between status checks (default 1.0). Bounded below at 0.1s.

Returns: Same payload as get_task_status, with an added timed_out boolean indicating whether the wait ended on timeout.

On failure: if a poll call fails mid-wait, returns {"mode": "error", "error": <slug>, "operation_token": <str>, ...}. Common slugs: not_found (token invalidated by server restart), auth_failed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operation_tokenYesOperation token returned by an async tool (delete_entry, copy_entry, occasionally import_document). Server-scoped; tokens from a different server instance won't resolve.
timeout_secondsNoMaximum time to wait. Set higher for large folder deletes or large copies. Returns the last observed status with timed_out=True if the deadline is reached.
poll_interval_secondsNoDelay between status checks. Bounded below at 0.1s.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations exist, so the description fully bears the burden. It thoroughly explains blocking, polling, timeout behavior (returns timed_out=true on timeout), terminal states (Completed, Failed, Canceled), and error handling with specific error slugs and failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loaded with the core action, and well-structured with sections for Args, Returns, and On failure. Every sentence serves a purpose without redundancy.

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?

Given no annotations but a known output schema, the description covers return payload similarity to get_task_status plus the added timed_out field, error responses, and common error slugs. It leaves no obvious gaps for this 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 baseline is 3. The description adds value beyond the schema by clarifying that operation_token is 'server-scoped' and that timeout_seconds should be increased for large operations, and poll_interval_seconds is bounded below at 0.1s.

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?

The description opens with a clear, specific verb-resource statement: 'Block until an async operation reaches a terminal state.' It distinguishes itself from manual polling (get_task_status) and other siblings by explicitly stating it blocks and handles polling.

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?

The description states 'Preferred over manual polling with ``get_task_status``.' and advises setting timeout for large operations. It provides clear usage context but does not explicitly state when NOT to use it (e.g., if you want non-blocking behavior or to poll manually).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SamuelSHernandez/laserfiche-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server