Skip to main content
Tool failures use the standard error envelope: an HTTP error before generation, or a chunk with a top-level error and finish_reason: "error" mid-stream.

Causes

Branch on error.code. Check the model’s capabilities before sending a tool.