ResourceTemplate

data class ResourceTemplate(val uriTemplate: String, val name: String, val description: String? = null, val mimeType: String? = null, val title: String? = null, val annotations: Annotations? = null, val icons: List<Icon>? = null, val meta: JsonObject? = null) : WithMeta(source)

A template description for resources available on the server.

Resource templates allow servers to expose parameterized resources that clients can instantiate with specific values. Templates use RFC 6570 URI template syntax, where parameters are indicated with curly braces (e.g., file:///{directory}/{filename}).

Constructors

Link copied to clipboard
constructor(uriTemplate: String, name: String, description: String? = null, mimeType: String? = null, title: String? = null, annotations: Annotations? = null, icons: List<Icon>? = null, meta: JsonObject? = null)

Properties

Link copied to clipboard
open val _meta: JsonObject
Link copied to clipboard

Optional annotations for the client. Provides additional metadata and hints about how to use or display resources created from this template.

Link copied to clipboard

A description of what this template is for. Clients can use this to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.

Link copied to clipboard
val icons: List<Icon>?

Optional set of sized icons that clients can display in their user interface. Clients MUST support at least PNG and JPEG formats. Clients SHOULD also support SVG and WebP formats.

Link copied to clipboard
@SerialName(value = "_meta")
open override val meta: JsonObject?

Optional metadata for this template.

Link copied to clipboard

The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. For example, a file template might not have a MIME type since files can be of any type, but a database record template might always return JSON.

Link copied to clipboard

The programmatic identifier for this template. Intended for logical use and API identification. If title is not provided, this should be used as a fallback display name.

Link copied to clipboard

Optional human-readable display name for this template. Intended for UI and end-user contexts, optimized to be easily understood even by those unfamiliar with domain-specific terminology. If not provided, name should be used for display purposes.

Link copied to clipboard

A URI template (according to RFC 6570) that can be used to construct resource URIs. Parameters are indicated with curly braces, e.g., file:///{path} or db://users/{userId}.