mavis_spawn_worker
Spawn an independent worker agent for code review, testing, or verification tasks. The agent runs as a child session and reports results back.
Instructions
Spawn a single-shot worker/verifier agent as a child session. Use for code review, test, verify tasks. The agent runs independently and reports back. For complex multi-agent tasks, use mavis_team_plan instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | Yes | Agent name (e.g. general, coder, verifier) | |
| prompt | Yes | Task description for the worker agent | |
| workspace | No | Working directory for the worker | |
| parentSession | No | Parent session ID (for result routing) |
Implementation Reference
- src/index.js:425-441 (handler)The tool specification (spec object) for 'mavis_spawn_worker'. This is the full definition including the buildArgs function that constructs the command line args for spawning a worker agent. The handler is executed via runTool which calls execMavis (or execMavisJSON) with the built args. In this spec, there is no execFn set, so the default path uses execMavisJSON (line 84) which spawns the mavis CLI binary with ['session', 'new', agent, '--from', parentSession|'root', '--workspace', workspace?, '--prompt', prompt].
{ name: 'mavis_spawn_worker', description: 'Spawn a single-shot worker/verifier agent as a child session. Use for code review, test, verify tasks. The agent runs independently and reports back. For complex multi-agent tasks, use mavis_team_plan instead.', inputSchema: z.object({ agent: z.string().describe('Agent name (e.g. general, coder, verifier)'), prompt: z.string().describe('Task description for the worker agent'), workspace: z.string().optional().describe('Working directory for the worker'), parentSession: z.string().optional().describe('Parent session ID (for result routing)') }), buildArgs: ({ agent, prompt, workspace, parentSession }) => { const args = ['session', 'new', agent]; if (parentSession) args.push('--from', parentSession); else args.push('--from', 'root'); if (workspace) args.push('--workspace', workspace); args.push('--prompt', prompt); return args; }