using System.Text.Json.Serialization; namespace ModelContextProtocol.Protocol; /// /// Represents the result of a request sent to the server during connection establishment. /// /// /// /// The is sent by the server in response to an /// message from the client. It contains information about the server, its capabilities, and the protocol version /// that will be used for the session. /// /// /// After receiving this response, the client should send an /// notification to complete the handshake. /// /// /// See the schema for details. /// /// public sealed class InitializeResult : Result { /// /// Gets or sets the initialize-handshake Model Context Protocol version that the server will use for this session. /// /// /// /// This is the initialize-capable protocol version the server has agreed to use, which should match the client's /// requested version. If there's a mismatch, the client should throw an exception to prevent /// communication issues due to incompatible protocol versions. /// /// /// The protocol uses a date-based versioning scheme in the format "YYYY-MM-DD". /// /// /// See the protocol specification for version details. /// /// [JsonPropertyName("protocolVersion")] public required string ProtocolVersion { get; set; } /// /// Gets or sets the server's capabilities. /// /// /// This property defines the features the server supports, such as "tools", "prompts", "resources", or "logging", /// and other protocol-specific functionality. /// [JsonPropertyName("capabilities")] public required ServerCapabilities Capabilities { get; set; } /// /// Gets or sets information about the server implementation, including its name and version. /// /// /// This information identifies the server during the initialization handshake. /// Clients might use this information for logging, debugging, or compatibility checks. /// [JsonPropertyName("serverInfo")] public required Implementation ServerInfo { get; set; } /// /// Gets or sets optional instructions for using the server and its features. /// /// /// /// These instructions should focus on guidance that helps a model use the server effectively, /// such as workflow tips, capability relationships, and server-specific conventions. /// They should avoid repeating tool descriptions, prompt descriptions, or resource descriptions /// that are already available through other protocol responses. /// /// /// Client applications often use these instructions as system messages for LLM interactions /// to provide context about available functionality. /// /// [JsonPropertyName("instructions")] public string? Instructions { get; set; } }