passdrill
AI & LLM Engineering · AI Agents & Tool Use · Card 028/032 easy

A flight-booking tool's schema requires `passengers` to be a JSON integer. Without any special configuration, Claude sometimes returns `passengers: "2"` (a string) or `passengers: "two"` instead of the integer `2`, which breaks the booking function expecting a number. Setting `strict: true` on that tool's definition is documented to fix this by doing what?

  1. Automatically converting any string value Claude happens to produce into the matching integer after the fact, on the calling application's side, before the tool ever receives it
  2. Constraining the model's own token sampling so that its output is restricted to schema-valid completions in the first place -- so Claude's `input` field always strictly matches the declared `input_schema`, guaranteeing a correctly-typed `passengers` value rather than requiring the application to validate and retry
  3. Disabling the `passengers` parameter's type entirely so it can accept any value type without error, removing the mismatch by no longer checking types at all
  4. Requiring a human to manually review and correct every tool call's arguments before they are allowed to reach the booking function
Next card → Shuffle