Skip to content

Commit bc593e0

Browse files
committed
Completions capability flag
1 parent bb1446f commit bc593e0

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

docs/specification/draft/server/utilities/completion.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ However, implementations are free to expose completion through any interface pat
2121
suits their needs—the protocol itself does not mandate any specific user
2222
interaction model.
2323

24+
## Capabilities
25+
26+
Servers that support completions **MUST** declare the `completions` capability:
27+
28+
```json
29+
{
30+
"capabilities": {
31+
"completions": {}
32+
}
33+
}
34+
```
35+
2436
## Protocol Messages
2537

2638
### Requesting Completions
@@ -113,6 +125,15 @@ sequenceDiagram
113125
- `total`: Optional total matches
114126
- `hasMore`: Additional results flag
115127

128+
## Error Handling
129+
130+
Servers **SHOULD** return standard JSON-RPC errors for common failure cases:
131+
132+
- Method not found: `-32601` (Capability not supported)
133+
- Invalid prompt name: `-32602` (Invalid params)
134+
- Missing required arguments: `-32602` (Invalid params)
135+
- Internal errors: `-32603` (Internal error)
136+
116137
## Implementation Considerations
117138

118139
1. Servers **SHOULD**:

schema/draft/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,12 @@
17881788
"ServerCapabilities": {
17891789
"description": "Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.",
17901790
"properties": {
1791+
"completions": {
1792+
"additionalProperties": true,
1793+
"description": "Present if the server supports argument autocompletion suggestions.",
1794+
"properties": {},
1795+
"type": "object"
1796+
},
17911797
"experimental": {
17921798
"additionalProperties": {
17931799
"additionalProperties": true,

schema/draft/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ export interface ServerCapabilities {
217217
* Present if the server supports sending log messages to the client.
218218
*/
219219
logging?: object;
220+
/**
221+
* Present if the server supports argument autocompletion suggestions.
222+
*/
223+
completions?: object;
220224
/**
221225
* Present if the server offers any prompt templates.
222226
*/

0 commit comments

Comments
 (0)