Table of Contents

Class GetTaskResult

Namespace
ModelContextProtocol.Extensions.Tasks
Assembly
ModelContextProtocol.Extensions.Tasks.dll

Represents the result of a tasks/get request, containing the full task state.

[JsonConverter(typeof(GetTaskResult.Converter))]
public abstract class GetTaskResult : Result
Inheritance
GetTaskResult
Derived
Inherited Members

Remarks

This is the abstract base for status-specific task results. The concrete type returned depends on the task's current Status:

See the SEP-2663 specification for details.

Properties

CreatedAt

Gets or sets the ISO 8601 timestamp when the task was created.

[JsonPropertyName("createdAt")]
public required DateTimeOffset CreatedAt { get; set; }

Property Value

DateTimeOffset

LastUpdatedAt

Gets or sets the ISO 8601 timestamp when the task was last updated.

[JsonPropertyName("lastUpdatedAt")]
public required DateTimeOffset LastUpdatedAt { get; set; }

Property Value

DateTimeOffset

PollIntervalMs

Gets or sets the suggested polling interval in milliseconds.

[JsonPropertyName("pollIntervalMs")]
public long? PollIntervalMs { get; set; }

Property Value

long?

Status

Gets or sets the current task status.

[JsonPropertyName("status")]
public abstract McpTaskStatus Status { get; }

Property Value

McpTaskStatus

StatusMessage

Gets or sets an optional message describing the current task state.

[JsonPropertyName("statusMessage")]
public string? StatusMessage { get; set; }

Property Value

string

TaskId

Gets or sets the stable identifier for this task.

[JsonPropertyName("taskId")]
public required string TaskId { get; set; }

Property Value

string

TimeToLive

Gets or sets the time-to-live duration from creation, or null for unlimited.

[JsonPropertyName("ttlMs")]
public TimeSpan? TimeToLive { get; set; }

Property Value

TimeSpan?