toJson method

Map<String, Object?> toJson()

Serializes to the format consumed by the MCP server.

Implementation

Map<String, Object?> toJson() => <String, Object?>{
  'name': name,
  'type': type,
  'required': isRequired,
  if (defaultValue != null) 'default': defaultValue,
  if (description != null) 'description': description!.toJson(),
  if (enumValues.isNotEmpty) 'enumValues': enumValues,
};