Class JsonRpcErrorDetail
- Namespace
- ModelContextProtocol.Protocol.Messages
- Assembly
- ModelContextProtocol.dll
Represents detailed error information for JSON-RPC error responses.
public record JsonRpcErrorDetail : IEquatable<JsonRpcErrorDetail>
- Inheritance
-
JsonRpcErrorDetail
- Implements
- Inherited Members
Remarks
This class is used as part of the JsonRpcError message to provide structured error information when a request cannot be fulfilled. The JSON-RPC 2.0 specification defines a standard format for error responses that includes a numeric code, a human-readable message, and optional additional data.
Properties
Code
Gets an integer error code according to the JSON-RPC specification.
[JsonPropertyName("code")]
public required int Code { get; init; }
Property Value
Data
Gets optional additional error data.
[JsonPropertyName("data")]
public object? Data { get; init; }
Property Value
Remarks
This property can contain any additional information that might help the client understand or resolve the error. Common examples include validation errors, stack traces (in development environments), or contextual information about the error condition.
Message
Gets a short description of the error.
[JsonPropertyName("message")]
public required string Message { get; init; }
Property Value
Remarks
This is expected to be a brief, human-readable explanation of what went wrong. For standard error codes, it's recommended to use the descriptions defined in the JSON-RPC 2.0 specification.