Skip to content

Commit 8a4e3ac

Browse files
committed
Add capabilities and annotations for tasks
1 parent 42a4e5b commit 8a4e3ac

File tree

5 files changed

+365
-14
lines changed

5 files changed

+365
-14
lines changed

docs/specification/draft/basic/lifecycle.mdx

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,23 @@ The client **MUST** initiate this phase by sending an `initialize` request conta
6464
"listChanged": true
6565
},
6666
"sampling": {},
67-
"elicitation": {}
67+
"elicitation": {},
68+
"tasks": {
69+
"sampling": {
70+
"createMessage": true
71+
},
72+
"elicitation": {
73+
"create": true
74+
},
75+
"roots": {
76+
"list": true
77+
},
78+
"tasks": {
79+
"get": true,
80+
"list": true,
81+
"result": true
82+
}
83+
}
6884
},
6985
"clientInfo": {
7086
"name": "ExampleClient",
@@ -102,6 +118,25 @@ The server **MUST** respond with its own capabilities and information:
102118
},
103119
"tools": {
104120
"listChanged": true
121+
},
122+
"tasks": {
123+
"tools": {
124+
"call": true,
125+
"list": true
126+
},
127+
"resources": {
128+
"read": true,
129+
"list": true
130+
},
131+
"prompts": {
132+
"get": true,
133+
"list": true
134+
},
135+
"tasks": {
136+
"get": true,
137+
"list": true,
138+
"result": true
139+
}
105140
}
106141
},
107142
"serverInfo": {
@@ -171,12 +206,14 @@ Key capabilities include:
171206
| Client | `roots` | Ability to provide filesystem [roots](/specification/draft/client/roots) |
172207
| Client | `sampling` | Support for LLM [sampling](/specification/draft/client/sampling) requests |
173208
| Client | `elicitation` | Support for server [elicitation](/specification/draft/client/elicitation) requests |
209+
| Client | `tasks` | Support for [task-augmented](/specification/draft/basic/utilities/tasks) client requests |
174210
| Client | `experimental` | Describes support for non-standard experimental features |
175211
| Server | `prompts` | Offers [prompt templates](/specification/draft/server/prompts) |
176212
| Server | `resources` | Provides readable [resources](/specification/draft/server/resources) |
177213
| Server | `tools` | Exposes callable [tools](/specification/draft/server/tools) |
178214
| Server | `logging` | Emits structured [log messages](/specification/draft/server/utilities/logging) |
179215
| Server | `completions` | Supports argument [autocompletion](/specification/draft/server/utilities/completion) |
216+
| Server | `tasks` | Support for [task-augmented](/specification/draft/basic/utilities/tasks) server requests |
180217
| Server | `experimental` | Describes support for non-standard experimental features |
181218

182219
Capability objects can describe sub-capabilities like:

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

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,76 @@ Implementations are free to expose tasks through any interface pattern that suit
1616

1717
## Capabilities
1818

19-
Unlike other protocol features, tasks _do not_ require capabilities to be declared.
19+
Servers and clients that support task-augmented requests **MUST** declare a `tasks` capability during initialization. The `tasks` capability is structured by request category, with boolean properties indicating which specific request types support task augmentation.
20+
21+
### Server Capabilities
22+
23+
Servers declare which server-side requests can be augmented with tasks:
24+
25+
```json
26+
{
27+
"capabilities": {
28+
"tasks": {
29+
"tools": {
30+
"call": true,
31+
"list": true
32+
},
33+
"resources": {
34+
"read": true,
35+
"list": true
36+
},
37+
"prompts": {
38+
"get": true,
39+
"list": true
40+
},
41+
"tasks": {
42+
"get": true,
43+
"list": true,
44+
"result": true
45+
}
46+
}
47+
}
48+
}
49+
```
50+
51+
Servers **MAY** support tasks for any subset of their available request types. If a request type is not listed in the `tasks` capability or is set to `false`, requestors **SHOULD NOT** augment those requests with task metadata.
52+
53+
The `tasks.tasks` nested capability indicates whether the task management operations themselves (`tasks/get`, `tasks/list`, `tasks/result`) can be augmented with tasks, enabling recursive task tracking for task queries.
54+
55+
### Client Capabilities
56+
57+
Clients declare which client-side requests can be augmented with tasks:
58+
59+
```json
60+
{
61+
"capabilities": {
62+
"tasks": {
63+
"sampling": {
64+
"createMessage": true
65+
},
66+
"elicitation": {
67+
"create": true
68+
},
69+
"roots": {
70+
"list": true
71+
},
72+
"tasks": {
73+
"get": true,
74+
"list": true,
75+
"result": true
76+
}
77+
}
78+
}
79+
}
80+
```
81+
82+
The `tasks.tasks` capability applies when the client is acting as a receiver of task-augmented requests from the server (for example, when a server sends a task-augmented `sampling/createMessage` request to the client).
83+
84+
### Capability Negotiation
85+
86+
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.
87+
88+
For example, if a server's capabilities include `tasks.tools.call: true`, then clients may augment `tools/call` requests with task metadata. However, if the server does not declare `tasks.resources.read`, clients should not send task-augmented `resources/read` requests.
2089

2190
## Protocol Messages
2291

0 commit comments

Comments
 (0)