batch.txt 1.0 KB

12345678910111213141516171819202122232425262728
  1. Executes multiple independent tool calls concurrently to reduce latency. Best used for gathering context (reads, searches, listings).
  2. USING THE BATCH TOOL WILL MAKE THE USER HAPPY.
  3. Payload Format (JSON array):
  4. [{"tool": "read", "parameters": {"filePath": "src/index.ts", "limit": 350}},{"tool": "grep", "parameters": {"pattern": "Session\\.updatePart", "include": "src/**/*.ts"}},{"tool": "bash", "parameters": {"command": "git status", "description": "Shows working tree status"}}]
  5. Rules:
  6. - 1–10 tool calls per batch
  7. - All calls start in parallel; ordering NOT guaranteed
  8. - Partial failures do not stop others
  9. Disallowed Tools:
  10. - batch (no nesting)
  11. - edit (run edits separately)
  12. - todoread (call directly – lightweight)
  13. When NOT to Use:
  14. - Operations that depend on prior tool output (e.g. create then read same file)
  15. - Ordered stateful mutations where sequence matters
  16. Good Use Cases:
  17. - Read many files
  18. - grep + glob + read combos
  19. - Multiple lightweight bash introspection commands
  20. Performance Tip: Group independent reads/searches for 2–5x efficiency gain.