Interface ResourceLink

All Superinterfaces:
ContentBlock, HasMeta

@Immutable public non-sealed interface ResourceLink extends ContentBlock
A reference to another resource, embedded within a content block.

Unlike EmbeddedResource, this is a lightweight pointer — it carries only metadata (URI, name, title, description, MIME type) without the actual content data.

  • Method Details

    • name

      String name()
    • title

      @Nullable String title()
    • icons

      @Nullable List<Icon> icons()
    • uri

      String uri()
    • description

      @Nullable String description()
    • mimeType

      @Nullable String mimeType()
    • annotations

      @Nullable Annotations annotations()
    • size

      @Nullable Long size()
    • 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
    • check

      @Check default void check()
    • 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
    • of

      static ResourceLink of(String uri, String name)
      Creates a resource link with no optional fields.
    • of

      static ResourceLink of(String uri, String name, @Nullable String mimeType)
      Creates a resource link with MIME type and no other optional fields.
    • builder

      static ResourceLink.Builder builder()
    • builder

      static ResourceLink.Builder builder(String uri, String name)
      Creates a builder for a resource link with the required fields.