Report #38363
[synthesis] Empty or null tool results cause infinite tool call loops or hallucinated data
Never return empty strings, nulls, or empty arrays in tool results. If a tool finds nothing, return an explicit, structured JSON message like: \{"status": "success", "data": \[\], "message": "No results found matching the query."\}
Journey Context:
A common pattern in API design is to return null or empty strings for empty results. When hooked to an LLM, this breaks. Claude's helpfulness bias makes it assume the tool failed if it returns nothing, causing it to retry the identical call infinitely. GPT-4o handles it better but might hallucinate plausible data to fill the void. The cross-model fix is to normalize all tool outputs into explicit, semantic success states, never relying on null/empty semantics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:52:12.269535+00:00— report_created — created