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
TaskIdstringStatusMcpTaskStatusCreatedAtDateTimeOffsetLastUpdatedAtDateTimeOffsetTimeToLiveTimeSpan?PollIntervalMslong?StatusMessagestringResultJsonElement?ErrorJsonElement?InputRequestsIReadOnlyDictionary<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
Error
public JsonElement? Error { get; init; }
Property Value
InputRequests
public IReadOnlyDictionary<string, InputRequest>? InputRequests { get; init; }
Property Value
LastUpdatedAt
public DateTimeOffset LastUpdatedAt { get; init; }
Property Value
PollIntervalMs
public long? PollIntervalMs { get; init; }
Property Value
- long?
Result
public JsonElement? Result { get; init; }
Property Value
Status
public McpTaskStatus Status { get; init; }
Property Value
StatusMessage
public string? StatusMessage { get; init; }
Property Value
TaskId
public string TaskId { get; init; }
Property Value
TimeToLive
public TimeSpan? TimeToLive { get; init; }