CallToolResult.toMCP constructor
Implementation
factory CallToolResult.toMCP(Map<String, Object?> map) {
return CallToolResult(
$meta: map['_meta'] != null
? MetaObject.toMCP(map['_meta'] as Map<String, Object?>)
: null,
content: ((map['content'] ?? []) as List<dynamic>)
.map((e) => ContentBlock.toMCP(e as Map<String, Object?>))
.toList(),
structuredContent: map['structuredContent'] as Map<String, Object?>?,
isError: map['isError'] as bool?,
additionalData: Map.from(map)
..removeWhere(
(key, _) =>
key == '_meta' ||
key == 'content' ||
key == 'structuredContent' ||
key == 'isError',
),
);
}