Package dev.tachyonmcp.api.server.domain
Interface TextResourceContents
- All Superinterfaces:
HasMeta,ResourceContents
Text-based resource contents returned by a resource handler.
The uri identifies the originating resource, and text carries
the actual content. mimeType should be set when the text has a specific
format (e.g. application/json, text/markdown).
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic TextResourceContents.Builderbuilder()default voidcheck()meta()Returns the optional metadata map for protocol extensions.@Nullable StringmimeType()Returns the MIME type of the resource content, ornullif unspecified.static TextResourceContentsCreates text resource contents with no_meta.static TextResourceContentsCreates text resource contents.text()uri()Returns the resource URI.
-
Method Details
-
uri
Description copied from interface:ResourceContentsReturns the resource URI.- Specified by:
uriin interfaceResourceContents- Returns:
- the resource identifier
-
mimeType
Description copied from interface:ResourceContentsReturns the MIME type of the resource content, ornullif unspecified.- Specified by:
mimeTypein interfaceResourceContents- Returns:
- the MIME type, or
null
-
text
-
meta
Description copied from interface:HasMetaReturns the optional metadata map for protocol extensions. -
check
@Check default void check() -
builder
-
of
Creates text resource contents with no_meta.- Parameters:
uri- the resource URItext- the text contentmimeType- the content's MIME type, ornullif unspecified
-
of
static TextResourceContents of(String uri, String text, @Nullable String mimeType, @Nullable Map<String, Object> meta) Creates text resource contents.- Parameters:
uri- the resource URItext- the text contentmimeType- the content's MIME type, ornullif unspecifiedmeta- the_metaentries, ornullif none
-