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

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!

1 Like

I do have the same issue!