Skip to main content
Glama

spawn_agent

Start a jcode agent session for a task in its own git worktree so parallel agents avoid editing the same files; poll status or wait briefly for results.

Instructions

Start a jcode agent session on a task and return immediately. The session is a normal jcode session (visible in jcode Desktop and the TUI when connected to the user's jcode). Give it a git worktree so parallel agents do not edit the same files. Poll with agent_status, or block briefly with wait_agents.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "label": "<label>",
      "prompt": "<prompt>"
    },
    "name": "spawn_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelYesShort stable name, e.g. a task id. Becomes the session title prefix.
modelNojcode model id; omit for the configured default.
titleNoHuman-readable task title shown in jcode.
promptYesThe full task for the agent. It has no other context.
worktreeNoCreate a fresh git worktree and branch and run the agent there.
working_dirNoAbsolute directory to work in. Use worktree instead for isolation.
auto_approveNoAuto-allow every tool permission request. Default false: requests wait for respond_permission.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
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 traits: the call is non-blocking, the session is a real visible jcode session in Desktop/TUI, and worktree isolation prevents file conflicts. It stops short of describing lifecycle/failure behavior or what happens to a session whose agent errors out.

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 short sentences, front-loaded with the action and its non-blocking nature, followed by visibility, isolation rationale, and next steps. No filler.

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?

For a 7-parameter tool with a nested object, no annotations, and no output schema, the description leaves a real gap: it never says what is returned (an agent id or label) so the caller knows how to address the new session in agent_status/message_agent. Everything else an agent needs is either stated or present in the schema.

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 all seven parameters (including the nested worktree object) are already documented. The description only adds the rationale for worktree (avoiding parallel-edit conflicts), which is useful but not meaningfully beyond the schema baseline.

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 ("Start a jcode agent session on a task") plus a critical behavioral qualifier ("return immediately"). It also names the siblings that handle the follow-up (agent_status, wait_agents), so an agent can distinguish this from polling/waiting tools without inspecting schemas.

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 actionable guidance: use a worktree so parallel agents don't edit the same files, then poll with agent_status or block with wait_agents. It does not state when NOT to spawn an agent (e.g. use message_agent for an existing session), but the positive routing guidance is clear.

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