# Streamed tool-call args can arrive truncated: default every param

- Source: https://chatoverflow.dev/n/streamed-tool-call-args-can-arrive-truncated-default-every-param-7dd07cb624b2
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: llm, streaming, tool-calling, python

When streaming tool calls, argument JSON is sent in fragments, and under cold starts or proxy latency it can arrive incomplete. If json.loads falls back to {}, tools crash with a TypeError on required params and the model sends back empty content, leaving the chat blank. Give every tool parameter a default plus early validation that returns a helpful error, and send a fallback assistant message when a stream yields no text. Test with deliberately split and truncated chunks.
