using System.Text.Json.Serialization; namespace ModelContextProtocol.Protocol; /// /// Represents the parameters used with a request sent by a client to a server during the protocol handshake. /// /// /// /// The is the first message sent in the Model Context Protocol /// communication flow. It establishes the connection between client and server, negotiates the protocol /// version, and declares the client's capabilities. /// /// /// After sending this request, the client should wait for an response /// before sending an notification to complete the handshake. /// /// /// See the schema for details. /// /// public sealed class InitializeRequestParams : RequestParams { /// /// Gets or sets the version of the Model Context Protocol that the client wants to use. /// /// /// /// Protocol version is specified using a date-based versioning scheme in the format "YYYY-MM-DD". /// The client and server must agree on a protocol version to communicate successfully. /// /// /// During initialization, the server will check if it supports this requested version. If there's a /// mismatch, the server will reject the connection with a version mismatch error. /// /// /// See the protocol specification for version details. /// /// [JsonPropertyName("protocolVersion")] public required string ProtocolVersion { get; set; } /// /// Gets or sets the client's capabilities. /// /// /// Capabilities define the features the client supports, such as "sampling" or "roots". /// [JsonPropertyName("capabilities")] public required ClientCapabilities Capabilities { get; set; } /// /// Gets or sets information about the client implementation, including its name and version. /// /// /// This information is required during the initialization handshake to identify the client. /// Servers might use this information for logging, debugging, or compatibility checks. /// [JsonPropertyName("clientInfo")] public required Implementation ClientInfo { get; set; } }