using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
///
/// Represents the parameters used with a request from a client to invoke a tool provided by the server.
///
///
/// The server will respond with a containing the result of the tool invocation.
/// See the schema for details.
///
public sealed class CallToolRequestParams : RequestParams
{
/// Gets or sets the name of the tool to invoke.
[JsonPropertyName("name")]
public required string Name { get; set; }
///
/// Gets or sets optional arguments to pass to the tool when invoking it on the server.
///
///
/// This dictionary contains the parameter values to be passed to the tool. Each key-value pair represents
/// a parameter name and its corresponding argument value.
///
[JsonPropertyName("arguments")]
public IDictionary? Arguments { get; set; }
///
/// Gets or sets optional task metadata to augment this request with task execution.
///
///
/// When present, indicates that the requestor wants this operation executed as a task.
/// The receiver must support task augmentation for this specific request type.
///
[Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)]
[JsonIgnore]
public McpTaskMetadata? Task
{
get => TaskCore;
set => TaskCore = value;
}
// See ExperimentalInternalPropertyTests.cs before modifying this property.
[JsonInclude]
[JsonPropertyName("task")]
internal McpTaskMetadata? TaskCore { get; set; }
}