Tool.toMCP constructor
Implementation
factory Tool.toMCP(Map<String, Object?> map) {
return Tool(
icons: (map['icons'] as List<dynamic>?)
?.map((e) => Icon.toMCP(e as Map<String, Object?>))
.toList(),
name: map['name'] as String,
title: map['title'] as String?,
description: map['description'] as String?,
inputSchema: ToolSchema.toMCP(map['inputSchema'] as Map<String, Object?>),
execution: map['execution'] != null
? ToolExecution.toMCP(map['execution'] as Map<String, Object?>)
: null,
outputSchema: map['outputSchema'] != null
? ToolSchema.toMCP(map['outputSchema'] as Map<String, Object?>)
: null,
annotations: map['annotations'] != null
? ToolAnnotations.toMCP(map['annotations'] as Map<String, Object?>)
: null,
$meta: map['_meta'] != null
? MetaObject.toMCP(map['_meta'] as Map<String, Object?>)
: null,
);
}