toJson method
Implementation
Map<String, dynamic> toJson() => {
'toolName': toolName,
'success': success,
if (result != null) 'result': result!.map((k, v) => MapEntry(k, v.toJson())),
if (error != null) 'error': error,
if (callId != null) 'callId': callId,
};