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/specification/draft/basic/utilities/tasks.mdx
+10-79Lines changed: 10 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,9 +320,9 @@ To retrieve a list of tasks, requestors send a `tasks/list` request. This operat
320
320
321
321
### Cancelling Tasks
322
322
323
-
To explicitly cancel a task, requestors send a `tasks/cancel` request. The request can optionally include a `delete` parameter to immediately delete the task and its results after cancellation.
323
+
To explicitly cancel a task, requestors send a `tasks/cancel` request.
324
324
325
-
**Request (basic cancellation):**
325
+
**Request:**
326
326
327
327
```json
328
328
{
@@ -342,41 +342,12 @@ To explicitly cancel a task, requestors send a `tasks/cancel` request. The reque
342
342
"jsonrpc": "2.0",
343
343
"id": 6,
344
344
"result": {
345
-
"status": "cancelled",
346
-
"executionStopped": true,
347
-
"_meta": {
348
-
"modelcontextprotocol.io/related-task": {
349
-
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840"
350
-
}
351
-
}
352
-
}
353
-
}
354
-
```
355
-
356
-
**Request (cancellation with deletion):**
357
-
358
-
```json
359
-
{
360
-
"jsonrpc": "2.0",
361
-
"id": 7,
362
-
"method": "tasks/cancel",
363
-
"params": {
364
345
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
365
-
"delete": true
366
-
}
367
-
}
368
-
```
369
-
370
-
**Response:**
371
-
372
-
```json
373
-
{
374
-
"jsonrpc": "2.0",
375
-
"id": 7,
376
-
"result": {
377
346
"status": "cancelled",
378
-
"executionStopped": true,
379
-
"deleted": true,
347
+
"statusMessage": "The task was cancelled by request.",
348
+
"createdAt": "2025-11-25T10:30:00Z",
349
+
"ttl": 30000,
350
+
"pollInterval": 5000,
380
351
"_meta": {
381
352
"modelcontextprotocol.io/related-task": {
382
353
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840"
@@ -475,9 +446,8 @@ Task-augmented requests support progress notifications as defined in the progres
475
446
1. Receivers **MUST** reject cancellation requests for tasks already in a terminal status (`completed`, `failed`, or `cancelled`) with error code `-32602` (Invalid params).
476
447
1. Upon receiving a valid cancellation request, receivers **SHOULD** attempt to stop the task's execution (best effort) and **MUST** transition the task to `cancelled` status before sending the response.
477
448
1. Once a task is cancelled, it **MUST** remain in `cancelled` status even if execution continues to completion or fails.
478
-
1. If the `delete` parameter is `true`, receivers **SHOULD** delete the task and all associated results and metadata after transitioning to `cancelled` status. Receivers **MAY** choose not to support deletion and ignore this parameter.
479
-
1. If the `delete` parameter is `false` or omitted, receivers **MUST** retain the task in `cancelled` status subject to the `ttl` duration.
480
-
1. Requestors **SHOULD** use the `delete` parameter to clean up tasks containing sensitive data promptly rather than relying solely on `ttl` expiration.
449
+
1. The `tasks/cancel` operation does not define deletion behavior. However, receivers **MAY** delete cancelled tasks at their discretion at any time, including immediately after cancellation or after the task's `ttl` expires.
450
+
1. Requestors **SHOULD NOT** rely on cancelled tasks being retained for any specific duration and should retrieve any needed information before cancelling.
481
451
482
452
## Message Flow
483
453
@@ -635,44 +605,11 @@ sequenceDiagram
635
605
Note over S: Server stops execution (best effort)
636
606
Note over S: Task moves to cancelled status
637
607
638
-
S->>C: Result (status: cancelled, executionStopped: true)
608
+
S->>C: Task (status: cancelled)
639
609
640
610
Note over C: Client receives confirmation
641
611
642
-
Note over S: After ttl period from creation, task cleaned up
Note over S: Server may delete task at its discretion
676
613
```
677
614
678
615
## Data Types
@@ -852,12 +789,6 @@ The `tasks/result` endpoint returns exactly what the underlying request would ha
852
789
853
790
### Resource Management
854
791
855
-
<Warning>
856
-
857
-
Task results may persist for the duration specified by the TTL. For sensitive operations, requestors should carefully consider the security implications of extended task retention and may want to retrieve results promptly and request shorter `ttl` durations. Requestors are encouraged to use `tasks/cancel` with the `delete` parameter set to `true` to explicitly clean up tasks containing sensitive data rather than relying solely on `ttl` expiration.
858
-
859
-
</Warning>
860
-
861
792
1. Receivers **SHOULD**:
862
793
1. Enforce limits on concurrent tasks per requestor
863
794
1. Enforce maximum `ttl` durations to prevent indefinite resource retention
0 commit comments