toMcpFormat method
Convert to the format expected by the MCP Server Compatible with example_widgets.json format
Implementation
Map<String, dynamic> toMcpFormat() {
return {
'key': id,
'type': _getFlutterWidgetType(),
if (description != null) 'label': description,
if (description != null) 'description': description,
if (customMetadata?['purpose'] != null)
'purpose': customMetadata!['purpose'],
'capabilities': capabilities,
if (screen != null) 'screen': screen,
if (tags != null && tags!.isNotEmpty) 'tags': tags,
};
}