forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsonRpcResponse.cs
More file actions
27 lines (24 loc) · 780 Bytes
/
JsonRpcResponse.cs
File metadata and controls
27 lines (24 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol.Messages;
/// <summary>
/// A successful response message in the JSON-RPC protocol.
/// </summary>
public record JsonRpcResponse : IJsonRpcMessageWithId
{
/// <summary>
/// JSON-RPC protocol version. Always "2.0".
/// </summary>
[JsonPropertyName("jsonrpc")]
public string JsonRpc { get; init; } = "2.0";
/// <summary>
/// Request identifier matching the original request.
/// </summary>
[JsonPropertyName("id")]
public required RequestId Id { get; init; }
/// <summary>
/// The result of the method invocation.
/// </summary>
[JsonPropertyName("result")]
public required JsonNode? Result { get; init; }
}