Constrained decoding restricts the tokens or structures a model may produce so generated tool calls satisfy schemas, valid JSON requirements, and argument-type constraints. section 13.5
In production function calling, these restrictions reduce retries caused by malformed outputs. Providers may expose strict modes, while open-model serving systems can apply constrained decoding through inference configuration. section 13.5 section 13.6
Implementation decisions include:
- Enforcing valid JSON and correct argument types before tool execution. section 13.5
- Selecting provider-specific strict modes or inference flags for open models. section 13.5
- Balancing structured-output reliability against context consumption from tool results. section 13.6
