LLMs, GenAI, RAG, agents, evaluation · insight-1566
Encode units, formats and allowed values in the tool schema so wrong calls cannot be expressed
- Evidence type
- documented fact
- Difficulty
- easy
- Roles
- Applied AI, ML engineer
- Industries
- aviation
Summary: situation, action, reason, boundary
Situation
A booking tool takes a free-text string for cabin class and a number for baggage weight with no unit stated.
Action
Use enums for closed sets, typed and bounded numbers, date formats, units in parameter names, and enable provider strict mode where available, then still validate meaning and permissions in your own code.
Reason
Strict schema enforcement guarantees that arguments match the declared types and enums, which removes whole classes of malformed calls before execution.
Boundary
Function and tool calling with defined input schemas.
Symptom or risk
The model sends "business class" or pounds for kilograms, and the tool either fails or silently does the wrong thing.
Exceptions
Strict mode proves shape, not truth; a valid cabin code may still be unauthorised or wrong for the traveller.
Trade-offs
Schemas must be maintained, and strict modes support only a subset of JSON Schema.
Pitfalls
Treating schema-valid as safe.
Lessons and concepts
Claims and their sources
Anthropic's documentation says strict tool use constrains tool inputs to match the JSON Schema, avoiding wrong types such as a string for an integer, and guarantees schema conformance; checking business validity (authorisation, truth of a valid value) stays with the caller, which is this course's inference.