Class McpResourceContents
java.lang.Object
org.apache.juneau.rest.server.mcp.McpResourceContents
Revision-neutral resource payload, either inline text or a base64 blob.
Supersedes the wire-level ResourceContents dictionary and its two leaf types. Used both
by McpContentBlock.resource(McpResourceContents) and by McpResourceOutcome.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich payload variant is populated. -
Method Summary
Modifier and TypeMethodDescriptionblob()The base64-encoded payload.static McpResourceContentsCreates a base64-blob resource payload.kind()Which variant this payload carries.mimeType()The media type.text()The inline text payload.static McpResourceContentsCreates an inline-text resource payload.uri()The resource URI.
-
Method Details
-
text
Creates an inline-text resource payload.- Parameters:
uri- The resource URI. Can benull .mimeType- The media type. Can benull .text- The text payload. Can benull .- Returns:
- A new payload. Never
null .
-
blob
Creates a base64-blob resource payload.- Parameters:
uri- The resource URI. Can benull .mimeType- The media type. Can benull .blob- The base64-encoded payload. Can benull .- Returns:
- A new payload. Never
null .
-
kind
Which variant this payload carries.- Returns:
- The variant. Never
null .
-
uri
The resource URI.- Returns:
- The URI, or
null if not set.
-
mimeType
The media type.- Returns:
- The media type, or
null if not set.
-
text
The inline text payload.- Returns:
- The text, or
null for aMcpResourceContents.Kind.BLOBpayload.
-
blob
The base64-encoded payload.- Returns:
- The blob, or
null for aMcpResourceContents.Kind.TEXTpayload.
-