Tinker Tool calling & MCP

by Kondasamy Jayaraman · drawn with Colorfigures by April Zhu

...

Nothing sent yet.

Chapter 3 of 7

Valid isn’t correct

The assistant can now look orders up with get_order. But the model writes each call itself, and models make mistakes. The team wants to know which mistakes the host can catch before they reach a customer.

This chapter: What does checking a call against its schema catch, and what slips through?

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 (4)
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.

The picture on the left is live. Each step below asks you to do one thing in it; the story continues here as you go.

Step 1 of 7

Same question, same tool. Look at the schema: order_id must be an integer, a whole number from 1000 to 9999. Before anything runs, the host checks every call against it.

The model sends get_order(order_id: "1042"): the number as text. What does the host do?