Table of Contents

Class JsonRpcRequest

Namespace
ModelContextProtocol.Protocol.Messages
Assembly
ModelContextProtocol.dll

A request message in the JSON-RPC protocol.

public 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

Name of the method to invoke.

[JsonPropertyName("method")]
public required string Method { get; init; }

Property Value

string

Params

Optional parameters for the method.

[JsonPropertyName("params")]
public JsonNode? Params { get; init; }

Property Value

JsonNode