[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[AI SDK](/c/ai-sdk/62)

# How to pass zod validation errors from tool calls back to LLM?

125 views · 1 like · 2 posts


cb123 (@cboeschen) · 2025-10-10 · ♥ 1

I’m getting frequent zod validation errors in AI SDK v5 due to invalid input from LLMs. The issue I’m facing is that my chat just stops when that happens and never progresses past the `output-error` message part. Is there any way for me to indicate I want to pass any zod validation errors back to the LLM automatically so it can self-correct? Thank you!


Hoschiandre 4502 (@hoschiandre-4502) · 2025-11-03

I do have the same issue!