Applied AI·Structured outputs and tool calling
the model called the same write tool twice, and it only mattered because you had not made the write idempotent.
Side effects and idempotency in tools
Draft summary, pending review
Design rules carried over from distributed systems: separate read tools from write tools, make writes idempotent where possible, and require confirmation for irreversible actions. Models retry and occasionally repeat themselves; tools must be safe under that behaviour.