execute
Execute the function with the given arguments. Calls the handler and normalizes the return value into a FunctionResult dictionary.
Parameters
args
Parsed arguments for the function, matching the parameter schema.
raw_data
Full raw request data including global_data, call_id, caller_id_number,
meta_data, and ai_session_id.
Returns
dict[str, Any] — The function result as a dictionary (from
FunctionResult.to_dict()). If the handler raises an exception, returns a
generic error message rather than exposing internal details.
The handler can return a FunctionResult, a dict with a "response" key,
or a plain string. All formats are normalized to a FunctionResult dictionary.