onFunctionCall
Pre-execution hook called before each SWAIG function is executed. The default implementation is a no-op. Override this method in a subclass to intercept tool calls for logging, metrics, or custom dispatch logic.
This is a pre-execution hook only — it does not replace the function dispatch. The tool handler still executes regardless of what this method does. If you need to block execution, throw an error from this hook.
Parameters
name
Name of the SWAIG function about to execute.
args
Parsed arguments for the function, conforming to the function’s parameter schema.
rawData
The full raw SWAIG request payload, including metadata such as
call_id, caller_id_number, and global_data.
Returns
void | Promise<void>