Skip to main content
Glama

pi_dispatch

Dispatch a task to a new pi sub-agent session running in the specified working directory. Returns a taskId immediately for later polling via pi_wait or pi_read.

Instructions

Dispatch a task to a new pi sub-agent session (spawns pi --mode rpc in cwd). Returns immediately with a taskId; use pi_wait to block for the result or pi_read to inspect progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYesWorking directory pi operates in
nameNoOptional human-readable task name
taskYesInitial prompt / task description for pi
modelNoOptional model override, e.g. 'anthropic/claude-sonnet-4'
approveNoPass --approve to pi: trust project-local files (.pi/extensions etc.) for this run.
interactiveNoDefault true: blocking UI dialogs (confirm/select/input/editor) surface as pendingRequest for pi_respond. Set false for unattended runs: dialogs are auto-cancelled.
Behavior4/5

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

With no annotations, the description carries the burden and does disclose key behaviors: the subprocess spawn, the working directory, immediate async return, and the need for pi_wait/pi_read to retrieve results. It does not cover failure modes or resource cleanup, but the core behavioral traits are clearly revealed.

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 two sentences, front-loaded with the action and mechanism, then provides workflow guidance. Every word contributes, with no repetition or filler.

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?

The tool has 6 parameters but all are fully schema-documented, and the description covers the essential dispatch workflow, including the immediate return and follow-up tools. It lacks explicit error-handling details, but for a straightforward dispatcher with rich schema coverage, this is sufficiently complete.

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 100%, so baseline 3 applies. The description adds little parameter-specific meaning beyond what the schema already provides; it only mentions cwd indirectly and taskId as a return value, not as a parameter.

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 uses a specific verb+resource ('Dispatch a task to a new pi sub-agent session') and clearly states the mechanism (spawns `pi --mode rpc`). It differentiates from sibling tools by noting the immediate return of a taskId and explicitly referencing pi_wait and pi_read for follow-up.

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 provides clear context on when to use this tool (to start a new session) and directs the agent to pi_wait for blocking and pi_read for progress inspection. However, it does not explicitly contrast with pi_send or state when not to use this tool, such as for existing sessions or non-blocking sends.

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/turbin/pi-subagent-mcp'

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