java.lang.Object
org.springframework.ai.mcp.annotation.common.IconUtils

public final class IconUtils extends Object
Converts McpIcon annotations into schema icons.
Since:
2.1.0
Author:
Christian Tzolov
  • Method Details

    • toIcons

      public static @Nullable List<io.modelcontextprotocol.spec.McpSchema.Icon> toIcons(McpIcon[] icons)
      Returns:
      the icons as legacy schema records, or null when the annotation declares none, so that the icons field is omitted from the definition
    • toModernIcons

      public static @Nullable List<io.modelcontextprotocol.modern.McpSchema.Icon> toModernIcons(McpIcon[] icons)
      Returns:
      the icons as modern schema records, or null when the annotation declares none