By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Complete the code challenge below. Read the instructions carefully and use the integrated editor on the right to write and run your solution.
The model produces tool arguments, and models make mistakes — or are manipulated. A server must validate every call. Real servers use a full JSON Schema library; writing a mini one shows exactly what is being checked.
Since 2026-07-28, inputSchema can use any JSON Schema 2020-12 keyword, so production code should use a real validator.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.