Skip to main content
Glama

spawn_session

Start a headless coding agent session to execute an independent task in an isolated working directory, while preserving the host's native approval controls.

Instructions

Start a new headless persisted Claude, Codex, Copilot, Cursor, Gemini, Grok, or OpenCode session for independent work. Provide a complete task and request a reply. Pass an explicit isolated cwd when concurrent edits could collide. The host's native approvals apply; magents does not bypass them. An accepted/starting response means launch was accepted, not completed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoIsolated working directory for the new session
agentYesclaude, codex, copilot, cursor, gemini, grok, or opencode
messageYesComplete independent task, including verification and how to reply

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations available, the description carries the behavioral burden and does well: it discloses headless persistence, independent session execution, approval behavior, and the crucial asynchronous semantic that an accepted response does not mean completion. It could additionally mention return shape or how to later retrieve results, but the disclosed behaviors are substantial.

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?

Four sentences, each earning its place: purpose, task requirement, collision safety, approval and async semantics. The most important information is front-loaded, and there is no filler or redundant restating of the schema.

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 tool with no output schema and no annotations, the description covers the core invocation requirements, safety concerns, and response interpretation. The only minor gap is not specifying what the accepted/starting response actually contains or how to subsequently await completion, but the async caveat is already explicitly stated.

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 beyond the schema by explaining when cwd matters ('when concurrent edits could collide') and by framing message as a complete task that must include verification and reply instructions. This is meaningful enrichment, not schema repetition.

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: 'Start a new headless persisted ... session for independent work.' It names the supported agents and clearly separates this launch action from sibling tools like list_sessions, get_session, stop_session, and await_reply. An agent can identify exactly what spawn_session does without opening the 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?

It gives concrete usage guidance: provide a complete task, request a reply, and pass an isolated cwd when concurrent edits could collide. It also clarifies that host approvals still apply. It does not explicitly name alternatives or say when not to use it, but the context is strong enough for correct invocation.

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