onFunctionCall
Dispatch a SWAIG function call to the handler registered via
defineTool(). Returns null when the named function isn’t
registered or has no handler. Called automatically by the POST /swaig
dispatch path; subclasses (such as AgentBase) override it to add session-token
validation and result normalization.
Parameters
name
Name of the SWAIG function to dispatch.
args
Parsed arguments for the function.
rawData
The full raw SWAIG request payload, including metadata such as call_id and
global_data.
Returns
FunctionResult | Record<string, unknown> | string | void | null
(or a Promise of these) — The handler’s result, or null when no matching
function is registered.