Enum McpTaskStatus
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents the status of an MCP task.
[JsonConverter(typeof(JsonStringEnumConverter<McpTaskStatus>))]
[Experimental("MCPEXP001", UrlFormat = "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/list-of-diagnostics.md#mcpexp001")]
public enum McpTaskStatus
Fields
[JsonStringEnumMemberName("cancelled")] Cancelled = 4The request was cancelled before completion.
This is a terminal status. Tasks in this status cannot transition to any other status.
[JsonStringEnumMemberName("completed")] Completed = 2The request completed successfully and results are available.
This is a terminal status. Tasks in this status cannot transition to any other status.
[JsonStringEnumMemberName("failed")] Failed = 3The associated request did not complete successfully.
This is a terminal status. For tool calls specifically, this includes cases where the tool call result has isError set to true. Tasks in this status cannot transition to any other status.
[JsonStringEnumMemberName("input_required")] InputRequired = 1The receiver needs input from the requestor.
The requestor should call tasks/result to receive input requests, even though the task has not reached a terminal state. From InputRequired, tasks may transition to Working, Completed, Failed, or Cancelled.
[JsonStringEnumMemberName("working")] Working = 0The request is currently being processed.
Tasks begin in this status when created. From Working, tasks may transition to InputRequired, Completed, Failed, or Cancelled.
Remarks
Tasks progress through a defined lifecycle:
- Working: The request is currently being processed.
- InputRequired: The receiver needs input from the requestor. The requestor should call tasks/result to receive input requests.
- Completed: The request completed successfully and results are available.
- Failed: The request did not complete successfully.
- Cancelled: The request was cancelled before completion.
Terminal states are Completed, Failed, and Cancelled. Once a task reaches a terminal state, it cannot transition to any other status.