Package dev.tachyonmcp.api.server.domain
Interface ContentBlock
- All Superinterfaces:
HasMeta
- All Known Subinterfaces:
AudioContent,EmbeddedResource,ImageContent,ResourceLink,TextContent
public sealed interface ContentBlock
extends HasMeta
permits TextContent, ImageContent, AudioContent, ResourceLink, EmbeddedResource
A piece of content in a tool result, prompt message, or resource.
Each variant carries content in a different media type. The sealed hierarchy ensures
exhaustive pattern-matching — all concrete types are known at compile time. The
type() method derives the MCP protocol discriminator from the variant type,
so callers never need to supply or validate it.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumMCP protocol type discriminator for content block variants. -
Method Summary
Modifier and TypeMethodDescriptiontype()Returns the MCP protocol type discriminator for this content block variant.
-
Method Details
-
type
ContentBlock.Type type()Returns the MCP protocol type discriminator for this content block variant.- Returns:
- the content type discriminator
-