Resource

A direct resource the server exposes.

@safe
struct Resource {
string uri;
string name;
Nullable!string description;
Nullable!string mimeType;
Nullable!string title;
}

Members

Functions

forVersion
Resource forVersion(ProtocolVersion v)

Return a copy of this Resource with any fields newer than the negotiated protocol version stripped, so the wire output stays valid for the peer's version. The 2024-11-05 Resource type carried only uri/name/description/mimeType/annotations/_meta. Later fields are version-gated: BaseMetadata.title and Resource.size were introduced by 2025-06-18 / 2025-03-26 respectively (both absent from 2024-11-05), and Resource.icons by 2025-11-25 (absent from every earlier version, present in draft which is >= 2025-11-25). Annotation sub-fields are themselves version-gated: audience/priority existed in 2024-11-05 but Annotations.lastModified was introduced in 2025-06-18, so annotations are projected via Annotations.forVersion. Mirrors Tool.forVersion / Prompt.forVersion.

Variables

annotations
Annotations annotations;

optional audience/priority/lastModified annotations

icons
Icon[] icons;

optional icons for display in user interfaces

size
Nullable!long size;

optional size in bytes

Mixed In Members

From mixin MetaField

meta
Json meta;

optional _meta object