Report #21465
[synthesis] Agent relies on free-text JSON generation for tool calls, leading to parsing errors
Use native tool calling \(function calling\) APIs where the model is constrained to generate structured JSON conforming to a provided schema, rather than parsing free-text.
Journey Context:
Early agents used prompt engineering like 'Output a JSON block...'. This was fragile and prone to hallucination. OpenAI's function calling API forces the model to generate structured tool calls at the token level. This drastically reduces parsing failures and makes the agent loop robust and reliable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:26:40.248568+00:00— report_created — created