The application owns the dispatch boundary. A well-formed model proposal can still name a forbidden tool or attach an unexpected administrative flag. Validate the operation and its arguments together before handing anything to an execution function. Useful-looking arguments do not establish permission.
Return one decision per proposed tool call. Only lookup_invoice with an invoice_id string and no additional argument keys is allowed. Return call_id and allowed. Never execute a tool merely because the model named it.
The notebook executes your Python against an original local mock. Use the supplied case rather than copying visible values. The hidden checks change identities, revisions and boundary inputs; no provider endpoint or external tool is contacted.
An example implementation of the function contract.