using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using ModelContextProtocol.Server;
namespace ModelContextProtocol.Protocol;
///
/// Represents the capabilities that a server supports.
///
///
///
/// Server capabilities define the features and functionality available when clients connect.
/// These capabilities are advertised to clients during the initialize handshake.
///
///
/// See the schema for details.
///
///
public sealed class ServerCapabilities
{
///
/// Gets or sets experimental, non-standard capabilities that the server supports.
///
///
///
/// The dictionary allows servers 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.
///
///
/// Values in this dictionary are implementation-specific and should be coordinated between client
/// and server implementations. Clients should not assume the presence of any experimental capability
/// without checking for it first.
///
///
[JsonPropertyName("experimental")]
public IDictionary? Experimental { get; set; }
///
/// Gets or sets a server's logging capability for sending log messages to the client.
///
[JsonPropertyName("logging")]
public LoggingCapability? Logging { get; set; }
///
/// Gets or sets a server's prompts capability for serving predefined prompt templates that clients can discover and use.
///
[JsonPropertyName("prompts")]
public PromptsCapability? Prompts { get; set; }
///
/// Gets or sets a server's resources capability for serving predefined resources that clients can discover and use.
///
[JsonPropertyName("resources")]
public ResourcesCapability? Resources { get; set; }
///
/// Gets or sets a server's tools capability for listing tools that a client is able to invoke.
///
[JsonPropertyName("tools")]
public ToolsCapability? Tools { get; set; }
///
/// Gets or sets a server's completions capability for supporting argument auto-completion suggestions.
///
[JsonPropertyName("completions")]
public CompletionsCapability? Completions { get; set; }
///
/// Gets or sets a server's tasks capability for supporting task-augmented requests.
///
///
///
/// The tasks capability enables clients to augment their requests with tasks for long-running
/// operations. When present, clients can request that certain operations (like tool calls)
/// execute asynchronously, with the ability to poll for status and retrieve results later.
///
///
/// See for details on configuring which operations support tasks.
///
///
[Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)]
[JsonIgnore]
public McpTasksCapability? Tasks
{
get => TasksCore;
set => TasksCore = value;
}
// See ExperimentalInternalPropertyTests.cs before modifying this property.
[JsonInclude]
[JsonPropertyName("tasks")]
internal McpTasksCapability? TasksCore { get; set; }
}