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.
Implement the validator that runs before any tool executes. This is the single highest-value function in an agent codebase.
validate_call(call, schemas) returns the first problem found, checking in this exact order:
name key → "MISSING_NAME"name not in schemas → "UNKNOWN_TOOL:<name>""MISSING_ARG:<arg>" (schema order)"UNEXPECTED_ARG:<arg>""BAD_TYPE:<arg>""OK"schemas maps a tool name to {arg_name: type_name}. Types are "str", "int", "float", "bool", "list", "dict". int must reject booleans (in Python True is an int); float accepts an int but not a bool.
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.