Skip to main content
Glama

spawn_session

Start a new headless persisted coding agent session to run an independent task. Use an isolated working directory when concurrent edits could collide.

Instructions

Start a new headless persisted Claude, Codex, Copilot, Cursor, Gemini, AGY, 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

NameRequiredDescriptionDefault
cwdNoIsolated working directory for the new session
agentYesagy, claude, 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. Changed1 schema field changedv0.14.2
    • changedInput schema / properties / agent / description
      Previous value: -"claude, codex, copilot, cursor, gemini, grok, or opencode"New value: +"agy, claude, codex, copilot, cursor, gemini, grok, or opencode"
  2. First observedv0.11.0

TDQS

A4.5/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 burden and delivers non-obvious behavior: sessions are headless and persisted, the host's native approvals apply and magents 'does not bypass them' (an authorization constraint), and an accepted/starting response means launch was accepted, 'not completed' (async semantics). These are exactly the traits an agent could otherwise get wrong.

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?

Five short sentences, purpose front-loaded, with every sentence contributing either purpose, parameter guidance, or behavior. The agent enumeration in sentence one and in the schema is mildly redundant, but nothing is padded or buried.

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 3-parameter tool with no annotations and no output schema, the description covers purpose, parameter expectations, approval behavior, and async response semantics. The one remaining gap is that, absent an output schema, it does not say what the accepted/starting response actually contains (e.g., a session id to use with the sibling tools).

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 baseline is 3, but the description adds real meaning on top: the message should contain the complete independent task including verification and how to reply, and cwd is only needed when concurrent edits could collide. That is guidance the schema's terse field descriptions do not provide.

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 precise verb+resource ('Start a new ... session') and scopes it as headless, persisted, and 'for independent work', which cleanly separates it from siblings that operate on existing sessions (send_message, reply, await_reply, stop_session). An agent can tell what this tool creates 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 actionable conditions: supply a complete task and request a reply, and pass an explicit isolated cwd 'when concurrent edits could collide'. It also notes the host approval regime, which is context an agent needs before invoking. It never names an alternative (e.g., when to reuse an existing session instead of spawning), so it stops short of full when/when-not routing.

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