Skip to main content
Glama

spawn

Delegate a task to a background pi agent and get a sessionId right away. Poll its status, redirect it, or answer its questions without blocking your main work.

Instructions

Delegate a task to a pi agent running in the background. Returns a sessionId immediately, so nothing blocks. Poll with status, redirect with steer, answer its questions with answer. Use this for anything that might take more than a minute.

Input Schema

NameRequiredDescriptionDefault
idNoYour own session id for traceability, e.g. "search-audit-01". 1-64 chars of [A-Za-z0-9._:-], must start alphanumeric, must not already be in use. Defaults to a UUID.
cwdNoWorking directory for the agent
labelNoFree-text note shown in `sessions`, e.g. what this delegate is for
modelNoModel as "provider/modelId", e.g. "openrouter/stealth/ox-alpha"
toolsNoTool allowlist for this delegate. [] disables all tools. Omit for defaults: read, grep, find, ls. Permitted on this server: read, grep, find, ls.
promptYesThe task for the pi agent
extensionsNoLoad pi extensions for this delegate. Off by default; they add startup cost and can misbehave.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.1
    • changedInput schema / properties / tools / description
      Previous value: -"Tool allowlist for this delegate. Default: read, grep, find, ls. Permitted on this server: read, grep, find, ls."New value: +"Tool allowlist for this delegate. [] disables all tools. Omit for defaults: read, grep, find, ls. Permitted on this server: read, grep, find, ls."
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations present, the description carries the burden and delivers the single most important trait: it returns a sessionId immediately and nothing blocks, so the agent knows not to expect an inline result. It omits other behavioral context such as permissions, session lifetime/cleanup (handled by `forget`/`abort`), and failure behavior.

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?

Three short sentences, front-loaded with the core action and followed by the async contract and lifecycle routing. No filler; every sentence carries actionable information.

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?

For a 7-parameter, no-output-schema tool this covers what an agent most needs: the async contract and the follow-up tools for polling, steering and answering. Residual gaps are minor – return payload shape beyond sessionId and failure/timeout behavior are unstated.

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 description coverage is 100%, so the schema already explains id, cwd, label, model, tools and extensions in detail. The description adds no parameter-level meaning beyond that (e.g. it never mentions the tools allowlist or model override), so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: "Delegate a task to a pi agent running in the background," which is unambiguous. It implicitly separates itself from `run` via the timing heuristic ("more than a minute"), but never names `run` or `spawn_batch` explicitly, so sibling differentiation is inferred rather than stated.

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?

Gives an explicit when-to-use rule ("anything that might take more than a minute") and then routes the agent through the full lifecycle: poll with `status`, redirect with `steer`, answer questions with `answer`. This is exactly the alternative-naming guidance an agent needs to pick and follow this tool correctly.

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