File tree Expand file tree Collapse file tree 3 files changed +18
-14
lines changed
src/ModelContextProtocol/Protocol/Types Expand file tree Collapse file tree 3 files changed +18
-14
lines changed Original file line number Diff line number Diff line change
1
+ using System . Text . Json . Serialization ;
2
+
3
+ namespace ModelContextProtocol . Protocol . Types ;
4
+
5
+ /// <summary>
6
+ /// Base for objects that include optional annotations for the client. The client can use annotations to inform how objects are used or displayed.
7
+ /// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json">See the schema for details</see>
8
+ /// </summary>
9
+ public abstract record Annotated
10
+ {
11
+ /// <summary>
12
+ /// Optional annotations for the resource.
13
+ /// </summary>
14
+ [ JsonPropertyName ( "annotations" ) ]
15
+ public Annotations ? Annotations { get ; init ; }
16
+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol.Types;
6
6
/// Represents a known resource that the server is capable of reading.
7
7
/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json">See the schema for details</see>
8
8
/// </summary>
9
- public record Resource
9
+ public record Resource : Annotated
10
10
{
11
11
/// <summary>
12
12
/// The URI of this resource.
@@ -31,10 +31,4 @@ public record Resource
31
31
/// </summary>
32
32
[ JsonPropertyName ( "mimeType" ) ]
33
33
public string ? MimeType { get ; init ; }
34
-
35
- /// <summary>
36
- /// Optional annotations for the resource.
37
- /// </summary>
38
- [ JsonPropertyName ( "annotations" ) ]
39
- public Annotations ? Annotations { get ; init ; }
40
34
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ namespace ModelContextProtocol.Protocol.Types;
8
8
/// Represents a known resource template that the server is capable of reading.
9
9
/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json">See the schema for details</see>
10
10
/// </summary>
11
- public record ResourceTemplate
11
+ public record ResourceTemplate : Annotated
12
12
{
13
13
/// <summary>
14
14
/// The URI template (according to RFC 6570) that can be used to construct resource URIs.
@@ -33,10 +33,4 @@ public record ResourceTemplate
33
33
/// </summary>
34
34
[ JsonPropertyName ( "mimeType" ) ]
35
35
public string ? MimeType { get ; init ; }
36
-
37
- /// <summary>
38
- /// Optional annotations for the resource template.
39
- /// </summary>
40
- [ JsonPropertyName ( "annotations" ) ]
41
- public Annotations ? Annotations { get ; init ; }
42
36
}
You can’t perform that action at this time.
0 commit comments