AI agents and tool calls in production
Designing agent tools
Designing agent tools
- A Tool Schema a Model Can Call Correctly
- A Yes, No, Not Applicable Answer Schema for Agent Tool Results
- Designing Agent Tools That Query the Database Without Full Scans
- Error Objects for Model-Facing Tools: Fields and Tests
- One MCP Server for Several APIs: Namespacing Tools
- Serving API Reference to Agents: MCP Servers from OpenAPI Specs
- Structured Error Objects an Agent Can Parse and Act On
- Surfacing Tool Errors to an Agent Without Looping Forever
- All of Designing agent tools
Idempotency and retries
Idempotency and retries for agent writes
- A Retry and Backoff Contract Between an Agent and Its Tools
- An Outbox Table for Agent-Triggered Side Effects
- Fitting a Retry Budget to a Tool That Fails Slowly
- Idempotency at the Agent Tool Interface
- Idempotency Keys for AI Actions: Design and Verification
- Idempotency Keys for Payment APIs: Design and Verification
- Idempotent Write Attempts: Making Escalated Writes Safe
- Idempotent Writes for AI Agents: Catching a Retried Tool Call
- All of Idempotency and retries
Approval gates and handoff
Approval gates and human handoff
- A Confidence Threshold That Sends Weak Tickets to People
- Adding Human Handoff to an Agent: Design and Metrics
- Approval Gates for High-Risk MCP Tools
- Effect Classifiers for Tool Calls: Read, Write, Money
- Giving an Agent a Billing Tool: Approval Gates
- Giving an Agent a Read-Only Finance Tool First
- Routing a Request to a Person or a Model: A Decision Rule
- What the Approval Screen Shows: Payload, Reasoning and Expiry
- All of Approval gates and handoff
Budgets and spend control
Budgets and spend control for agents
- A Spend Cap Across Sub-Agents: When One Run Fans Out to Five
- A Token Budget That Leaves Room for the Model to Answer
- A Tool Call Budget per Run: Counting Writes Before the Start
- Caps on an Agent Finance Tool: Per Run, Customer and Day
- Setting Output Token Limits per Task Without Starving the Model
- A Cheap Model or a Larger One: The Break-Even Point
- A Child Run's Spend Attribution: Fields for Parent Aggregation
- A Context Budget Report for Every Agent Run
- All of Budgets and spend control
Queues, deadlines and fallbacks
Agent queues, deadlines and fallbacks
- A Deadline That Propagates Through Every Tool Call in a Run
- Backpressure Between an Agent and Its Tools: Caps and Queues
- Ordering a Fallback Ladder by Cost and Latency
- Setting a Concurrency Cap from Downstream Latency and Errors
- Testing a Fallback Ladder Without Spending on the Top Rung
- Using Signed Webhooks to Trigger Agent Runs Safely
- A Circuit Breaker Between an Agent and a Degraded Tool
- A Concurrency Cap Between Sub-Agents: Limiting the Fan-Out Width
- All of Queues, deadlines and fallbacks
Prompt injection and fencing