Table of Contents

Class McpTaskInfo

Namespace
ModelContextProtocol.Server
Assembly
ModelContextProtocol.Core.dll

Represents the state of a task in an IMcpTaskStore.

public sealed record McpTaskInfo : IEquatable<McpTaskInfo>
Inheritance
McpTaskInfo
Implements
Inherited Members

Remarks

This is the store's representation of a task, decoupled from the MCP protocol wire types. The server infrastructure maps McpTaskInfo to the appropriate protocol response types (CreateTaskResult, GetTaskResult) when communicating with clients.

Constructors

McpTaskInfo(string, McpTaskStatus, DateTimeOffset, DateTimeOffset, TimeSpan?, long?, string?, JsonElement?, JsonElement?, IReadOnlyDictionary<string, InputRequest>?)

Represents the state of a task in an IMcpTaskStore.

public McpTaskInfo(string TaskId, McpTaskStatus Status, DateTimeOffset CreatedAt, DateTimeOffset LastUpdatedAt, TimeSpan? TimeToLive = null, long? PollIntervalMs = null, string? StatusMessage = null, JsonElement? Result = null, JsonElement? Error = null, IReadOnlyDictionary<string, InputRequest>? InputRequests = null)

Parameters

TaskId string
Status McpTaskStatus
CreatedAt DateTimeOffset
LastUpdatedAt DateTimeOffset
TimeToLive TimeSpan?
PollIntervalMs long?
StatusMessage string
Result JsonElement?
Error JsonElement?
InputRequests IReadOnlyDictionary<string, InputRequest>

Remarks

This is the store's representation of a task, decoupled from the MCP protocol wire types. The server infrastructure maps McpTaskInfo to the appropriate protocol response types (CreateTaskResult, GetTaskResult) when communicating with clients.

Properties

CreatedAt

public DateTimeOffset CreatedAt { get; init; }

Property Value

DateTimeOffset

Error

public JsonElement? Error { get; init; }

Property Value

JsonElement?

InputRequests

public IReadOnlyDictionary<string, InputRequest>? InputRequests { get; init; }

Property Value

IReadOnlyDictionary<string, InputRequest>

LastUpdatedAt

public DateTimeOffset LastUpdatedAt { get; init; }

Property Value

DateTimeOffset

PollIntervalMs

public long? PollIntervalMs { get; init; }

Property Value

long?

Result

public JsonElement? Result { get; init; }

Property Value

JsonElement?

Status

public McpTaskStatus Status { get; init; }

Property Value

McpTaskStatus

StatusMessage

public string? StatusMessage { get; init; }

Property Value

string

TaskId

public string TaskId { get; init; }

Property Value

string

TimeToLive

public TimeSpan? TimeToLive { get; init; }

Property Value

TimeSpan?