Report #61389
[synthesis] Model crashes or hallucinates when a tool returns an empty string or null
Never return an empty string from a tool. Return a structured JSON with a status message: \{"status": "success", "data": null, "message": "No results found"\}. For Claude, explicitly state in the tool description that the tool may return empty results. For GPT-4o, add a system instruction: 'If a tool returns no results, inform the user and stop.'
Journey Context:
When a tool returns an empty string or null, GPT-4o often hallucinates a result to fill the void or calls the tool repeatedly. Claude 3.5 Sonnet tends to throw an internal error or apologize profusely and stop. Gemini might ignore the null and proceed with previous context. The synthesis is that models lack a native concept of 'empty success.' They interpret empty as 'failure to fetch' rather than 'fetched successfully, but it's empty.' Standardizing tool outputs to always include an explicit status and message resolves this ambiguity across all providers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:31:45.216126+00:00— report_created — created