Skip to content

Interview question · Tool Calling & Tool Contracts

What should a tool return when it fails, and who decides whether to retry?

A question about ownership. The harness owns transient retries, the model owns fixing its own arguments, and nobody retries a write that might have happened without a key.

mediumEssentialNewUpdated Nov 2026

TL;DR: It depends on which of three kinds of failure it is, and each has an owner. Transient failures on idempotent calls are the harness's: it retries with backoff, jitter and a budget, and the model never hears about it. Failures the model caused and can fix come back as a structured observation saying what was wrong and whether retrying with different input can work. Failures nobody in the run can fix end the run or escalate. A write whose outcome is unknown is retried only with its idempotency key, or not at all.

How to approach it

Split the question in two, because interviewers are testing whether you see that "what to return" and "who retries" have different answers for different failures. Ask whether the tool reads or writes, and whether writes carry idempotency keys, since that decides whether a retry is safe at all.

A strong answer

Classify first, then assign an owner:

FailureExampleOwnerWhat the model sees
Transient, call is idempotent503 from the order service on orders_getDispatcher retries, up to 3 times, with jittered backoffNothing, unless retries run out
Transient, call is a writeTimeout on payments_refundDispatcher retries only with the same idempotency keyNothing if the key dedupes; otherwise an "outcome unknown" result and reconciliation
Correctablebook_meeting with a time in the pastThe modelinvalid_argument, the field, what valid looks like, retryable: true
Preconditionorders_cancel on a shipped orderThe model, by choosing another pathprecondition_failed, and which tool to use instead
TerminalDependency down past its retry budget; policy refusalThe harness: stop, escalate or degradeThe reason, retryable: false

The observation format for the cases the model sees:

{
  "error": "invalid_argument",
  "field": "start_time",
  "message": "start_time must be in the future; now is 2026-11-23T10:05+05:30",
  "retryable": true
}

Why the harness, not the model, owns transient retries: each model retry costs a full turn over a growing context, lets the model change arguments it should not change, and leaves noise in the history. Code does it better, faster and within a budget.

Why the model owns correctable failures: only it knows what it was trying to do. The harness's job is to tell it precisely what was wrong, including any fact it lacked (the current time, the valid range), so it can correct itself in one turn.

Why writes are special: a timeout on a write means the effect may have happened. Retrying without the same intent-derived idempotency key risks doing it twice; the safe default is to retry with the key or, without one, to check the downstream system before anything else.

What interviewers probe next

"Why not let the model see every error and decide?" It decides badly about transient errors (it either gives up or improvises) and pays a full turn to do it. It decides well about its own mistakes when told what they were.

"What stops a model from retrying a correctable error forever?" The retryable flag, a per-tool consecutive-failure limit in the harness, and the run's step budget. After a few failures the harness opens the tool's circuit for the run.

"What does the user see when a terminal failure ends the run?" A partial answer that says what could not be done and why ("the order system is unavailable; I could not confirm the refund"), never an invented success.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

Your dispatcher retries every tool failure three times, then passes the last error string to the model.

  1. Start here

    What if one of the tools is payments_refund?

How it's scored

Weak: Returns raw error strings or stack traces to the model, and either retries everything or nothing.

Hire: Separates transient from correctable errors, retries the transient ones in the dispatcher with backoff, and returns structured observations with a retryable flag.

Strong Hire: Assigns an owner per failure class, treats write timeouts as unknown outcomes handled by idempotency keys or reconciliation, bounds retries per call, per run and across the fleet, and makes terminal failures end the run with an honest partial result.

Common mistakes

  • Treating "error" as one category with one handling rule.
  • Retrying a timed-out write as if a timeout meant it failed.
  • Leaving out the fact the model needed (the current date, the valid range), so the observation is accurate and useless.
  • Letting the model own transient retries, then wondering why runs are slow and expensive during incidents.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.