Core Protocol docs edit pass (#1032)

This commit is contained in:
Genevieve Warren 2025-11-25 20:05:25 -08:00 • committed by GitHub
commit c87eba3f1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 242 additions and 240 deletions

View file

@ -22,7 +22,7 @@ public sealed class Annotations
/// </summary>
/// <remarks>
/// The value is a floating-point number between 0 and 1, where 0 represents the lowest priority
/// 1 represents highest priority.
/// and 1 represents the highest priority.
/// </remarks>
[JsonPropertyName("priority")]
public float? Priority { get; set; }
@ -31,8 +31,8 @@ public sealed class Annotations
/// Gets or sets the moment the resource was last modified.
/// </summary>
/// <remarks>
/// The corresponding JSON should be an ISO 8601 formatted string (e.g., \"2025-01-12T15:00:58Z\").
/// Examples: last activity timestamp in an open file, timestamp when the resource was attached, etc.
/// The corresponding JSON should be an ISO 8601 formatted string (for example, \"2025-01-12T15:00:58Z\").
/// Examples of when the resource was last modified include last activity in an open file or when the resource was attached.
/// </remarks>
[JsonPropertyName("lastModified")]
public DateTimeOffset? LastModified { get; set; }

View file

@ -21,7 +21,7 @@ public sealed class Argument
/// Gets or sets the current partial text value for which completion suggestions are requested.
/// </summary>
/// <remarks>
/// This represents the text that has been entered so far and for which completion
/// This property represents the text that has been entered so far and for which completion
/// options should be generated.
/// </remarks>
[JsonPropertyName("value")]

View file

@ -36,17 +36,19 @@ public sealed class CallToolResult : Result
public JsonNode? StructuredContent { get; set; }
/// <summary>
/// Gets or sets an indication of whether the tool call was unsuccessful.
/// Gets or sets a value that indicates whether the tool call was unsuccessful.
/// </summary>
/// <value>
/// <see langword="true"/> to signify that the tool execution failed; <see langword="false"/> if it was successful.
/// </value>
/// <remarks>
/// <para>
/// When set to <see langword="true"/>, it signifies that the tool execution failed.
/// Tool execution errors (including input validation errors, API failures, and business logic errors)
/// are reported with this property set to <see langword="true"/> and details in the <see cref="Content"/>
/// property, rather than as protocol-level errors.
/// </para>
/// <para>
/// This allows language models to receive detailed error feedback and potentially self-correct
/// This design allows language models to receive detailed error feedback and potentially self-correct
/// in subsequent requests. For example, if a date parameter is in the wrong format or out of range,
/// the error message in <see cref="Content"/> can explain the issue, enabling the model to retry
/// with corrected parameters.

View file

@ -17,7 +17,7 @@ public sealed class CancelledNotificationParams : NotificationParams
/// Gets or sets the ID of the request to cancel.
/// </summary>
/// <remarks>
/// This must match the ID of an in-flight request that the sender wishes to cancel.
/// This value must match the ID of an in-flight request that the sender wishes to cancel.
/// </remarks>
[JsonPropertyName("requestId")]
public required RequestId RequestId { get; set; }
@ -27,4 +27,4 @@ public sealed class CancelledNotificationParams : NotificationParams
/// </summary>
[JsonPropertyName("reason")]
public string? Reason { get; set; }
}
}

View file

@ -6,7 +6,7 @@ using ModelContextProtocol.Server;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents the capabilities that a client may support.
/// Represents the capabilities that a client supports.
/// </summary>
/// <remarks>
/// <para>
@ -24,13 +24,13 @@ public sealed class ClientCapabilities
/// </summary>
/// <remarks>
/// <para>
/// The <see cref="Experimental"/> dictionary allows clients to advertise support for features that are not yet
/// standardized in the Model Context Protocol specification. This extension mechanism enables
/// The <see cref="Experimental"/> dictionary allows clients to advertise support for features that are not yet
/// standardized in the Model Context Protocol specification. This extension mechanism enables
/// future protocol enhancements while maintaining backward compatibility.
/// </para>
/// <para>
/// Values in this dictionary are implementation-specific and should be coordinated between client
/// and server implementations. Servers should not assume the presence of any experimental capability
/// Values in this dictionary are implementation-specific and should be coordinated between client
/// and server implementations. Servers should not assume the presence of any experimental capability
/// without checking for it first.
/// </para>
/// </remarks>
@ -42,7 +42,7 @@ public sealed class ClientCapabilities
/// </summary>
/// <remarks>
/// <para>
/// When <see cref="Roots"/> is non-<see langword="null"/>, the client indicates that it can respond to
/// When <see cref="Roots"/> is non-<see langword="null"/>, the client indicates that it can respond to
/// server requests for listing root URIs. Root URIs serve as entry points for resource navigation in the protocol.
/// </para>
/// <para>
@ -54,14 +54,14 @@ public sealed class ClientCapabilities
public RootsCapability? Roots { get; set; }
/// <summary>
/// Gets or sets the client's sampling capability, which indicates whether the client
/// Gets or sets the client's sampling capability, which indicates whether the client
/// supports issuing requests to an LLM on behalf of the server.
/// </summary>
[JsonPropertyName("sampling")]
public SamplingCapability? Sampling { get; set; }
/// <summary>
/// Gets or sets the client's elicitation capability, which indicates whether the client
/// Gets or sets the client's elicitation capability, which indicates whether the client
/// supports elicitation of additional information from the user on behalf of the server.
/// </summary>
[JsonPropertyName("elicitation")]
@ -70,7 +70,7 @@ public sealed class ClientCapabilities
/// <summary>Gets or sets notification handlers to register with the client.</summary>
/// <remarks>
/// <para>
/// When constructed, the client will enumerate these handlers once, which may contain multiple handlers per notification method key.
/// When constructed, the client will enumerate these handlers, which may contain multiple handlers per notification method key, once.
/// The client will not re-enumerate the sequence after initialization.
/// </para>
/// <para>
@ -80,7 +80,7 @@ public sealed class ClientCapabilities
/// </para>
/// <para>
/// Handlers provided via <see cref="NotificationHandlers"/> will be registered with the client for the lifetime of the client.
/// For transient handlers, <see cref="McpSession.RegisterNotificationHandler"/> may be used to register a handler that can
/// For transient handlers, <see cref="McpSession.RegisterNotificationHandler"/> can be used to register a handler that can
/// then be unregistered by disposing of the <see cref="IAsyncDisposable"/> returned from the method.
/// </para>
/// </remarks>
@ -88,4 +88,4 @@ public sealed class ClientCapabilities
[Obsolete($"Use {nameof(McpClientOptions.Handlers.NotificationHandlers)} instead. This member will be removed in a subsequent release.")] // See: https://github.com/modelcontextprotocol/csharp-sdk/issues/774
[EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerable<KeyValuePair<string, Func<JsonRpcNotification, CancellationToken, ValueTask>>>? NotificationHandlers { get; set; }
}
}

View file

@ -16,7 +16,7 @@ public sealed class Completion
/// <remarks>
/// This collection contains the actual text strings to be presented to users as completion suggestions.
/// The array will be empty if no suggestions are available for the current input.
/// Per the specification, this should not exceed 100 items.
/// Per the specification, this collection should not exceed 100 items.
/// </remarks>
[JsonPropertyName("values")]
public IList<string> Values { get; set; } = [];
@ -25,13 +25,13 @@ public sealed class Completion
/// Gets or sets the total number of completion options available.
/// </summary>
/// <remarks>
/// This can exceed the number of values actually sent in the response.
/// This value can exceed the number of values actually sent in the response.
/// </remarks>
[JsonPropertyName("total")]
public int? Total { get; set; }
/// <summary>
/// Gets or sets an indicator as to whether there are additional completion options beyond
/// Gets or sets a value that indicates whether there are additional completion options beyond
/// those provided in the current response, even if the exact total is unknown.
/// </summary>
[JsonPropertyName("hasMore")]

View file

@ -23,7 +23,7 @@ namespace ModelContextProtocol.Protocol;
/// <para>
/// This class is intentionally empty as the Model Context Protocol specification does not
/// currently define additional properties for sampling capabilities. Future versions of the
/// specification may extend this capability with additional configuration options.
/// specification might extend this capability with additional configuration options.
/// </para>
/// </remarks>
public sealed class CompletionsCapability
@ -40,4 +40,4 @@ public sealed class CompletionsCapability
[Obsolete($"Use {nameof(McpServerOptions.Handlers.CompleteHandler)} instead. This member will be removed in a subsequent release.")] // See: https://github.com/modelcontextprotocol/csharp-sdk/issues/774
[EditorBrowsable(EditorBrowsableState.Never)]
public McpRequestHandler<CompleteRequestParams, CompleteResult>? CompleteHandler { get; set; }
}
}

View file

@ -35,8 +35,11 @@ public abstract class ContentBlock
/// <summary>
/// When overridden in a derived class, gets the type of content.
/// </summary>
/// <value>
/// The type of content. Valid values include "image", "audio", "text", "resource", "resource_link", "tool_use", and "tool_result".
/// </value>
/// <remarks>
/// This determines the structure of the content object. Valid values include "image", "audio", "text", "resource", "resource_link", "tool_use", and "tool_result".
/// This value determines the structure of the content object.
/// </remarks>
[JsonPropertyName("type")]
public abstract string Type { get; }
@ -381,9 +384,7 @@ public sealed class ImageContentBlock : ContentBlock
/// Gets or sets the MIME type (or "media type") of the content, specifying the format of the data.
/// </summary>
/// <remarks>
/// <para>
/// Common values include "image/png" and "image/jpeg".
/// </para>
/// </remarks>
[JsonPropertyName("mimeType")]
public required string MimeType { get; set; }
@ -405,9 +406,7 @@ public sealed class AudioContentBlock : ContentBlock
/// Gets or sets the MIME type (or "media type") of the content, specifying the format of the data.
/// </summary>
/// <remarks>
/// <para>
/// Common values include "audio/wav" and "audio/mp3".
/// </para>
/// </remarks>
[JsonPropertyName("mimeType")]
public required string MimeType { get; set; }
@ -427,7 +426,7 @@ public sealed class EmbeddedResourceBlock : ContentBlock
/// </summary>
/// <remarks>
/// <para>
/// Resources can be either text-based (<see cref="TextResourceContents"/>) or
/// Resources can be either text-based (<see cref="TextResourceContents"/>) or
/// binary (<see cref="BlobResourceContents"/>), allowing for flexible data representation.
/// Each resource has a URI that can be used for identification and retrieval.
/// </para>
@ -463,7 +462,7 @@ public sealed class ResourceLinkBlock : ContentBlock
/// </summary>
/// <remarks>
/// <para>
/// This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.
/// This description can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.
/// </para>
/// <para>
/// The description should provide clear context about the resource's content, format, and purpose.
@ -487,7 +486,7 @@ public sealed class ResourceLinkBlock : ContentBlock
/// "image/png" for PNG images, and "application/json" for JSON data.
/// </para>
/// <para>
/// This property may be <see langword="null"/> if the MIME type is unknown or not applicable for the resource.
/// This property can be <see langword="null"/> if the MIME type is unknown or not applicable for the resource.
/// </para>
/// </remarks>
[JsonPropertyName("mimeType")]
@ -497,7 +496,7 @@ public sealed class ResourceLinkBlock : ContentBlock
/// Gets or sets the size of the raw resource content (before base64 encoding), in bytes, if known.
/// </summary>
/// <remarks>
/// This can be used by applications to display file sizes and estimate context window usage.
/// This value can be used by applications to display file sizes and estimate context window usage.
/// </remarks>
[JsonPropertyName("size")]
public long? Size { get; set; }
@ -541,7 +540,7 @@ public sealed class ToolResultContentBlock : ContentBlock
/// Gets or sets the ID of the tool use this result corresponds to.
/// </summary>
/// <remarks>
/// This must match the ID from a previous <see cref="ToolUseContentBlock"/>.
/// This value must match the ID from a previous <see cref="ToolUseContentBlock"/>.
/// </remarks>
[JsonPropertyName("toolUseId")]
public required string ToolUseId { get; set; }
@ -550,7 +549,7 @@ public sealed class ToolResultContentBlock : ContentBlock
/// Gets or sets the unstructured result content of the tool use.
/// </summary>
/// <remarks>
/// This has the same format as CallToolResult.Content and can include text, images,
/// This value has the same format as CallToolResult.Content and can include text, images,
/// audio, resource links, and embedded resources.
/// </remarks>
[JsonPropertyName("content")]
@ -560,17 +559,19 @@ public sealed class ToolResultContentBlock : ContentBlock
/// Gets or sets an optional structured result object.
/// </summary>
/// <remarks>
/// If the tool defined an outputSchema, this should conform to that schema.
/// If the tool defined an outputSchema, this object should conform to that schema.
/// </remarks>
[JsonPropertyName("structuredContent")]
public JsonElement? StructuredContent { get; set; }
/// <summary>
/// Gets or sets whether the tool use resulted in an error.
/// Gets or sets a value that indicates whether the tool use resulted in an error.
/// </summary>
/// <value>
/// <see langword="true"/> if the tool use resulted in an error; <see langword="false"/> if it succeeded. The default is <see langword="false"/>.
/// </value>
/// <remarks>
/// If true, the content typically describes the error that occurred.
/// Default: false
/// If <see langword="true"/>, the content typically describes the error that occurred.
/// </remarks>
[JsonPropertyName("isError")]
public bool? IsError { get; set; }

View file

@ -12,20 +12,20 @@ namespace ModelContextProtocol.Protocol;
/// <para>
/// <see cref="ContextInclusion"/>, and in particular <see cref="ThisServer"/> and <see cref="AllServers"/>, are deprecated.
/// Servers should only use these values if the client declares <see cref="ClientCapabilities.Sampling"/> with
/// <see cref="SamplingCapability.Context"/> set. These values may be removed in future spec releases.
/// <see cref="SamplingCapability.Context"/> set. These values might be removed in future spec releases.
/// </para>
/// </remarks>
[JsonConverter(typeof(JsonStringEnumConverter<ContextInclusion>))]
public enum ContextInclusion
{
/// <summary>
/// Indicates that no context should be included.
/// No context should be included.
/// </summary>
[JsonStringEnumMemberName("none")]
None,
/// <summary>
/// Indicates that context from the server that sent the request should be included.
/// Context from the server that sent the request should be included.
/// </summary>
/// <remarks>
/// This value is soft-deprecated. Servers should only use this value if the client
@ -35,7 +35,7 @@ public enum ContextInclusion
ThisServer,
/// <summary>
/// Indicates that context from all servers that the client is connected to should be included.
/// Context from all servers that the client is connected to should be included.
/// </summary>
/// <remarks>
/// This value is soft-deprecated. Servers should only use this value if the client

View file

@ -4,7 +4,7 @@ using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents the parameters used with a <see cref="RequestMethods.SamplingCreateMessage"/>
/// Represents the parameters used with a <see cref="RequestMethods.SamplingCreateMessage"/>
/// request from a server to sample an LLM via the client.
/// </summary>
/// <remarks>
@ -17,13 +17,13 @@ public sealed class CreateMessageRequestParams : RequestParams
/// </summary>
/// <remarks>
/// <para>
/// The client may ignore this request.
/// The client might ignore this request.
/// </para>
/// <para>
/// <see cref="ContextInclusion"/>, and in particular <see cref="ContextInclusion.ThisServer"/> and
/// <see cref="ContextInclusion.AllServers"/>, are deprecated. Servers should only use these values if the client
/// declares <see cref="ClientCapabilities.Sampling"/> with <see cref="SamplingCapability.Context"/> set.
/// These values may be removed in future spec releases.
/// These values might be removed in future spec releases.
/// </para>
/// </remarks>
[JsonPropertyName("includeContext")]
@ -33,8 +33,8 @@ public sealed class CreateMessageRequestParams : RequestParams
/// Gets or sets the maximum number of tokens to generate in the LLM response, as requested by the server.
/// </summary>
/// <remarks>
/// A token is generally a word or part of a word in the text. Setting this value helps control
/// response length and computation time. The client may choose to sample fewer tokens than requested.
/// A token is generally a word or part of a word in the text. Setting this value helps control
/// response length and computation time. The client can choose to sample fewer tokens than requested.
/// </remarks>
[JsonPropertyName("maxTokens")]
public required int MaxTokens { get; set; }
@ -50,7 +50,7 @@ public sealed class CreateMessageRequestParams : RequestParams
/// </summary>
/// <remarks>
/// The format of this metadata is provider-specific and can include model-specific settings or
/// configuration that isn't covered by standard parameters. This allows for passing custom parameters
/// configuration that isn't covered by standard parameters. This allows for passing custom parameters
/// that are specific to certain AI models or providers.
/// </remarks>
[JsonPropertyName("metadata")]
@ -61,7 +61,7 @@ public sealed class CreateMessageRequestParams : RequestParams
/// </summary>
/// <remarks>
/// <para>
/// The client may ignore these preferences.
/// The client might ignore these preferences.
/// </para>
/// <para>
/// These preferences help the client make an appropriate model selection based on the server's priorities
@ -82,11 +82,11 @@ public sealed class CreateMessageRequestParams : RequestParams
/// <remarks>
/// <para>
/// When the model generates any of these sequences during sampling, text generation stops immediately,
/// even if the maximum token limit hasn't been reached. This is useful for controlling generation
/// even if the maximum token limit hasn't been reached. This behavior is useful for controlling generation
/// endings or preventing the model from continuing beyond certain points.
/// </para>
/// <para>
/// Stop sequences are typically case-sensitive, and typically the LLM will only stop generation when a produced
/// Stop sequences are typically case-sensitive, and the LLM will only stop generation when a produced
/// sequence exactly matches one of the provided sequences. Common uses include ending markers like "END", punctuation
/// like ".", or special delimiter sequences like "###".
/// </para>
@ -98,7 +98,7 @@ public sealed class CreateMessageRequestParams : RequestParams
/// Gets or sets an optional system prompt the server wants to use for sampling.
/// </summary>
/// <remarks>
/// The client may modify or omit this prompt.
/// The client might modify or omit this prompt.
/// </remarks>
[JsonPropertyName("systemPrompt")]
public string? SystemPrompt { get; set; }
@ -110,7 +110,7 @@ public sealed class CreateMessageRequestParams : RequestParams
public float? Temperature { get; set; }
/// <summary>
/// Gets or sets tools that the model may use during generation.
/// Gets or sets tools that the model can use during generation.
/// </summary>
[JsonPropertyName("tools")]
public IList<Tool>? Tools { get; set; }

View file

@ -14,7 +14,7 @@ public sealed class CreateMessageResult : Result
/// Gets or sets the content of the assistant's response.
/// </summary>
/// <remarks>
/// In the corresponding JSON, this may be a single content block or an array of content blocks.
/// In the corresponding JSON, this might be a single content block or an array of content blocks.
/// </remarks>
[JsonPropertyName("content")]
[JsonConverter(typeof(SingleItemOrListConverter<ContentBlock>))]
@ -25,7 +25,7 @@ public sealed class CreateMessageResult : Result
/// </summary>
/// <remarks>
/// <para>
/// This should contain the specific model identifier such as "claude-3-5-sonnet-20241022" or "o3-mini".
/// This value should contain the specific model identifier such as "claude-3-5-sonnet-20241022" or "o3-mini".
/// </para>
/// <para>
/// This property allows the server to know which model was used to generate the response,
@ -54,6 +54,9 @@ public sealed class CreateMessageResult : Result
/// <summary>
/// Gets or sets the role of the user who generated the message.
/// </summary>
/// <value>
/// The role of the user who generated the message. The default is <see cref="Role.Assistant"/>.
/// </value>
[JsonPropertyName("role")]
public Role Role { get; set; } = Role.Assistant;

View file

@ -20,12 +20,12 @@ public sealed class ElicitRequestParams
/// <summary>
/// Gets or sets the requested schema.
/// </summary>
/// <remarks>
/// May be one of <see cref="StringSchema"/>, <see cref="NumberSchema"/>, <see cref="BooleanSchema"/>,
/// <value>
/// Possible values are <see cref="StringSchema"/>, <see cref="NumberSchema"/>, <see cref="BooleanSchema"/>,
/// <see cref="UntitledSingleSelectEnumSchema"/>, <see cref="TitledSingleSelectEnumSchema"/>,
/// <see cref="UntitledMultiSelectEnumSchema"/>, <see cref="TitledMultiSelectEnumSchema"/>,
/// or <see cref="LegacyTitledEnumSchema"/> (deprecated).
/// </remarks>
/// and <see cref="LegacyTitledEnumSchema"/> (deprecated).
/// </value>
[JsonPropertyName("requestedSchema")]
[field: MaybeNull]
public RequestSchema RequestedSchema
@ -38,7 +38,7 @@ public sealed class ElicitRequestParams
public class RequestSchema
{
/// <summary>Gets the type of the schema.</summary>
/// <remarks>This is always "object".</remarks>
/// <remarks>This value is always "object".</remarks>
[JsonPropertyName("type")]
public string Type => "object";
@ -61,7 +61,7 @@ public sealed class ElicitRequestParams
}
/// <summary>
/// Represents restricted subset of JSON Schema:
/// Represents a restricted subset of JSON Schema:
/// <see cref="StringSchema"/>, <see cref="NumberSchema"/>, <see cref="BooleanSchema"/>,
/// <see cref="UntitledSingleSelectEnumSchema"/>, <see cref="TitledSingleSelectEnumSchema"/>,
/// <see cref="UntitledMultiSelectEnumSchema"/>, <see cref="TitledMultiSelectEnumSchema"/>,
@ -70,12 +70,12 @@ public sealed class ElicitRequestParams
[JsonConverter(typeof(Converter))]
public abstract class PrimitiveSchemaDefinition
{
/// <summary>Prevent external derivations.</summary>
/// <summary>Prevents external derivations.</summary>
protected private PrimitiveSchemaDefinition()
{
}
/// <summary>Gets the type of the schema.</summary>
/// <summary>Gets or sets the type of the schema.</summary>
[JsonPropertyName("type")]
public abstract string Type { get; set; }
@ -90,7 +90,7 @@ public sealed class ElicitRequestParams
/// <summary>
/// Provides a <see cref="JsonConverter"/> for <see cref="ResourceContents"/>.
/// </summary>
/// Provides a polymorphic converter for the <see cref="PrimitiveSchemaDefinition"/> class that doesn't require
/// Provides a polymorphic converter for the <see cref="PrimitiveSchemaDefinition"/> class that doesn't require
/// setting <see cref="JsonSerializerOptions.AllowOutOfOrderMetadataProperties"/> explicitly.
[EditorBrowsable(EditorBrowsableState.Never)]
public class Converter : JsonConverter<PrimitiveSchemaDefinition>
@ -742,8 +742,10 @@ public sealed class ElicitRequestParams
/// <summary>
/// Represents a legacy schema for an enum type with enumNames.
/// This schema is deprecated in favor of <see cref="TitledSingleSelectEnumSchema"/>.
/// </summary>
/// <remarks>
/// This schema is deprecated in favor of <see cref="TitledSingleSelectEnumSchema"/>.
/// </remarks>
[Obsolete("Use TitledSingleSelectEnumSchema instead. This type will be removed in a future version.")]
public class LegacyTitledEnumSchema : PrimitiveSchemaDefinition
{

View file

@ -34,10 +34,10 @@ public sealed class ElicitResult : Result
public string Action { get; set; } = "cancel";
/// <summary>
/// Convenience indicator for whether the elicitation was accepted by the user.
/// Gets a value that indicates whether the elicitation was accepted by the user.
/// </summary>
/// <remarks>
/// Indicates that the elicitation request completed successfully and value of <see cref="Content"/> has been populated with a value.
/// If <see langword="true"/>, it indicates that the elicitation request completed successfully and value of <see cref="Content"/> has been populated with a value.
/// </remarks>
[JsonIgnore]
public bool IsAccepted => string.Equals(Action, "accept", StringComparison.OrdinalIgnoreCase);
@ -47,7 +47,7 @@ public sealed class ElicitResult : Result
/// </summary>
/// <remarks>
/// <para>
/// This is typically omitted if the action is "cancel" or "decline".
/// This value is typically omitted if the action is "cancel" or "decline".
/// </para>
/// <para>
/// Values in the dictionary should be of types <see cref="JsonValueKind.String"/>, <see cref="JsonValueKind.Number"/>,
@ -89,10 +89,10 @@ public sealed class ElicitResult<T> : Result
public string Action { get; set; } = "cancel";
/// <summary>
/// Convenience indicator for whether the elicitation was accepted by the user.
/// Gets a value that indicates whether the elicitation was accepted by the user.
/// </summary>
/// <remarks>
/// Indicates that the elicitation request completed successfully and value of <see cref="Content"/> has been populated with a value.
/// If <see langword="true"/>, it indicates that the elicitation request completed successfully and value of <see cref="Content"/> has been populated with a value.
/// </remarks>
public bool IsAccepted => string.Equals(Action, "accept", StringComparison.OrdinalIgnoreCase);
@ -100,4 +100,4 @@ public sealed class ElicitResult<T> : Result
/// Gets or sets the submitted form data as a typed value.
/// </summary>
public T? Content { get; set; }
}
}

View file

@ -23,7 +23,7 @@ public sealed class GetPromptRequestParams : RequestParams
/// </summary>
/// <remarks>
/// Typically, these arguments are used to replace placeholders in prompt templates. The keys in this dictionary
/// should match the names defined in the prompt's <see cref="Prompt.Arguments"/> list. However, the server may
/// should match the names defined in the prompt's <see cref="Prompt.Arguments"/> list. However, the server can
/// choose to use these arguments in any way it deems appropriate to generate the prompt.
/// </remarks>
[JsonPropertyName("arguments")]

View file

@ -17,9 +17,9 @@ public interface IBaseMetadata
/// <remarks>
/// This is intended for UI and end-user contexts. It is optimized to be human-readable and easily understood,
/// even by those unfamiliar with domain-specific terminology.
/// If not provided, <see cref="Name"/> may be used for display (except for tools, where <see cref="ToolAnnotations.Title"/>, if present,
/// If not provided, <see cref="Name"/> can be used for display (except for tools, where <see cref="ToolAnnotations.Title"/>, if present,
/// should be given precedence over using <see cref="Name"/>).
/// </remarks>
[JsonPropertyName("title")]
string? Title { get; set; }
}
}

View file

@ -10,7 +10,7 @@ namespace ModelContextProtocol.Protocol;
/// <remarks>
/// <para>
/// The <see cref="ITransport"/> interface is the core abstraction for bidirectional communication.
/// It provides methods for sending and receiving messages, abstracting away the underlying transport mechanism
/// It provides methods for sending and receiving messages, abstracting away the underlying transport mechanism,
/// and allowing protocol implementations to be decoupled from communication details.
/// </para>
/// <para>
@ -27,8 +27,8 @@ public interface ITransport : IAsyncDisposable
{
/// <summary>Gets an identifier associated with the current MCP session.</summary>
/// <remarks>
/// Typically populated in transports supporting multiple sessions such as Streamable HTTP or SSE.
/// Can return <see langword="null"/> if the session hasn't initialized or if the transport doesn't
/// The identifier is typically populated in transports supporting multiple sessions, such as Streamable HTTP or SSE.
/// This property can return <see langword="null"/> if the session hasn't initialized or if the transport doesn't
/// support multiple sessions (as is the case with STDIO).
/// </remarks>
string? SessionId { get; }
@ -39,7 +39,7 @@ public interface ITransport : IAsyncDisposable
/// <remarks>
/// <para>
/// The <see cref="MessageReader"/> provides access to incoming JSON-RPC messages received by the transport.
/// It returns a <see cref="ChannelReader{T}"/> which allows consuming messages in a thread-safe manner.
/// It returns a <see cref="ChannelReader{T}"/> which allows messages to be consumed in a thread-safe manner.
/// </para>
/// <para>
/// The reader will continue to provide messages as long as the transport is connected. When the transport

View file

@ -35,10 +35,10 @@ public sealed class Icon
/// </summary>
/// <remarks>
/// <para>
/// This can be an HTTP/HTTPS URL pointing to an image file or a data URI with base64-encoded image data.
/// This value can be an HTTP/HTTPS URL pointing to an image file or a data URI with base64-encoded image data.
/// </para>
/// <para>
/// Consumers SHOULD take steps to ensure URLs serving icons are from the same domain as the client/server
/// Consumers SHOULD take steps to ensure URLs serving icons are from the same domain as the client/server
/// or a trusted domain.
/// </para>
/// <para>
@ -52,7 +52,7 @@ public sealed class Icon
/// Gets or sets the optional MIME type of the icon.
/// </summary>
/// <remarks>
/// This can be used to override the server's MIME type if it's missing or generic.
/// This value can be used to override the server's MIME type if it's missing or generic.
/// Common values include "image/png", "image/jpeg", "image/svg+xml", and "image/webp".
/// </remarks>
[JsonPropertyName("mimeType")]
@ -63,7 +63,7 @@ public sealed class Icon
/// </summary>
/// <remarks>
/// <para>
/// This can specify one or more sizes at which the icon file can be used.
/// This property can specify one or more sizes at which the icon file can be used.
/// Examples include "48x48", "any" for scalable formats like SVG.
/// </para>
/// <para>
@ -78,7 +78,7 @@ public sealed class Icon
/// </summary>
/// <remarks>
/// Can be "light", "dark", or a custom theme identifier.
/// Used to specify which UI theme the icon is designed for.
/// The value is used to specify which UI theme the icon is designed for.
/// </remarks>
[JsonPropertyName("theme")]
public string? Theme { get; set; }

View file

@ -57,7 +57,7 @@ public sealed class Implementation : IBaseMetadata
/// Gets or sets an optional list of icons for this implementation.
/// </summary>
/// <remarks>
/// This can be used by clients to display the implementation's icon in a user interface.
/// This value can be used by clients to display the implementation's icon in a user interface.
/// </remarks>
[JsonPropertyName("icons")]
public IList<Icon>? Icons { get; set; }
@ -70,10 +70,10 @@ public sealed class Implementation : IBaseMetadata
/// This URL can be used by clients to link to documentation or more information about the implementation.
/// </para>
/// <para>
/// Consumers SHOULD take steps to ensure URLs are from the same domain as the client/server
/// Consumers SHOULD take steps to ensure URLs are from the same domain as the client/server
/// or a trusted domain to prevent security issues.
/// </para>
/// </remarks>
[JsonPropertyName("websiteUrl")]
public string? WebsiteUrl { get; set; }
}
}

View file

@ -30,7 +30,7 @@ public sealed class InitializeRequestParams : RequestParams
/// 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
/// 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>
@ -54,7 +54,7 @@ public sealed class InitializeRequestParams : RequestParams
/// </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.
/// Servers might use this information for logging, debugging, or compatibility checks.
/// </remarks>
[JsonPropertyName("clientInfo")]
public required Implementation ClientInfo { get; set; }

View file

@ -7,7 +7,7 @@ namespace ModelContextProtocol.Protocol;
/// </summary>
/// <remarks>
/// <para>
/// The <see cref="InitializeResult"/> is sent by the server in response to an <see cref="InitializeRequestParams"/>
/// The <see cref="InitializeResult"/> is sent by the server in response to an <see cref="InitializeRequestParams"/>
/// message from the client. It contains information about the server, its capabilities, and the protocol version
/// that will be used for the session.
/// </para>
@ -26,8 +26,8 @@ public sealed class InitializeResult : Result
/// </summary>
/// <remarks>
/// <para>
/// This is the 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
/// This is the 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.
/// </para>
/// <para>
@ -44,7 +44,7 @@ public sealed class InitializeResult : Result
/// Gets or sets the server's capabilities.
/// </summary>
/// <remarks>
/// This defines the features the server supports, such as "tools", "prompts", "resources", or "logging",
/// This property defines the features the server supports, such as "tools", "prompts", "resources", or "logging",
/// and other protocol-specific functionality.
/// </remarks>
[JsonPropertyName("capabilities")]
@ -55,7 +55,7 @@ public sealed class InitializeResult : Result
/// </summary>
/// <remarks>
/// This information identifies the server during the initialization handshake.
/// Clients may use this information for logging, debugging, or compatibility checks.
/// Clients might use this information for logging, debugging, or compatibility checks.
/// </remarks>
[JsonPropertyName("serverInfo")]
public required Implementation ServerInfo { get; set; }

Some files were not shown because too many files have changed in this diff Show more