csharp-sdk/src/ModelContextProtocol.Extensions.Tasks/Server/McpTasksOptions.cs
Pranav Senthilnathan 7838900e8b
Enable complete Tasks extension conformance coverage (#1741)
Copilot-Session: 7c99928c-a943-49f4-9a63-8b04a0e4d18b
2026-07-27 12:45:25 -07:00

22 lines
869 B
C#

using ModelContextProtocol.Protocol;
using ModelContextProtocol.Server;
namespace ModelContextProtocol.Extensions.Tasks;
/// <summary>
/// Configures server-side MCP Tasks behavior.
/// </summary>
public sealed class McpTasksOptions
{
/// <summary>
/// Gets or sets the callback that selects task execution behavior for each tool call.
/// </summary>
/// <remarks>
/// The default treats every tool as task-capable, preserving the behavior of
/// <c>WithTasks</c>.
/// The callback may inspect <see cref="RequestContext{TParams}.MatchedPrimitive"/> to select
/// behavior from tool metadata without requiring Core to reference the Tasks extension.
/// </remarks>
public Func<RequestContext<CallToolRequestParams>, McpTaskExecutionMode> ExecutionModeSelector { get; set; } =
static _ => McpTaskExecutionMode.Optional;
}