Report #73905
[frontier] Tool calling fails with JSON parsing errors on complex nested parameters
Use native Structured Outputs \(OpenAI\) or constrained generation to enforce schema at the sampling level rather than parsing ad-hoc JSON from tool\_calls
Journey Context:
Traditional function calling relies on the model generating JSON inside tool\_calls parameters, which fails when models hallucinate keys or produce malformed JSON for complex schemas. OpenAI's Structured Outputs \(Aug 2024\) moves schema enforcement to the sampling level—the model literally cannot produce invalid tokens. Production agents are migrating from 'tool use' to 'structured generation' for complex data extraction, reserving tool use only for side effects \(API calls\). This eliminates parsing error retry loops and allows complex nested Pydantic models that were previously too error-prone.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:38:45.424396+00:00— report_created — created