CCAR-F Prompt Engineering & Structured Output MEDIUM
PRODUCTION SCENARIO
Your booking agent's reserve_table tool declares party_size as an integer alongside two other flat scalar parameters. The model picks reserve_table on every booking turn and fills every required field, but on about 6 percent of calls party_size arrives as 'four' or '4', the handler rejects it, and the validate-and-retry loop the team built costs an extra round trip. The team needs the argument to carry the declared type on the first call, not to arrive correctly more often.

Which change makes the model itself emit an integer?

Answering here is anonymous. Nothing is saved unless you sign in.

Show answer and explanation

Answer: Set strict to true on the tool, with additionalProperties false and a required array

Strict tool use compiles the input schema into a grammar and constrains sampling to it, so the call contains 2 rather than "2" and the retry loop disappears; strict is a top-level field on the tool alongside name and description, and the schema needs additionalProperties false. Input examples are schema-validated and are the documented lever for tools with nested objects or format-sensitive inputs, where the model gets the shape wrong; for one flat integer they shift the odds and leave a tail. A fuller description is what to write when the model misreads what a parameter means. Forcing tool_choice settles which tool is called, which is the repair when the model answers in prose instead of calling it.
Free

Keep practicing CCAR-F

59 original CCAR-F practice questions, each with an explanation and a source link. No account needed.

Start free practice set → Timed, explained, free