Batch Execute
batch_executeExecute multiple math operations in one request with automatic dependency chaining, reducing tokens and API calls for multi-step calculations like financial models and data pipelines.
Instructions
Execute multiple math operations in a single request with automatic dependency chaining.
USE THIS TOOL when you need 2+ calculations where outputs feed into inputs (bond pricing, statistical workflows, multi-step formulas). Don't make sequential individual tool calls.
Benefits: 90-95% token reduction, single API call, highly flexible workflows
Quick Start
Available tools (20): • Basic: calculate, percentage, round, convert_units • Arrays: array_operations, array_statistics, array_aggregate, array_transform • Statistics: statistics, pivot_table, correlation • Financial: financial_calcs, compound_interest, perpetuity • Linear Algebra: matrix_operations, solve_linear_system, matrix_decomposition • Calculus: derivative, integral, limits_series
Result referencing:
Pass $op_id.result directly in any parameter:
$op_id.result- Use output from prior operation$op_id.result[0]- Array indexing$op_id.metadata.field- Nested fields
Example: "payment": "$coupon.result" or "variables": {"x": "$op1.result"}
Example - Bond valuation:
{
"operations": [
{"id": "coupon", "tool": "calculate",
"context": "Calculate annual coupon payment",
"arguments": {"expression": "principal * 0.04", "variables": {"principal": 8306623.86}}},
{"id": "fv", "tool": "financial_calcs",
"context": "Future value of coupon payments",
"arguments": {"calculation": "fv", "rate": 0.04, "periods": 10,
"payment": "$coupon.result", "present_value": 0}},
{"id": "total", "tool": "calculate",
"context": "Total bond maturity value",
"arguments": {"expression": "fv + principal",
"variables": {"fv": "$fv.result", "principal": 8306623.86}}}
],
"execution_mode": "auto",
"output_mode": "minimal",
"context": "Bond A 10-year valuation"
}When to Use
✅ Multi-step calculations (financial models, statistics, transformations) ✅ Data pipelines where step N needs output from step N-1 ✅ Any workflow requiring 2+ operations from the tools above
❌ Single standalone calculation ❌ Need to inspect/validate intermediate results before proceeding
Execution Modes
auto(recommended): DAG-based optimization, parallel where possiblesequential: Strict orderparallel: All concurrent (only if truly independent)
Output Modes
full: Complete metadata (default)compact: Remove nulls/whitespaceminimal: Basic operation objects with valuesvalue: Flat {id: value} map (~90% smaller) - use this for most casesfinal: Sequential chains only, returns terminal result (~95% smaller)
Structure
Each operation:
tool: Tool name (required)arguments: Tool parameters (required)id: Unique identifier (auto-generated if omitted)context: Optional label for this operation
Batch-level context parameter labels entire workflow across all output modes.
Response includes: per-operation status, result/error, execution_time_ms, dependency wave, summary stats.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Optional annotation to label this calculation (e.g., 'Bond A PV', 'Q2 revenue'). Appears in results for easy identification. | |
| output_mode | No | Output format: full (default), compact, minimal, value, or final. See batch_execute tool for details. | full |
| operations | Yes | List of operations to execute. Each operation MUST include: tool (name), arguments (dict). Optional: id (UUID/string), context, label, timeout_ms (int) | |
| execution_mode | No | Execution strategy: sequential (order), parallel (concurrent), auto (DAG-based) | auto |
| max_concurrent | No | Maximum concurrent operations (applies to parallel/auto modes) | |
| stop_on_error | No | Whether to stop execution on first error. If False, independent operations continue even if others fail. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |