Skip to main content
Glama
bill-kopp-ai-dev

Claude Code CLI MCP Server

claude_poll_task

Check the status of an asynchronous Claude Code task by run ID, retrieving new messages, output sizes, and elapsed time. Use drain mode to block until the task finishes and returns its full result.

Instructions

Poll an asynchronous task.

Two polling modes: - drain=false (default): returns immediately with current state (new messages, stdout/stderr byte counts, elapsed time). Use for tight control loops with explicit backoff. - drain=true: blocks until status is no longer 'running' (fire-and-wait). Note: this is bounded by your MCP client's request timeout, not the async task's timeout_s. For long blocks, prefer async drain with orchestrator-level polling.

Returns: ClaudePollTaskResponse with status (running|done|error|timeout|cancelled), new_messages, stdout_len/stderr_len, elapsed_seconds, and (once terminal) the full result with total_cost_usd, model_usage, and changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reqNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesNo
resultNo
run_idYes
statusYes
stderr_lenNo
stdout_lenNo
new_messagesNo
elapsed_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description fully carries behavioral disclosure. It states that drain=false returns immediately, drain=true blocks and is bounded by the client request timeout, and it lists the return fields and terminal statuses. This is transparent about the tool's behavior.

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 description is well-structured with bullet points and a return section, making it easy to scan. It front-loads the core purpose and then details modes, without unnecessary sentences.

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?

An output schema exists, so return details are partially covered, but the description still outlines the response structure. It covers the main behavioral differences and timeout bound. Missing details like wait_seconds are minor, making it sufficiently complete for a polling tool.

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 0%, so the description must compensate. It thoroughly explains the 'drain' parameter (the core behavior) but does not mention 'wait_seconds' or the nullable 'req' field. The omission of wait_seconds leaves a partial gap in parameter understanding.

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 clearly states 'Poll an asynchronous task' with a specific verb and resource. It distinguishes itself from siblings like claude_start_task, claude_cancel_task, and claude_list_runs, leaving no ambiguity about its role.

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?

It explicitly describes two polling modes—drain=false for tight control loops with explicit backoff and drain=true for fire-and-wait—and advises orchestrator-level polling for long blocks. While it doesn't name alternatives directly, the mode guidance provides clear when-to-use context.

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