Class CreateTaskResult
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents the result returned by a server when it creates a task in lieu of a standard result.
public sealed class CreateTaskResult : Result
- Inheritance
-
CreateTaskResult
- Inherited Members
Remarks
A server returns CreateTaskResult instead of the standard result shape (e.g., CallToolResult)
to indicate that the request will be processed asynchronously. The client then uses
TaskId for subsequent tasks/get, tasks/update, and tasks/cancel calls.
A server must not return CreateTaskResult to a client that did not include the
io.modelcontextprotocol/tasks extension capability on its request.
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
LastUpdatedAt
Gets or sets the ISO 8601 timestamp when the task was last updated.
[JsonPropertyName("lastUpdatedAt")]
public required DateTimeOffset LastUpdatedAt { get; set; }
Property Value
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 required McpTaskStatus Status { get; set; }
Property Value
StatusMessage
Gets or sets an optional message describing the current task state.
[JsonPropertyName("statusMessage")]
public string? StatusMessage { get; set; }
Property Value
TaskId
Gets or sets the stable identifier for this task.
[JsonPropertyName("taskId")]
public required string TaskId { get; set; }
Property Value
TimeToLive
Gets or sets the time-to-live duration from creation, or null for unlimited.
[JsonPropertyName("ttlMs")]
[JsonConverter(typeof(TimeSpanMillisecondsConverter))]
public TimeSpan? TimeToLive { get; set; }