diff --git a/src/ModelContextProtocol/Protocol/Types/Annotated.cs b/src/ModelContextProtocol/Protocol/Types/Annotated.cs deleted file mode 100644 index 3096c78c1..000000000 --- a/src/ModelContextProtocol/Protocol/Types/Annotated.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Text.Json.Serialization; - -namespace ModelContextProtocol.Protocol.Types; - -/// -/// Base for objects that include optional annotations for the client. The client can use annotations to inform how objects are used or displayed. -/// See the schema for details -/// -public abstract record Annotated -{ - /// - /// Optional annotations for the resource. - /// - [JsonPropertyName("annotations")] - public Annotations? Annotations { get; init; } -} diff --git a/src/ModelContextProtocol/Protocol/Types/Content.cs b/src/ModelContextProtocol/Protocol/Types/Content.cs index 71bc475db..0fb4e1358 100644 --- a/src/ModelContextProtocol/Protocol/Types/Content.cs +++ b/src/ModelContextProtocol/Protocol/Types/Content.cs @@ -39,4 +39,10 @@ public class Content /// [JsonPropertyName("resource")] public ResourceContents? Resource { get; set; } + + /// + /// Optional annotations for the content. + /// + [JsonPropertyName("annotations")] + public Annotations? Annotations { get; init; } } \ No newline at end of file diff --git a/src/ModelContextProtocol/Protocol/Types/Resource.cs b/src/ModelContextProtocol/Protocol/Types/Resource.cs index d80ac94c5..249c58464 100644 --- a/src/ModelContextProtocol/Protocol/Types/Resource.cs +++ b/src/ModelContextProtocol/Protocol/Types/Resource.cs @@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol.Types; /// Represents a known resource that the server is capable of reading. /// See the schema for details /// -public record Resource : Annotated +public record Resource { /// /// The URI of this resource. @@ -31,4 +31,10 @@ public record Resource : Annotated /// [JsonPropertyName("mimeType")] public string? MimeType { get; init; } + + /// + /// Optional annotations for the resource. + /// + [JsonPropertyName("annotations")] + public Annotations? Annotations { get; init; } } diff --git a/src/ModelContextProtocol/Protocol/Types/ResourceTemplate.cs b/src/ModelContextProtocol/Protocol/Types/ResourceTemplate.cs index 1df0c7eda..436be3944 100644 --- a/src/ModelContextProtocol/Protocol/Types/ResourceTemplate.cs +++ b/src/ModelContextProtocol/Protocol/Types/ResourceTemplate.cs @@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol.Types; /// Represents a known resource template that the server is capable of reading. /// See the schema for details /// -public record ResourceTemplate : Annotated +public record ResourceTemplate { /// /// The URI template (according to RFC 6570) that can be used to construct resource URIs. @@ -31,4 +31,10 @@ public record ResourceTemplate : Annotated /// [JsonPropertyName("mimeType")] public string? MimeType { get; init; } + + /// + /// Optional annotations for the resource template. + /// + [JsonPropertyName("annotations")] + public Annotations? Annotations { get; init; } } \ No newline at end of file