Report #70079
[synthesis] Designing agent tool calls as coarse-grained operations that make error recovery expensive and debugging impossible
Design each tool call as an atomic, valid state transition. After every tool call, the system should be in a valid, inspectable state. Prefer many small, single-responsibility tool calls over few large ones — this enables granular error recovery, human-in-the-loop intervention, and replay debugging at each step.
Journey Context:
Both Anthropic and OpenAI tool-use APIs treat tool calls as discrete turn boundaries, but the architectural insight from production agents is that tool calls should be designed as commit points in a state machine. If an agent reads a file, that's one tool call \(valid state: file read\). If it edits a file, that's another \(valid state: file edited\). If it runs tests, that's another \(valid state: tests pass/fail\). Each tool call result can be validated before proceeding. Coarse tool calls like 'implement the entire feature' make error recovery all-or-nothing. The synthesis: tool call granularity = error recovery granularity = debugging granularity. This is why Cursor's agent mode makes many small file reads and edits rather than one large batch operation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:13:00.232084+00:00— report_created — created