Preserve custom tool types during Claude stream processing

Open

Engineering impact

The Anthropic streaming accumulator unconditionally rewrote every block receiving an input_json_delta to tool_use, discarding server_tool_use and mcp_tool_use classifications seeded by content_block_start. Streamed traces therefore collapsed three distinct tool kinds into one and misreported which server-side or MCP tool ran. Changed the delta path to preserve the existing block type and extended Output() to decode accumulated JSON input for all three tool types.

Tech stack

Go
Anthropic
LLM Observability
Streaming
GitHub
LinkedIn