Skip to main content

dot/tools/
batch.rs

1use super::Tool;
2
3pub struct BatchTool;
4
5impl Tool for BatchTool {
6    fn name(&self) -> &str {
7        "batch"
8    }
9
10    fn description(&self) -> &str {
11        "Run multiple tool calls in parallel and return all results. Use when you need to call several independent tools at once to save round-trips."
12    }
13
14    fn input_schema(&self) -> serde_json::Value {
15        serde_json::json!({
16            "type": "object",
17            "properties": {
18                "invocations": {
19                    "type": "array",
20                    "description": "List of tool invocations to execute",
21                    "items": {
22                        "type": "object",
23                        "properties": {
24                            "tool_name": { "type": "string", "description": "Name of the tool to call" },
25                            "input": { "type": "object", "description": "Input parameters for the tool" }
26                        },
27                        "required": ["tool_name", "input"]
28                    }
29                }
30            },
31            "required": ["invocations"]
32        })
33    }
34
35    fn execute(&self, _input: serde_json::Value) -> anyhow::Result<String> {
36        anyhow::bail!("batch is a virtual tool handled by the agent loop")
37    }
38}