Skip to main content
Glama

kilo_task_wait

Waits for a background coding task to finish or time out, then returns its terminal result or a timeout status summary with progress.

Instructions

Wait until a background kilo_implement task reaches a terminal state (completed, failed, failed_with_uncommitted_work, cancelled, error) or timeout_seconds elapses, polling cheaply every 2 seconds and reconciling orphaned processes from their log files via _reconcile_task_if_orphaned. Also waits through queued -> running -> terminal for queued tasks, restarting the detached queue runner if it has died.

Accepts timeout_seconds up to at least 3600s (or more) for long runs and returns as soon as the task ends. When terminal, returns the kilo_task_result output (trimmed by default, or full trace with include_trace=True). On timeout, does not raise: returns a clear status message with current progress and elapsed seconds.

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": {
      "task_id": "<task_id>"
    },
    "name": "kilo_task_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
task_idYesThe task_id returned by kilo_implement when launched with background=true (the default).
include_traceNoIf True, includes the full execution trace in the terminal result. Defaults to False (returns trimmed result: status, exit code, session_id, worktree/branch when present, Final Report, and log path).
timeout_secondsNoMaximum seconds to wait before returning a status summary. Accepts up to at least 3600 seconds (or more). Defaults to None (wait up to KILO_TIMEOUT, at least 3600).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well: it discloses 2-second polling, orphan reconciliation from log files, an active side effect of restarting a dead detached queue runner, and crucially that a timeout does NOT raise but returns a status summary with progress and elapsed seconds. Those are exactly the behavioral traits an agent cannot infer from the schema.

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?

Content is front-loaded: blocking semantics first, then timeout tolerance, then return behavior. Some sentences are padded with hedges like 'up to at least 3600s (or more)' and awkward mid-sentence line breaks, but no sentence is redundant or off-topic.

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?

For a blocking wait tool with one required and two optional parameters, the description covers the terminal-condition contract, the timeout contract (no exception, progress summary returned), orphan handling, and result shaping. An output schema exists, yet the description still summarizes the trimmed versus full result, leaving nothing an agent needs before calling it.

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 adds value by tying task_id to its provenance (returned by kilo_implement when launched with background=true) and by contrasting include_trace=True (full trace) against the default trimmed payload (status, exit code, session_id, worktree/branch, Final Report, log path). It slightly repeats the schema's own timeout wording rather than adding new syntax.

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 specific verb and resource: wait until a background kilo_implement task reaches a terminal state, and it enumerates the terminal states (completed, failed, failed_with_uncommitted_work, cancelled, error). The blocking-until-terminal framing distinguishes it from polling siblings such as kilo_task_status or kilo_task_progress without needing their definitions.

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 gives clear context for use: tasks launched with background=true, queued tasks that must transition through queued -> running -> terminal, and long runs via timeout_seconds up to at least 3600s. It never explicitly states when NOT to use it (e.g., use kilo_task_status for a non-blocking peek), so the exclusions/alternatives dimension is implied rather than stated.

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