Write validate_call(call) — the gate every proposed tool call passes
through before anything executes. Checks run in this order, and the
first failure wins:
call["tool"]not inTOOLS→"reject: unknown tool"- any name in the spec's
requiredlist missing fromcall["args"]→"reject: missing <field>" - any field in the spec's
alloweddict whose arg value isn't in the allowed list →"reject: bad <field>" - spec has
confirm: Trueand the call lacks a truthyconfirmed→"reject: needs confirm" - otherwise →
"ok"
Expected output:
get_failing_jobs ok
open_issue reject: missing severity
open_issue ok
escalate reject: needs confirm
deploy_prod reject: unknown tool