Skip to content

Commit dbc2b0a

Browse files
committed
Remove submitted and unknown statuses
1 parent d05cfbb commit dbc2b0a

File tree

4 files changed

+15
-30
lines changed

4 files changed

+15
-30
lines changed

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

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ To create a task, requestors send a request with the `modelcontextprotocol.io/ta
121121
"id": 1,
122122
"result": {
123123
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
124-
"status": "submitted",
124+
"status": "working",
125125
"keepAlive": 60000,
126126
"pollInterval": 5000,
127127
"_meta": {
@@ -162,7 +162,7 @@ To retrieve the state of a task, requestors send a `tasks/get` request:
162162
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
163163
"keepAlive": 30000,
164164
"pollInterval": 5000,
165-
"status": "submitted",
165+
"status": "working",
166166
"_meta": {
167167
"modelcontextprotocol.io/related-task": {
168168
"taskId": "786512e2-9e0d-44bd-8f29-789f320fe840"
@@ -362,23 +362,17 @@ These requirements apply to all parties that support receiving task-augmented re
362362

363363
### Task Status Lifecycle
364364

365-
1. Tasks **MUST** begin in the `submitted` status when created.
365+
1. Tasks **MUST** begin in the `working` status when created.
366366
1. Receivers **MUST** only transition tasks through the following valid paths:
367-
1. From `submitted`: may move to `working`, `input_required`, `completed`, `failed`, `cancelled`, or `unknown`
368-
1. From `working`: may move to `input_required`, `completed`, `failed`, `cancelled`, or `unknown`
369-
1. From `input_required`: may move to `working`, `completed`, `failed`, `cancelled`, or `unknown`
370-
1. Tasks in `completed`, `failed`, `cancelled`, or `unknown` status **MUST NOT** transition to any other status (terminal states)
371-
1. Receivers **MAY** move directly from `submitted` to `completed` if execution completes immediately.
372-
1. The `unknown` status is a terminal fallback state for unexpected error conditions. Receivers **SHOULD** use `failed` with an error message instead when possible.
367+
1. From `working`: may move to `input_required`, `completed`, `failed`, or `cancelled`
368+
1. From `input_required`: may move to `working`, `completed`, `failed`, or `cancelled`
369+
1. Tasks in `completed`, `failed`, or `cancelled` status **MUST NOT** transition to any other status (terminal states)
373370

374371
**Task Status State Diagram:**
375372

376373
```mermaid
377374
stateDiagram-v2
378-
[*] --> submitted
379-
380-
submitted --> working
381-
submitted --> terminal
375+
[*] --> working
382376
383377
working --> input_required
384378
working --> terminal
@@ -393,7 +387,6 @@ stateDiagram-v2
393387
• completed
394388
• failed
395389
• cancelled
396-
• unknown
397390
end note
398391
```
399392

@@ -414,8 +407,8 @@ stateDiagram-v2
414407
### Result Retrieval
415408

416409
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. When a receiver receives a `tasks/result` request for a task in a terminal status (`completed`, `failed`, `cancelled`, or `unknown`), it **MUST** return the final result of the underlying request, whether that is a successful result or a JSON-RPC error.
418-
1. When a receiver receives a `tasks/result` request for a task in any other non-terminal status (`submitted`, `working`, `input_required`), it **MUST** block the response until the task reaches a terminal status.
410+
1. When a receiver receives a `tasks/result` request for a task in a terminal status (`completed`, `failed`, or `cancelled`), it **MUST** return the final result of the underlying request, whether that is a successful result or a JSON-RPC error.
411+
1. When a receiver receives a `tasks/result` request for a task in any other non-terminal status (`working` or `input_required`), it **MUST** block the response until the task reaches a terminal status.
419412
1. For tasks in a terminal status, 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.
420413

421414
### Associating Task-Related Messages
@@ -429,7 +422,7 @@ stateDiagram-v2
429422
1. Requestors **MAY** send `notifications/cancelled` at any time during task execution.
430423
1. When a receiver receives a `notifications/cancelled` notification for the JSON-RPC request ID of a task-augmented request, the receiver **SHOULD** immediately move the task to the `cancelled` status and cease all processing associated with that task.
431424
1. Due to the asynchronous nature of notifications, receivers **MAY** not cancel task processing instantaneously. Receivers **SHOULD** make a best-effort attempt to halt execution as quickly as possible.
432-
1. If a `notifications/cancelled` notification arrives after a task has already reached a terminal status (`completed`, `failed`, `cancelled`, or `unknown`), receivers **SHOULD** ignore the notification.
425+
1. If a `notifications/cancelled` notification arrives after a task has already reached a terminal status (`completed`, `failed`, or `cancelled`), receivers **SHOULD** ignore the notification.
433426
1. After a task reaches `cancelled` status and its `keepAlive` duration has elapsed, receivers **MAY** delete the task and its metadata.
434427
1. Because notifications do not provide confirmation of receipt, requestors **SHOULD** continue to poll with `tasks/get` after sending a cancellation notification to confirm the task has transitioned to `cancelled` status. If the task does not transition to `cancelled` within a reasonable timeframe, requestors **MAY** assume the cancellation was not processed.
435428

@@ -457,12 +450,10 @@ sequenceDiagram
457450
participant S as Server (Receiver)
458451
Note over C,S: 1. Task Creation
459452
C->>S: Request with task metadata (taskId, keepAlive)
460-
S->>C: CreateTaskResult (taskId, status: submitted, keepAlive, pollInterval)
453+
S->>C: CreateTaskResult (taskId, status: working, keepAlive, pollInterval)
461454
S--)C: notifications/tasks/created
462455
Note over C,S: 2. Task Polling
463456
C->>S: tasks/get (taskId)
464-
S->>C: submitted
465-
C->>S: tasks/get (taskId)
466457
S->>C: working
467458
Note over S: Task processing continues...
468459
C->>S: tasks/get (taskId)
@@ -491,7 +482,7 @@ sequenceDiagram
491482
492483
Note over C,S: Client augments with task metadata
493484
C->>S: tools/call (task-123, keepAlive: 3600000)
494-
S->>C: CreateTaskResult (task-123, status: submitted)
485+
S->>C: CreateTaskResult (task-123, status: working)
495486
S--)C: notifications/tasks/created
496487
497488
Note over LLM,C: Client continues processing other requests<br/>while task executes in background
@@ -548,7 +539,7 @@ sequenceDiagram
548539
549540
Note over S,C: Server requests client operation (task-augmented)
550541
S->>C: sampling/createMessage (request-789, keepAlive: 3600000)
551-
C->>S: CreateTaskResult (request-789, status: submitted)
542+
C->>S: CreateTaskResult (request-789, status: working)
552543
C--)S: notifications/tasks/created
553544
554545
Note over S: Server continues processing<br/>while waiting for result
@@ -659,13 +650,11 @@ A task represents the execution state of a request. The task metadata includes:
659650

660651
Tasks can be in one of the following states:
661652

662-
- `submitted`: The request has been received and queued for execution
663653
- `working`: The request is currently being processed
664654
- `input_required`: The receiver needs input from the requestor. The requestor should call `tasks/result` to receive input requests, even though the task has not reached a terminal state.
665655
- `completed`: The request completed successfully and results are available
666656
- `failed`: The associated request did not complete successfully. For tool calls specifically, this includes cases where the tool call result has `isError` set to true.
667657
- `cancelled`: The request was cancelled before completion
668-
- `unknown`: A terminal fallback state for unexpected error conditions when the receiver cannot determine the actual task state
669658

670659
### Task Metadata
671660

docs/specification/draft/schema.mdx

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema/draft/schema.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema/draft/schema.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,13 +1160,11 @@ export interface Tool extends BaseMetadata, Icons {
11601160
* @category tasks
11611161
*/
11621162
export type TaskStatus =
1163-
| "submitted" // The request has been received and queued for execution
11641163
| "working" // The request is currently being processed
11651164
| "input_required" // The task is waiting for input (e.g., elicitation or sampling)
11661165
| "completed" // The request completed successfully and results are available
11671166
| "failed" // The associated request did not complete successfully. For tool calls specifically, this includes cases where the tool call result has `isError` set to true.
1168-
| "cancelled" // The request was cancelled before completion
1169-
| "unknown"; // A terminal fallback state for unexpected error conditions
1167+
| "cancelled"; // The request was cancelled before completion
11701168

11711169
/**
11721170
* Metadata for augmenting a request with task execution.

0 commit comments

Comments
 (0)