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
+4-18Lines changed: 4 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -414,9 +414,9 @@ stateDiagram-v2
414
414
### Result Retrieval
415
415
416
416
1. Receivers that accept a task-augmented request **MUST** return a `CreateTaskResult` as the response. This result **SHOULD** be returned as soon as possible after accepting the task.
417
-
1.Receivers **MUST**only return the actual operation results via `tasks/result` when the task status is `completed`.
418
-
1.Receivers **MUST** return an error if `tasks/result` is called for a task in any other status.
419
-
1.Requestors **MAY**call `tasks/result` multiple times for the same task while it remains available.
417
+
1.When a receiver receives a `tasks/result` request, it **MUST**block the response until the task reaches a terminal status (`completed`, `failed`, `cancelled`, or `unknown`).
418
+
1.For tasks in `completed` status, receivers **MUST** return the actual operation results as specified by the original request type.
419
+
1.For tasks in `failed`, `cancelled`, or `unknown` status, receivers **MUST**return a successful JSON-RPC response containing error or status details in the result structure.
420
420
421
421
### Associating Task-Related Messages
422
422
@@ -710,7 +710,6 @@ Receivers **MUST** return standard JSON-RPC errors for the following protocol er
710
710
711
711
- Invalid or nonexistent `taskId` in `tasks/get`, `tasks/list`, `tasks/result`, or `tasks/delete`: `-32602` (Invalid params)
712
712
- Invalid or nonexistent cursor in `tasks/list`: `-32602` (Invalid params)
713
-
- Attempting to retrieve result when task is not in `completed` status: `-32602` (Invalid params)
714
713
- Receiver rejects a `tasks/delete` request: `-32600` (Invalid request)
715
714
- Internal errors: `-32603` (Internal error)
716
715
@@ -765,19 +764,6 @@ Receivers are not obligated to retain task metadata indefinitely. It is complian
765
764
766
765
</Note>
767
766
768
-
**Example: Result requested for incomplete task**
769
-
770
-
```json
771
-
{
772
-
"jsonrpc": "2.0",
773
-
"id": 72,
774
-
"error": {
775
-
"code": -32602,
776
-
"message": "Cannot retrieve result: Task status is 'working', not 'completed'"
777
-
}
778
-
}
779
-
```
780
-
781
767
**Example: Task deletion rejected by receiver**
782
768
783
769
```json
@@ -810,7 +796,7 @@ When the underlying request does not complete successfully, the task moves to th
810
796
}
811
797
```
812
798
813
-
For tasks that wrap tool call requests, when the tool result has `isError` set to true, the task should reach `failed` status. The error information is conveyed both through the task's `failed` status and through the result structure when retrieved via `tasks/result`.
799
+
For tasks that wrap tool call requests, when the tool result has `isError` set to true, the task should reach `failed` status.
0 commit comments