Table of Contents

Class JsonRpcError

Namespace
ModelContextProtocol.Protocol.Messages
Assembly
ModelContextProtocol.dll

Represents an error response message in the JSON-RPC protocol.

public class JsonRpcError : JsonRpcMessageWithId
Inheritance
JsonRpcError
Inherited Members

Remarks

Error responses are sent when a request cannot be fulfilled or encounters an error during processing. Like successful responses, error messages include the same ID as the original request, allowing the sender to match errors with their corresponding requests.

Each error response contains a structured error detail object with a numeric code, descriptive message, and optional additional data to provide more context about the error.

Properties

Error

Gets detailed error information for the failed request, containing an error code, message, and optional additional data

[JsonPropertyName("error")]
public required JsonRpcErrorDetail Error { get; init; }

Property Value

JsonRpcErrorDetail