Skip to content

Commit b15331e

Browse files
committed
SEP-2663: Add explicit polling response requirements
1 parent 25d1c9d commit b15331e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

seps/2663-tasks-extension.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,14 @@ interface GetTaskRequest extends JSONRPCRequest {
329329

330330
#### Response
331331

332+
Upon receiving a `tasks/get` request, the server **MUST** check the status of the task and respond accordingly:
333+
334+
1. If the status is `working`, the server **MUST** return a a `Task` object with status `working`.
335+
2. If the status is `input_required`, the server **MUST** return a `Task` object with status `input_required` and an `inputRequests` field defined in [Multi Round-Trip Requests](https://modelcontextprotocol.io/specification/draft/basic/utilities/mrtr). The `inputRequests` field **MUST** contain all outstanding requests from the server to the client that need to be fulfilled before the task can proceed.
336+
3. If the status is `completed`, the server **MUST** return a `Task` object with status `completed` and a `result` field containing the final result of the task.
337+
4. If the status is `cancelled`, the server **MUST** return a `Task` object with status `cancelled`.
338+
5. If the status is `failed`, the server **MUST** return a `Task` object with status `failed` and the error that occurred during execution.
339+
332340
```typescript
333341
type GetTaskResult = Result & DetailedTask;
334342
```

0 commit comments

Comments
 (0)