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
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,11 +94,11 @@ Clients declare if they support tasks, and if so, which client-side requests can
94
94
95
95
### Capability Negotiation
96
96
97
-
During the initialization phase, both parties exchange their `tasks` capabilities to establish which operations support task-based execution. Requestors **MUST** only augment requests with task metadata if the corresponding capability has been declared by the receiver.
97
+
During the initialization phase, both parties exchange their `tasks` capabilities to establish which operations support task-based execution. Requestors **SHOULD** only augment requests with a task if the corresponding capability has been declared by the receiver.
98
98
99
-
For example, if a server's capabilities include `tasks.requests.tools.call: {}`, then clients may augment `tools/call` requests with task metadata. If a client's capabilities include `tasks.requests.sampling.createMessage: {}`, then servers may augment `sampling/createMessage` requests with task metadata.
99
+
For example, if a server's capabilities include `tasks.requests.tools.call: {}`, then clients may augment `tools/call` requests with a task. If a client's capabilities include `tasks.requests.sampling.createMessage: {}`, then servers may augment `sampling/createMessage` requests with a task.
100
100
101
-
If `capabilities.tasks` is not defined, the peer **MUST NOT** attempt to create tasks during requests.
101
+
If `capabilities.tasks` is not defined, the peer **SHOULD NOT** attempt to create tasks during requests.
102
102
103
103
The set of capabilities in `capabilities.tasks.requests` is exhaustive. If a request type is not present, it does not support task-augmentation.
104
104
@@ -125,7 +125,7 @@ This is to be interpreted as a fine-grained layer in addition to capabilities, f
125
125
Task-augmented requests follow a two-phase response pattern that differs from normal requests:
126
126
127
127
-**Normal requests**: The server processes the request and returns the actual operation result directly.
128
-
-**Task-augmented requests**: The server accepts the request and immediately returns a `CreateTaskResult` containing task metadata. The actual operation result becomes available later through `tasks/result` after the task completes.
128
+
-**Task-augmented requests**: The server accepts the request and immediately returns a `CreateTaskResult` containing task data. The actual operation result becomes available later through `tasks/result` after the task completes.
129
129
130
130
To create a task, requestors send a request with the `task` field included in the request params. Requestors **MAY** include a `ttl` value indicating the desired task lifetime duration (in milliseconds) since its creation.
131
131
@@ -167,7 +167,7 @@ To create a task, requestors send a request with the `task` field included in th
167
167
}
168
168
```
169
169
170
-
When a receiver accepts a task-augmented request, it returns a [`CreateTaskResult`](/specification/draft/schema#createtaskresult) containing task metadata. The response does not include the actual operation result. The actual result (e.g., tool result for `tools/call`) becomes available only through `tasks/result` after the task completes.
170
+
When a receiver accepts a task-augmented request, it returns a [`CreateTaskResult`](/specification/draft/schema#createtaskresult) containing task data. The response does not include the actual operation result. The actual result (e.g., tool result for `tools/call`) becomes available only through `tasks/result` after the task completes.
171
171
172
172
<Note>
173
173
@@ -219,7 +219,7 @@ Requestors **SHOULD** continue polling until the task reaches a terminal status
219
219
220
220
### Retrieving Task Results
221
221
222
-
After a task completes the operation result is retrieved via [`tasks/result`](/specification/draft/schema#tasks%2Fresult). This is distinct from the initial `CreateTaskResult` response, which contains only task metadata. The result structure matches the original request type (e.g., `CallToolResult` for `tools/call`).
222
+
After a task completes the operation result is retrieved via [`tasks/result`](/specification/draft/schema#tasks%2Fresult). This is distinct from the initial `CreateTaskResult` response, which contains only task data. The result structure matches the original request type (e.g., `CallToolResult` for `tools/call`).
223
223
224
224
To retrieve the result of a completed task, requestors can send a `tasks/result` request:
225
225
@@ -279,7 +279,7 @@ When a task status changes, receivers **MAY** send a [`notifications/tasks/statu
279
279
}
280
280
```
281
281
282
-
The notification includes the full [`Task`](/specification/draft/schema#task) object with all task metadata fields, including the updated `status` and `statusMessage` (if present). This allows requestors to access the complete task state without making an additional `tasks/get` request.
282
+
The notification includes the full [`Task`](/specification/draft/schema#task) object, including the updated `status` and `statusMessage` (if present). This allows requestors to access the complete task state without making an additional `tasks/get` request.
283
283
284
284
Requestors **MUST NOT** rely on receiving this notifications, as it is optional. Receivers are not required to send status notifications and may choose to only send them for certain status transitions. Requestors **SHOULD** continue to poll via `tasks/get` to ensure they receive status updates.
A task represents the execution state of a request. The task metadata includes:
638
+
A task represents the execution state of a request. The task state includes:
639
639
640
640
-`taskId`: Unique identifier for the task
641
641
-`status`: Current state of the task execution
@@ -750,7 +750,7 @@ Receivers **SHOULD** provide informative error messages to describe the cause of
750
750
751
751
<Note>
752
752
753
-
Receivers are not required to retain task metadata indefinitely. It is compliant behavior for a receiver to return an error stating the task cannot be found if it has purged an expired task.
753
+
Receivers are not required to retain tasks indefinitely. It is compliant behavior for a receiver to return an error stating the task cannot be found if it has purged an expired task.
0 commit comments