Class McpIcon
java.lang.Object
com.soklet.McpIcon
Immutable icon descriptor for an MCP tool, prompt, or resource.
The source must be absolute and contain well-formed UTF-16. Its spelling
is retained without URI normalization or a scheme allowlist. MIME types use
the same ASCII media-type syntax parser as MCP content. Size hints must use
ASCII decimal WxH dimensions with a lowercase x, or exactly
any; order, duplicates, and decimal spelling are retained.
Soklet does not fetch icons, verify dimensions or media bytes, establish trusted source domains, or sanitize SVG. Applications and consuming clients own source and rendering policy; prefer trusted HTTPS sources or image data URIs. Construction does not prevalidate the eventual JSON response size.
- Author:
- Mark Allen
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleangetSizes()getTheme()inthashCode()static @NonNull McpIcon.BuilderwithSource(@NonNull URI source) Vends a builder primed with the icon source URI.
-
Method Details
-
withSource
Vends a builder primed with the icon source URI.- Parameters:
source- absolute icon source URI- Returns:
- icon builder
- Throws:
IllegalArgumentException- if the source is relative or contains an unpaired surrogate
-
getSource
-
getMimeType
- Returns:
- MIME type, if supplied
-
getSizes
-
getTheme
- Returns:
- preferred theme, if supplied
-
equals
-
hashCode
-