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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    MCP protocol type discriminator for content block variants.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the MCP protocol type discriminator for this content block variant.

    Methods inherited from interface dev.tachyonmcp.api.server.domain.HasMeta

    meta
  • Method Details

    • type

      Returns the MCP protocol type discriminator for this content block variant.
      Returns:
      the content type discriminator