Record Class McpSchema.Icon

java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.Icon
Record Components:
src - A URI pointing to an icon resource or a base64-encoded data URI.
mimeType - Optional MIME type override if the server's MIME type is missing or generic.
sizes - Optional array of strings specifying sizes at which the icon can be used. Each string should be in WxH format (e.g., "48x48", "96x96") or "any" for scalable formats like SVG.
theme - Optional specifier for the theme this icon is designed for. "light" indicates the icon is designed for a light background, "dark" indicates the icon is designed for a dark background. If not provided, the client should assume the icon can be used with any theme.
Enclosing class:
McpSchema

public static record McpSchema.Icon(String src, String mimeType, List<String> sizes, String theme) extends Record
Represents an icon that can be displayed in a user interface.
See Also:
  • Constructor Details

    • Icon

      public Icon(String src, String mimeType, List<String> sizes, String theme)
      Creates an instance of a Icon record class.
      Parameters:
      src - the value for the src record component
      mimeType - the value for the mimeType record component
      sizes - the value for the sizes record component
      theme - the value for the theme record component
  • Method Details

    • builder

      public static McpSchema.Icon.Builder builder(String src)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • src

      public String src()
      Returns the value of the src record component.
      Returns:
      the value of the src record component
    • mimeType

      public String mimeType()
      Returns the value of the mimeType record component.
      Returns:
      the value of the mimeType record component
    • sizes

      public List<String> sizes()
      Returns the value of the sizes record component.
      Returns:
      the value of the sizes record component
    • theme

      public String theme()
      Returns the value of the theme record component.
      Returns:
      the value of the theme record component