The model keeps passing status values your API rejects - "done", "complete", "finished".
- AConstrain the parameter to an enum in the tool schema
- BAdd «please use only valid status values» to the system prompt
- CNormalize whatever arrives with a mapping table on your side
- DRetry the tool call until a valid value comes back
Answer: A
Constrain the parameter to an enum in the tool schema
Why
What the schema forbids the model cannot emit; what the prompt asks for it can forget. A mapping table is a real fallback, but it hides the ambiguity instead of removing it.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path