Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completions capability flag #173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/specification/draft/server/utilities/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ However, implementations are free to expose completion through any interface pat
suits their needs—the protocol itself does not mandate any specific user
interaction model.

## Capabilities

Servers that support completions **MUST** declare the `completions` capability:

```json
{
"capabilities": {
"completions": {}
}
}
```

## Protocol Messages

### Requesting Completions
Expand Down Expand Up @@ -113,6 +125,15 @@ sequenceDiagram
- `total`: Optional total matches
- `hasMore`: Additional results flag

## Error Handling

Servers **SHOULD** return standard JSON-RPC errors for common failure cases:

- Method not found: `-32601` (Capability not supported)
- Invalid prompt name: `-32602` (Invalid params)
- Missing required arguments: `-32602` (Invalid params)
- Internal errors: `-32603` (Internal error)

## Implementation Considerations

1. Servers **SHOULD**:
Expand Down
6 changes: 6 additions & 0 deletions schema/draft/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,12 @@
"ServerCapabilities": {
"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.",
"properties": {
"completions": {
"additionalProperties": true,
"description": "Present if the server supports argument autocompletion suggestions.",
"properties": {},
"type": "object"
},
"experimental": {
"additionalProperties": {
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions schema/draft/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ export interface ServerCapabilities {
* Present if the server supports sending log messages to the client.
*/
logging?: object;
/**
* Present if the server supports argument autocompletion suggestions.
*/
completions?: object;
/**
* Present if the server offers any prompt templates.
*/
Expand Down