Skip to main content
Glama

run

Spawn a sandboxed pi agent in RPC mode with optional read/write/denied mounts; it starts idle and waits for send_message, enabling isolated agent execution and artifact inspection.

Instructions

Spawn a bwrap-caged pi agent in RPC mode with optional write/read/denied mount rules. The agent starts idle and waits for send_message. Returns immediately. The agent's /tmp is forwarded to its artifact directory and can be inspected with list_tmp, grep_tmp, read_tmp, read, grep, and get_info. Inside an agent, AGENT_ID names itself; call run(callback_agent_id=AGENT_ID) to have pi-mcp prompt you with the child's result and artifact paths when it settles. Pass access_token to put the child in that token's group and patch only its MCP config. Pass context_size to lower this agent's pi context budget so autocompaction starts during long runs. When called by a caged agent, requested mounts are narrowed to that agent's mounts.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "run"
  }
}

Input Schema

NameRequiredDescriptionDefault
readNo
modelNo
writeNo
deniedNo
providerNo
access_tokenNo
context_sizeNo
callback_agent_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that the call returns immediately (async spawn), that the child is idle until send_message, that /tmp is forwarded to an artifact directory, that access_token patches only the child's MCP config, and that a caged parent's mount requests are narrowed. Gaps remain around resource limits, auth/permission requirements for spawning, and error or failure modes.

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?

Front-loaded with the core spawn action, and every sentence adds real information — nothing is filler. The downside is that it is a single unstructured block mixing lifecycle, inspection siblings, callback wiring, and mount inheritance, so dense operational details are hard to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 values need not be explained, and 'returns immediately' covers the timing question. For an 8-parameter spawn tool with 0% schema coverage and no annotations, though, the undocumented model/provider parameters and the absent failure and cleanup behavior leave an agent short of what it needs to call this confidently.

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?

Adds real meaning for read/write/denied (mount rules), access_token (group membership + MCP config patch), context_size (context budget), and callback_agent_id (AGENT_ID self-reference pattern). But 'model' and 'provider' are never explained, and the mount parameters are not described as path arrays or as an allow/deny precedence model, which matters at 0% schema coverage.

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 and resource — 'Spawn a bwrap-caged pi agent in RPC mode' — plus the immediate lifecycle state ('starts idle and waits for send_message'). This distinguishes it cleanly from siblings like send_message, list, and remove without opening a schema.

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?

Gives concrete when-to-use conditions for the optional behaviors: use callback_agent_id=AGENT_ID to get prompted with the child's result, pass access_token to join a token's group, pass context_size to force autocompaction during long runs. However, it never explicitly states when to prefer this over resurrect or when not to spawn, so an agent must infer the boundary.

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