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.
Return a result object from this hook to short-circuit default execution —
the returned value is sent as the function response and the registered tool
handler is skipped. Return void / undefined to let the normal dispatch
proceed.
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
Record<string, unknown> | void | Promise<Record<string, unknown> | void> —
Return a result object to short-circuit default execution; return void /
undefined to proceed normally.