Skip to content

Commit 7d008e0

Browse files
committed
Add explicit note that tasks/result can return an error
1 parent 642c3c7 commit 7d008e0

File tree

1 file changed

+6
-2
lines changed
  • docs/specification/draft/basic/utilities

1 file changed

+6
-2
lines changed

docs/specification/draft/basic/utilities/tasks.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ stateDiagram-v2
415415

416416
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.
417417
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.
418+
1. Receivers **MUST** return from `tasks/result` exactly what the underlying request would have returned, whether that is a successful result or a JSON-RPC error.
420419

421420
### Associating Task-Related Messages
422421

@@ -798,6 +797,11 @@ When the underlying request does not complete successfully, the task moves to th
798797

799798
For tasks that wrap tool call requests, when the tool result has `isError` set to true, the task should reach `failed` status.
800799

800+
The `tasks/result` endpoint returns exactly what the underlying request would have returned:
801+
802+
- If the underlying request resulted in a JSON-RPC error, `tasks/result` **MUST** return that same JSON-RPC error.
803+
- If the request completed with a JSON-RPC response, `tasks/result` **MUST** return a successful JSON-RPC response containing that result.
804+
801805
## Security Considerations
802806

803807
### Task Isolation and Access Control

0 commit comments

Comments
 (0)