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
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | Short stable name, e.g. a task id. Becomes the session title prefix. | |
| model | No | jcode model id; omit for the configured default. | |
| title | No | Human-readable task title shown in jcode. | |
| prompt | Yes | The full task for the agent. It has no other context. | |
| worktree | No | Create a fresh git worktree and branch and run the agent there. | |
| working_dir | No | Absolute directory to work in. Use worktree instead for isolation. | |
| auto_approve | No | Auto-allow every tool permission request. Default false: requests wait for respond_permission. |