Agents, Tool Use & MCP·Question 15 of 90Basic

What does strict mode on a tool schema guarantee, and what does it leave to you?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Strict mode guarantees shape, not truth. With it on, the provider constrains decoding so the arguments the model emits always parse and conform to your JSON Schema: correct types, required fields present, enum values respected, no invented properties. It does not guarantee that the values are correct, that the right tool was chosen, or that a tool should have been called at all.

Full worked answer

Strict mode guarantees shape, not truth. With it on, the provider constrains decoding so the arguments the model emits always parse and conform to your JSON Schema: correct types, required fields present, enum values respected, no invented properties. It does not guarantee that the values are correct, that the right tool was chosen, or that a tool should have been called at all.

Mechanically, the provider compiles your schema into a grammar and, at each decoding step, masks any token that would make the output invalid. Most major APIs now expose this as a strict flag on the tool definition, and the first request with a new schema can pay a one-off compilation cost.

What it removes: parse failures, missing required fields, misspelled enum values, and the retry loop teams used to build around them.

What stays your job:

  • Semantic validation. {"user_id": "usr_4821"} is schema-valid and may belong to another customer. Referential checks, ranges, authorisation and cross-field rules ("end date after start date") live in the executor, because JSON Schema cannot express most of them and strict modes usually support only a subset of the spec anyway.
  • Valid fabrication. When the model lacks a value, strict mode gives it no way to say so: it must emit something that fits. A required order_id on a request that contains no order ID produces a plausible fake. Make genuinely optional fields nullable, and give the model a legitimate way to signal "not enough information".
  • Field order. Output follows property order, so a decision field placed before an evidence field makes the model commit before it has written its reasoning. Put supporting fields first.
  • Tool selection. A perfectly valid call to the wrong tool is still a wrong call.

The interview signal is separating syntactic guarantees from semantic ones. Strict mode deletes a whole class of bugs, and it makes the remaining ones look more legitimate, which is why executor validation gets no lighter when you turn it on.

What a good answer covers

  • Strict mode guarantees shape, not truth
  • With it on, the provider constrains decoding so the arguments the model emits always parse and conform…
  • It does not guarantee that the values are correct, that the right tool was chosen, or that a tool should…
  • Mechanically, the provider compiles your schema into a grammar and, at each decoding step, masks any…
  • Most major APIs now expose this as a strict flag on the tool definition, and the first request with a…

Key terms: Semantic validation · Valid fabrication · Field order · Tool selection

Interviewer follow-ups to expect

  1. Your extraction schema has 40 fields and uses keywords strict mode rejects. What do you do?

  2. Would you ever turn strict mode off for a tool, and why?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep