"Refund if the order is late" reads like a complete instruction. It is not. A rule is a judgment; a tool call is a transaction. Between them sit at least five decisions the sentence leaves open: which order, what counts as late, how much money, in what unit, and what happens if the refund was already issued. Every one of those gaps is a place where an agent will guess, and guesses against a payment API are expensive.
The reliability math is unforgiving. If a model produces a fully valid tool call 95 percent of the time, then over a 20-step session the chance of at least one invalid output is 1 minus 0.95 to the twentieth power, about 64 percent, as one agent engineering guide puts it in its discussion of structured outputs and function calling. That guide also lays out the spectrum from free text to constrained decoding and notes that strict structured outputs approach near-perfect schema compliance, while plain JSON mode hovers around 95 percent. The lesson for tool design is blunt: you cannot prompt your way out of a contract problem. You fix the schema.
There is a second, subtler failure. Language models are known to have ordering effects in what they learn. The Reversal Curse paper showed that models fine-tuned on "A is B" statements, such as a name followed by a description, often failed to answer the reverse question, and that GPT-4 answered one direction correctly 79 percent of the time against 33 percent for the reversed form. The paper notes models can deduce the reverse relationship when the fact is present in context. Translate that to tool calls: an agent that has seen an order described as "late" in one direction may not reliably infer that a status of LATE in an enum means the same. Give it an enum value, not a synonym, and the mapping is a lookup rather than an inference.



