AI seeded comments from robch and then edited by stephentoub (#238)

* AI generated `///` comment updates

* Fix compilation issues

* Fix incorrect XML comment structure

* Update all Client comments

* Update all Configuration comments

* Update all Messages comments

* Update all Transport comments

* Update all Types comments

* Update all Server comments

* Undo some commenting

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
This commit is contained in:
Rob Chambers 2025-04-09 22:30:44 -07:00 • committed by GitHub
commit 77871c5aac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,28 +1,62 @@
using System.Text.Json.Serialization;
using ModelContextProtocol.Protocol.Messages;
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol.Types;
/// <summary>
/// Parameters for an initialization request sent to the server.
/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">See the schema for details</see>
/// Represents the parameters used with a <see cref="RequestMethods.Initialize"/> request sent by a client to a server during the protocol handshake.
/// </summary>
/// <remarks>
/// <para>
/// The <see cref="InitializeRequestParams"/> 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.
/// </para>
/// <para>
/// After sending this request, the client should wait for an <see cref="InitializeResult"/> response
/// before sending an <see cref="NotificationMethods.InitializedNotification"/> notification to complete the handshake.
/// </para>
/// <para>
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
/// </para>
/// </remarks>
public class InitializeRequestParams : RequestParams
{
/// <summary>
/// The version of the Model Context Protocol that the client wants to use.
/// Gets or sets the version of the Model Context Protocol that the client wants to use.
/// </summary>
/// <remarks>
/// <para>
/// 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.
/// </para>
/// <para>
/// 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.
/// </para>
/// <para>
/// See the <see href="https://spec.modelcontextprotocol.io/specification/">protocol specification</see> for version details.
/// </para>
/// </remarks>
[JsonPropertyName("protocolVersion")]
public required string ProtocolVersion { get; init; }
/// <summary>
/// The client's capabilities.
/// Gets or sets the client's capabilities.
/// </summary>
/// <remarks>
/// Capabilities define the features the client supports, such as "sampling" or "roots".
/// </remarks>
[JsonPropertyName("capabilities")]
public ClientCapabilities? Capabilities { get; init; }
/// <summary>
/// Information about the client implementation.
/// Gets or sets information about the client implementation, including its name and version.
/// </summary>
/// <remarks>
/// This information is required during the initialization handshake to identify the client.
/// Servers may use this information for logging, debugging, or compatibility checks.
/// </remarks>
[JsonPropertyName("clientInfo")]
public required Implementation ClientInfo { get; init; }
}