You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/tasks/tasks.md
-52Lines changed: 0 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,58 +137,6 @@ Task support levels:
137
137
-`Optional` (default for async methods): Tool can be called with or without task augmentation
138
138
-`Required`: Tool must be called with task augmentation
139
139
140
-
### Deferred Task Creation with MRTR
141
-
142
-
<!-- mlc-disable-next-line -->
143
-
> [!WARNING]
144
-
> Deferred task creation depends on both the [Tasks](xref:tasks) and [MRTR](xref:mrtr) experimental features.
145
-
146
-
By default, when a client sends task metadata with a `tools/call` request, the SDK creates a task immediately and runs the tool in the background. **Deferred task creation** delays the task creation, letting the tool perform ephemeral [MRTR](xref:mrtr) exchanges first — for example, to confirm an action with the user or gather required parameters — before committing to a background task.
147
-
148
-
To opt in, set `DeferTaskCreation = true` on the tool:
After <xref:ModelContextProtocol.Server.McpServer.CreateTaskAsync*> returns:
183
-
184
-
- The MRTR phase ends. The client receives a `CreateTaskResult` with the `taskId`.
185
-
- Any subsequent `ElicitAsync` or `SampleAsync` calls in the handler use the task's `input_required` / `tasks/input_response` workflow instead of MRTR.
186
-
- The handler's cancellation token is re-linked to the task's lifecycle (TTL expiration, explicit `tasks/cancel`).
187
-
188
-
If the tool returns without calling `CreateTaskAsync`, a normal (non-task) result is sent to the client — no task is created.
189
-
190
-
For more details on the MRTR mechanism and the transition flow, see [Transitioning from MRTR to Tasks](xref:mrtr#transitioning-from-mrtr-to-tasks).
191
-
192
140
### Explicit Task Creation with `IMcpTaskStore`
193
141
194
142
For more control over task lifecycle, tools can directly interact with <xref:ModelContextProtocol.IMcpTaskStore> and return an `McpTask`. This approach allows you to:
0 commit comments