Class JsonRpcRequest
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents a request message in the JSON-RPC protocol.
public sealed class JsonRpcRequest : JsonRpcMessageWithId
- Inheritance
-
JsonRpcRequest
- Inherited Members
Remarks
Requests are messages that require a response from the receiver. Each request includes a unique ID that will be included in the corresponding response message (either a success response or an error).
The receiver of a request message is expected to execute the specified method with the provided parameters and return either a JsonRpcResponse with the result, or a JsonRpcError if the method execution fails.
Properties
Method
Gets or sets the name of the method to invoke.
[JsonPropertyName("method")]
public required string Method { get; set; }
Property Value
Params
Gets or sets optional parameters for the method.
[JsonPropertyName("params")]
public JsonNode? Params { get; set; }