Orchestration API
Execute multiple tool calls in a single request with automatic concurrency optimization. Read-only tools run in parallel while mutating tools serialize, reducing total execution time without sacrificing safety.All orchestration endpoints require bearer token authentication. The
authenticate middleware is applied when the router is mounted, so every request must include a valid Authorization: Bearer <token> header. Requests are also subject to the general API rate limit of 120 requests per minute.Execute batch
Request body
t1 and t2 are read-only and run in parallel. t3 is mutating and runs alone. t4 is read-only and runs after t3 completes.
Response
Errors
Each tool object in the array must include both
id and toolName. The API validates these fields and returns a 400 error if any tool object is missing either field.Tool output structure
Each tool result’soutput field contains a ToolExecutionResult object with the following fields:
Safety limits
The tool executor enforces these limits during batch execution:Serial failure behavior
When a mutating tool fails during serial execution, the batch stops immediately. Remaining tools in that serial batch are not executed. Parallel batches that already completed are unaffected.Partition (dry run)
Request body
Response
Errors
Unlike the batch endpoint, the partition endpoint does not reject empty arrays or enforce a maximum tool limit. An empty
tools array returns an empty batches array.Tool classification
Each tool is classified asreadonly (parallelizable) or mutating (must serialize). Unknown tools default to mutating as a safety measure.
Read-only tools
These tools have no side effects and can safely run in parallel:Mutating tools
These tools modify state and must run one at a time:Shell command introspection
Forbash, exec, and shell tools, the classifier inspects the command input to determine the actual concurrency class. Read-only shell commands are promoted to readonly:
Shell commands not in this list are classified as
mutating.
Partitioning rules
The partitioner groups tool calls into execution batches using these rules:- Consecutive read-only tools become a single parallel batch
- Each mutating tool gets its own serial batch
- Two adjacent mutating tools are placed in separate serial batches (they do not merge)
Example
Given tools:[read, grep, bash("cat file"), write, read, bash("git push")]
The partitioner produces:
The
bash("cat file") command is promoted to readonly via shell command introspection, so it joins the first parallel batch. The read at position 5 starts a new parallel batch because the preceding write forced a serial boundary.