> ## Documentation Index
> Fetch the complete documentation index at: https://si.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CosmosStoredMcpTask

> Cosmos document for a task. [CosmosStoredMcpTask.Id](/mcpessentials/api-reference/CloudNimble/McpEssentials/Cosmos/Tasks/CosmosStoredMcpTask#id) is the Cosmos item id (the...

## Definition

**Assembly:** CloudNimble.McpEssentials.Cosmos.dll

**Namespace:** CloudNimble.McpEssentials.Cosmos.Tasks

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.McpEssentials.Cosmos.Tasks.CosmosStoredMcpTask
```

## Summary

Cosmos document for a task. [CosmosStoredMcpTask.Id](https://si.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Cosmos/Tasks/CosmosStoredMcpTask.md#id) is the Cosmos item id (the task id).
Partition key is [CosmosStoredMcpTask.OwnerUserId](https://si.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Cosmos/Tasks/CosmosStoredMcpTask.md#owneruserid).

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public CosmosStoredMcpTask()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### &#x20;CreatedAt

Gets or sets when the task was created, UTC.

#### Syntax

```csharp theme={"dark"}
public System.DateTimeOffset CreatedAt { get; set; }
```

#### Property Value

Type: `System.DateTimeOffset`

### &#x20;DiscardAfter

Gets or sets when the document should be discarded.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<System.DateTimeOffset> DiscardAfter { get; set; }
```

#### Property Value

Type: `System.Nullable<System.DateTimeOffset>`

### &#x20;Error

Gets or sets the JSON-RPC error payload.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<System.Text.Json.JsonElement> Error { get; set; }
```

#### Property Value

Type: `System.Nullable<System.Text.Json.JsonElement>`

### &#x20;ExpiresAt

Gets or sets the work-window end.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<System.DateTimeOffset> ExpiresAt { get; set; }
```

#### Property Value

Type: `System.Nullable<System.DateTimeOffset>`

### &#x20;Id

Gets or sets the Cosmos item id (the opaque task identifier).

#### Syntax

```csharp theme={"dark"}
public string Id { get; set; }
```

#### Property Value

Type: `string`

### &#x20;InputRequests

Gets or sets outstanding input requests.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.Dictionary<string, ModelContextProtocol.Protocol.InputRequest> InputRequests { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.Dictionary<string, ModelContextProtocol.Protocol.InputRequest>?`

### &#x20;LastUpdatedAt

Gets or sets when the task last changed, UTC.

#### Syntax

```csharp theme={"dark"}
public System.DateTimeOffset LastUpdatedAt { get; set; }
```

#### Property Value

Type: `System.DateTimeOffset`

### &#x20;OwnerUserId

Gets or sets the user recorded when the task was created. Partition key.

#### Syntax

```csharp theme={"dark"}
public string OwnerUserId { get; set; }
```

#### Property Value

Type: `string`

### &#x20;PollIntervalMs

Gets or sets the client poll interval in milliseconds.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<long> PollIntervalMs { get; set; }
```

#### Property Value

Type: `System.Nullable<long>`

### &#x20;Result

Gets or sets the terminal result payload.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<System.Text.Json.JsonElement> Result { get; set; }
```

#### Property Value

Type: `System.Nullable<System.Text.Json.JsonElement>`

### &#x20;Status

Gets or sets the protocol status (enum name).

#### Syntax

```csharp theme={"dark"}
public ModelContextProtocol.Extensions.Tasks.McpTaskStatus Status { get; set; }
```

#### Property Value

Type: `ModelContextProtocol.Extensions.Tasks.McpTaskStatus`

### &#x20;StatusMessage

Gets or sets an optional status message.

#### Syntax

```csharp theme={"dark"}
public string StatusMessage { get; set; }
```

#### Property Value

Type: `string?`

### &#x20;TimeToLive

Gets or sets the time-to-live from create, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for unlimited.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<System.TimeSpan> TimeToLive { get; set; }
```

#### Property Value

Type: `System.Nullable<System.TimeSpan>`

### &#x20;TimeToLiveSeconds

Gets or sets Cosmos per-document TTL in seconds, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unlimited.

#### Syntax

```csharp theme={"dark"}
public System.Nullable<int> TimeToLiveSeconds { get; set; }
```

#### Property Value

Type: `System.Nullable<int>`

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;From

Copies *stored* into a Cosmos document.

#### Syntax

```csharp theme={"dark"}
public static CloudNimble.McpEssentials.Cosmos.Tasks.CosmosStoredMcpTask From(CloudNimble.McpEssentials.Core.Tasks.StoredMcpTask stored, System.DateTimeOffset now)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `stored` | `CloudNimble.McpEssentials.Core.Tasks.StoredMcpTask` | The in-memory snapshot. |
| `now` | `System.DateTimeOffset` | The current UTC time, used to stamp [CosmosStoredMcpTask.TimeToLiveSeconds](https://si.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Cosmos/Tasks/CosmosStoredMcpTask.md#timetoliveseconds). |

#### Returns

Type: `CloudNimble.McpEssentials.Cosmos.Tasks.CosmosStoredMcpTask`
A document with the same fields.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *stored* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToStored Virtual

Builds a [StoredMcpTask](https://si.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/StoredMcpTask.md) from this document.

#### Syntax

```csharp theme={"dark"}
public virtual CloudNimble.McpEssentials.Core.Tasks.StoredMcpTask ToStored()
```

#### Returns

Type: `CloudNimble.McpEssentials.Core.Tasks.StoredMcpTask`
A snapshot the Core `Try*` methods can mutate.

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

### &#x20;ToTtlSeconds

Converts *discardAfter* into Cosmos TTL seconds from *now*.

#### Syntax

```csharp theme={"dark"}
public static System.Nullable<int> ToTtlSeconds(System.Nullable<System.DateTimeOffset> discardAfter, System.DateTimeOffset now)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `discardAfter` | `System.Nullable<System.DateTimeOffset>` | The visibility ceiling, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unlimited. |
| `now` | `System.DateTimeOffset` | The current UTC time. |

#### Returns

Type: `System.Nullable<int>`
At least 1 second, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when unlimited.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.