Interface TextContent

All Superinterfaces:
ContentBlock, HasMeta

@Immutable public non-sealed interface TextContent extends ContentBlock
A plain-text content block provided to or from an LLM.

Text is the most common content type. Optional Annotations allow the server to hint at audience, priority, or modification time.

  • Method Details

    • text

      String text()
    • meta

      @Nullable Map<String,Object> meta()
      Description copied from interface: HasMeta
      Returns the optional metadata map for protocol extensions.
      Specified by:
      meta in interface HasMeta
      Returns:
      the metadata map, or null if none
    • annotations

      @Nullable Annotations annotations()
    • type

      default ContentBlock.Type type()
      Description copied from interface: ContentBlock
      Returns the MCP protocol type discriminator for this content block variant.
      Specified by:
      type in interface ContentBlock
      Returns:
      the content type discriminator
    • check

      @Check default void check()
    • builder

      static TextContent.Builder builder()
    • of

      static TextContent of(String text)
      Creates a text content block with no metadata or annotations.
    • of

      static TextContent of(String text, @Nullable Annotations annotations)
      Creates a text content block with given annotations and no metadata.
    • of

      static TextContent of(String text, @Nullable Map<String,Object> meta, @Nullable Annotations annotations)
      Creates a text content block with metadata and optional annotations.