Skip to content

Commit 6e4fd57

Browse files
committed
SEP-2663: Specify error for servers that require tasks
1 parent a9ea0a4 commit 6e4fd57

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

docs/seps/2663-tasks-extension.mdx

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

seps/2663-tasks-extension.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,32 @@ The client and server declare support for the tasks extension in their respectiv
8282

8383
No extension-specific settings are currently defined; an empty object indicates support.
8484

85-
A server that has negotiated this extension **MAY** return `CreateTaskResult` in lieu of `CallToolResult` in response to any supported request at its own discretion and on a per-request basis. The server is the sole decider; clients do not signal task preference on the request itself. The client declaring the extension capability does not suggest that it requires a `CreateTaskResult` in response to that request.
85+
A server that has negotiated this extension **MAY** return `CreateTaskResult` in lieu of a standard result (e.g. `CallToolResult`) in response to any supported request at its own discretion and on a per-request basis. The server is the sole decider; clients do not signal task preference on the request itself. The client declaring the extension capability does not suggest that it requires a `CreateTaskResult` in response to that request.
8686

8787
A server **MUST NOT** return `CreateTaskResult` to a client that did not include the extension capability on its request, regardless of prior declarations. A client that has negotiated this extension **MUST** be prepared to handle either `CallToolResult` or `CreateTaskResult` in response to any supported request it issues. A client that receives `CreateTaskResult` in response to an unsupported request type **MUST** interpret this as an invalid response to the request.
8888

89+
If a server is unable to service a request to a client that does not declare this extension capability without returning `CreateTaskResult`, the server **MUST** return an error with the code `-32003` (Missing Required Client Capability), indicating the required extension in the error response:
90+
91+
```jsonl
92+
{
93+
"jsonrpc": "2.0",
94+
"id": 1,
95+
"error": {
96+
// MISSING_REQUIRED_CLIENT_CAPABILITY
97+
"code": -32003,
98+
// Message provided for example purposes only. The content of this example message is non-normative.
99+
"message": "Missing required client capability",
100+
"data": {
101+
"requiredCapabilities": {
102+
"extensions": {
103+
"io.modelcontextprotocol/tasks": {}
104+
}
105+
}
106+
}
107+
}
108+
}
109+
```
110+
89111
### Supported Methods
90112

91113
The following methods currently support task-augmented execution:

0 commit comments

Comments
 (0)