Nothing sent yet.
Chapter 3 of 7
Valid isn’t correct
The assistant now looks orders up with get_order. But the model writes each call itself, and models make mistakes. Which ones can the host catch?
This chapter: What does checking a call against its schema catch, and what slips through?
About this chapter
You will learn
- How the host validates a call against the tool’s schema before anything runs
- Why a rejected call goes back to the model as an error it can fix
- Why a valid call can still be wrong, and how a business check catches it
Words you’ll meet
- Validation
- Checking a tool call’s arguments against the tool’s JSON Schema before running it.
- Integer
- A whole number, like 1042. The text "1042" in quotes is a string, not an integer.
- Error result
- A tool result marked isError. It tells the model what went wrong, so it can try again.
- Ownership check
- A rule in your software: a tool only touches orders that belong to the customer being served.
Step 1 of 7
Same tool. Its schema says order_id is an from 1000 to 9999. checks every call against it first.
Predict first.