map_reduce
Map a prompt over multiple inputs in parallel, then reduce the results into a single synthesis using a single API call.
Instructions
Map a prompt over inputs in parallel, then reduce results into one — all in a single call. Fan-out then synthesise: map produces N results, reduce consumes them, no manual plumbing.
Args: prompt_template: Prompt template with {input} placeholder(s). inputs: JSON array of input strings: ["input1", "input2", ...]. synthesis_prompt: Instructions for how to synthesise the map results. sandbox: Named sandbox spec or inline JSON (used for map agents). network: Whether containers have network access (default: true — needed for API calls). tools: Comma-separated list of allowed Claude tools for map agents. model: Claude model for map agents (default: sonnet). reduce_model: Claude model for the reduce agent (default: same as model). timeout: Max execution time per agent in seconds (default: 120). max_concurrency: Max map agents running simultaneously (default: 5). system_prompt: System prompt for map agents. reduce_system_prompt: System prompt for the reduce agent. output_schema: JSON schema for structured reduce output. mcps: JSON array of MCP server names for map agents. effort: Effort level for map agents.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_template | Yes | ||
| inputs | Yes | ||
| synthesis_prompt | Yes | ||
| sandbox | No | ||
| network | No | ||
| tools | No | Read,Write,Glob,Grep,Bash | |
| model | No | sonnet | |
| reduce_model | No | ||
| timeout | No | ||
| max_concurrency | No | ||
| system_prompt | No | ||
| reduce_system_prompt | No | ||
| output_schema | No | ||
| mcps | No | ||
| effort | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |