Skip to content

Commit edb77c8

Browse files
committed
SEP-2663: Flatten CreateTaskResult
1 parent 7715860 commit edb77c8

1 file changed

Lines changed: 17 additions & 21 deletions

File tree

seps/2663-tasks-extension.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,11 @@ A server returns `CreateTaskResult` in lieu of the standard result shape for a r
317317

318318
```typescript
319319
// resultType: "task"
320-
interface CreateTaskResult extends Result {
321-
task: Task;
322-
}
320+
type CreateTaskResult = Result & Task;
323321
```
324322

323+
Note that `CreateTaskResult` _does not_ contain `result`/`error`/`inputRequests`. Client implementations **MUST NOT** use these fields if they are found on `CreateTaskResult`, and **MAY** handle this as an invalid protocol response.
324+
325325
**Example Request (CallToolRequest):**
326326

327327
```json
@@ -346,15 +346,13 @@ interface CreateTaskResult extends Result {
346346
"id": 1,
347347
"result": {
348348
"resultType": "task",
349-
"task": {
350-
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
351-
"status": "working",
352-
"statusMessage": "The operation is now in progress.",
353-
"createdAt": "2025-11-25T10:30:00Z",
354-
"lastUpdatedAt": "2025-11-25T10:40:00Z",
355-
"ttl": 60,
356-
"pollInterval": 5000
357-
}
349+
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
350+
"status": "working",
351+
"statusMessage": "The operation is now in progress.",
352+
"createdAt": "2025-11-25T10:30:00Z",
353+
"lastUpdatedAt": "2025-11-25T10:40:00Z",
354+
"ttl": 60,
355+
"pollInterval": 5000
358356
}
359357
}
360358
```
@@ -515,15 +513,13 @@ The server determines (via bespoke logic) that it wants to create a task to repr
515513
"id": 2,
516514
"result": {
517515
"resultType": "task",
518-
"task": {
519-
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
520-
"status": "working",
521-
"createdAt": "2025-11-25T10:30:00Z",
522-
"lastUpdatedAt": "2025-11-25T10:50:00Z",
523-
"ttl": 3600,
524-
"pollInterval": 5000,
525-
"requestState": "SGVsbG8sIHdvcmxkCg=="
526-
}
516+
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
517+
"status": "working",
518+
"createdAt": "2025-11-25T10:30:00Z",
519+
"lastUpdatedAt": "2025-11-25T10:50:00Z",
520+
"ttl": 3600,
521+
"pollInterval": 5000,
522+
"requestState": "SGVsbG8sIHdvcmxkCg=="
527523
}
528524
}
529525
```

0 commit comments

Comments
 (0)