---
title: "Validate arguments and return errors the model can use"
url: https://eldan.ai/tutorials/tool-calling-from-scratch/validate-and-recover
canonical: https://eldan.ai/tutorials/tool-calling-from-scratch/validate-and-recover
locale: en
language: en
updated: 2026-11-23
author: "Eldan Abdrashim"
cite_as: "Eldan Abdrashim. \"Validate arguments and return errors the model can use.\" Eldan.ai, updated 23 November 2026. https://eldan.ai/tutorials/tool-calling-from-scratch/validate-and-recover."
---

# Validate arguments and return errors the model can use

> Write an execute function that validates arguments and turns every failure into a result the model can recover from.

This lesson is free for newsletter readers. Open https://eldan.ai/tutorials/tool-calling-from-scratch/validate-and-recover, subscribe with your email and confirm the address: the lesson opens in that browser.

## Sources

- [Tool Calling From Scratch](https://eldan.ai/tutorials/tool-calling-from-scratch)
