ListToolsResult.toMCP constructor
Implementation
factory ListToolsResult.toMCP(Map<String, Object?> map) {
return ListToolsResult(
$meta: map['_meta'] != null
? ResultMetaObject.toMCP(map['_meta'] as Map<String, Object?>)
: null,
resultType: map['resultType'] as String? ?? 'complete',
nextCursor: map['nextCursor'] as String?,
tools: (map['tools'] as List<dynamic>)
.map((e) => Tool.toMCP(e as Map<String, Object?>))
.toList(),
ttlMs: map['ttlMs'] as num,
cacheScope: CacheScope.to(map['cacheScope'] as String),
additionalData: Map.from(map)
..removeWhere(
(key, _) =>
key == '_meta' ||
key == 'resultType' ||
key == 'nextCursor' ||
key == 'tools' ||
key == 'ttlMs' ||
key == 'cacheScope',
),
);
}