Skip to main content
Glama

pi_wait_agent

Waits for a delegated Pi agent to need input, finish, fail, or be interrupted, so the main agent can pause without polling. Timeouts do not stop the agent; wait again or inspect progress.

Instructions

When no independent work remains, wait for this agent to need input, finish, fail or be interrupted. The MCP process waits without calling a model; progress changes alone do not wake it. Already actionable states return immediately. Returns {status,timed_out,next}; no progress, question or delivery body, and no event acknowledgement. On timeout Pi keeps running: wait again or inspect progress. Read questions with pi_poll_agent and final delivery with pi_get_result. Cancelling the wait does not stop Pi.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
timeout_msNoMaximum wait in milliseconds (default 180000 / 3 minutes, max 300000 / 5 minutes). The MCP client tool timeout must exceed this duration. A timeout does not stop the agent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so richly: the wait calls no model, progress changes alone do not wake it, the return shape is {status,timed_out,next} with no body or acknowledgement, and timeout/cancellation leave Pi running. These are exactly the non-obvious traits an agent could not 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?

Purpose and guardrail lead the text, followed by return shape and recovery guidance; every sentence adds operational value. It is dense and slightly run-on, but there is essentially no filler to cut.

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?

Despite having no output schema and no annotations, the description discloses the return shape, the blocking semantics, and the timeout/cancel behavior an agent needs. Nothing required to call this correctly or interpret the result is missing.

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 50%: timeout_ms is well documented in-schema, while session_id is undocumented in both places. The description reinforces timeout semantics ('On timeout Pi keeps running: wait again or inspect progress') but adds nothing about identifying the session, so it neither under- nor over-compensates for the gap.

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 (wait) on a specific resource (this agent) with the exact conditions that end the wait: need input, finish, fail, or be interrupted. It also scopes when the tool is appropriate ('when no independent work remains'), which cleanly separates it from the polling and result siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit timing guidance ('When no independent work remains'), an edge-case rule ('Already actionable states return immediately'), and named alternatives with their distinct roles: pi_poll_agent for questions, pi_get_result for final delivery. An agent knows exactly when to reach for this versus a sibling.

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