Why Agent Tool Calls Fail and How to Recover

Agent tool calls fail for different reasons, and each reason needs a different recovery action. Invalid inputs need correction. Missing authorization needs an account decision. A rate limit needs a bounded wait. A lost response from a paid operation needs investigation before another purchase.

This guide provides a recovery model for agents using external tools through direct APIs or a shared layer such as o11. It draws on inspected source contracts and official references. It does not report a live failure-injection experiment or guarantee behavior from an unconfigured supplier account.

Classify the failure before retrying

Start with a small taxonomy: input, authorization, admission, transport, supplier execution, output quality, and uncertain outcome. Record the operation, safe request metadata, invocation identifier, current state, and recommended next action.

Failure classExampleFirst recovery action
InputRequired resource identifier missingCorrect the request
AuthorizationProvider connection expiredReauthorize the affected account
AdmissionMaximum exceeds remaining allowanceReduce scope or request a bounded extension
Rate limitSupplier requests a delayWait according to the documented policy
ExecutionConfirmed terminal provider failureInspect billing and retry rules
Unknown outcomeResponse lost after submissionCheck existing work or reconcile

Keep quality separate from transport. A successful HTTP response with irrelevant search results may justify a new query, but it is not a transient network failure. Blindly replaying the same request may produce the same unhelpful result and another charge.

Distinguish safe replay from new work

Idempotency binds repeated requests to the same intended operation under a defined contract. It is not permission to change the input while keeping a convenient key, and it does not automatically extend across every intermediary and supplier.

HTTP semantics defines idempotent methods and retry considerations. Paid tool execution often uses application-level contracts beyond HTTP method semantics, so inspect those contracts before deciding a replay is safe. For billing-safe replays, see how to retry paid tool calls without paying twice.

In o11’s inspected implementation, idempotency binds caller, workspace, request content, and key. A changed request under the same key is rejected. The application should retain the key and invocation identity so a reconnect can inspect the same work rather than generate a fresh purchase.

Use a new identity only for genuinely new, authorized work. A revised search query is new work. Asking for the status of an existing media generation is not. Preserve that distinction in the agent’s orchestration code and user-facing explanation.

Treat unknown as a real state

An uncertain outcome occurs when the system cannot establish whether the supplier accepted or completed the operation. A timeout after submission is a common example. Treating it as ordinary failure can duplicate purchases; treating it as success can hide missing work.

Persist the request and any supplier evidence. Query status using the existing identifier when available. If the supplier has no reliable lookup path, route the invocation to a documented reconciliation process with an owner and next action.

In o11’s source, an unknown outcome retains its hold and is not automatically purchased again. Reconciliation requires authorized operator access and supplier evidence. Workspace ownership alone does not establish permission to reverse a supplier charge.

Explain the state plainly: the operation may have started, and the system is checking it before trying again. Keep unrelated authorized tasks running. One unresolved invocation should not become a global block across the workspace.

Use bounded backoff at one responsible layer

Choose a retry owner and a maximum attempt count or elapsed interval. If the SDK, gateway, worker, and agent each retry independently, a single logical failure can multiply requests. Document which layer handles which error.

AWS’s retry guidance explains timeouts, backoff, and jitter. Apply those techniques only where retrying is appropriate. A permission denial does not become valid after five delays.

GitHub’s rate-limit documentation provides an example of supplier-specific reset and retry guidance. Follow the selected provider’s documented behavior rather than applying one universal delay to every service.

For a paid retry, verify the remaining authorization and expected charge. A maximum attempt count without a spending boundary can still be expensive. The spending-limits guide explains how the execution layer can enforce both.

Recover asynchronous work by identity

Persist the job identifier, account identity, status location, input revision, and output expectations. Resume observation after interruption. Do not assume a client-side timeout ended the supplier job.

Map provider states to your internal model without discarding useful distinctions. Queued, processing, failed, canceled, and completed can imply different billing and recovery rules. A cancellation request may race with completion, so retain the actual resulting state.

If the output link expires, retrieve the existing result where supported before generating another asset. If the provider has deleted the artifact, a new generation is an intentional new operation with a new cost decision, not an invisible retry.

Keep a timeout for observation separate from a cancellation deadline. The user may stop waiting while the work continues. The media-job guide covers durable status and file retrieval.

Preserve partial results

A multi-tool task should retain completed steps and resume only the missing work. If a research workflow has six valid source pages and one failed enrichment call, it can often produce a useful partial brief with the missing field identified.

Store checkpoints with safe inputs, outputs, evidence references, and completion status. Keep credentials out of durable model context. A checkpoint is useful only when it can be resumed under the correct workspace and account permissions.

Define acceptance for partial outcomes in advance. A missing optional image may be acceptable; an unresolved central numerical claim may not be. Let the application distinguish a useful partial delivery from a failed task instead of collapsing both into one red error badge.

If the same item repeatedly fails, defer it with a retry date, alternative source, or operator action. Preserve the rest of the batch. This keeps one inaccessible site or unavailable supplier from blocking unrelated work indefinitely.

Make cost and recovery visible

Record quoted maximum, reserved amount, settled charge, and unresolved amount separately. A failed response can still carry a supplier fee. A retained hold is not necessarily a final charge, but it is also not available to spend again.

For illustration, suppose a call reserves $2 and the supplier confirms a $0.70 charge before failing. The appropriate remaining release would be $1.30 under a contract that settles confirmed usage. If the charge is unknown, releasing the whole $2 may be incorrect. These figures illustrate accounting states, not a provider’s billing policy.

Give support staff a concise view: what happened, what evidence exists, what is safe to do, and who may resolve it. Keep the audit history when a state changes. A button labeled retry should not silently create a new paid operation without explaining the consequence.

The cost-estimation guide shows how to include these recovery branches in product economics.

Exercise the recovery path before scaling

Use focused, authorized checks for the failures that matter: invalid inputs, revoked credentials, rate limits, duplicate submission, lost responses, delayed completion, and expired outputs. Mocked checks can verify application behavior, but they do not certify live supplier billing or cancellation.

Document what was actually exercised. If a provider account is unconfigured, say so. If only request shaping was checked, do not describe the operation as successfully executed. Honest verification limits make the next activation task clear.

Track recurring failure causes and manual recovery time. Fix the highest-impact pattern instead of merely increasing retry counts. The productive agent system is the one that completes useful work and leaves an understandable, bounded recovery path when external services do not behave as expected.

Example: a recovery transition record

For each recovery decision, retain the prior state, observed evidence, next state, action owner, and whether the action can incur another charge. A record that says “retry attempted” loses the distinction between checking existing work and purchasing new work.

For a fictional media invocation, the client loses its connection after submission. The application records unknown rather than failed, keeps the existing hold, and checks the supplier identifier when available. A later confirmed completion moves the existing invocation to its terminal result and retrieval stage. No second generation is needed.

If the supplier confirms that it never accepted the request, a bounded new attempt may be appropriate under the remaining authorization. If the supplier cannot establish the outcome, the item stays in reconciliation with an assigned operator and review time. Other tasks continue.

The transition record should also preserve the card or account context. Changing a credential does not erase the original purchase identity or authorize another attempt. This makes the recovery auditable and helps support staff explain why the system is waiting, what evidence it needs, and which next action is safe.

Sources

Give your agents a wallet.
Open up their world.

The paid web, through one simple API.

Get started
Become a partner Sell your product/API to agents using o11.

Keep reading