mcp: add ServerSession.NotifyElicitationComplete (#1194)

Adds:

```go
func (ss *ServerSession) NotifyElicitationComplete(ctx context.Context, params *ElicitationCompleteParams) error
```

As according to
[spec](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-11-25/schema.ts#L2493-L2501)
This commit is contained in:
Guglielmo Colombo 2026-08-24 10:14:28 +02:00 • committed by GitHub
commit 6f0a645c20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1733,6 +1733,18 @@ func (ss *ServerSession) Elicit(ctx context.Context, params *ElicitParams) (*Eli
return res, nil
}
// NotifyElicitationComplete tells the client that the out-of-band ("url" mode)
// elicitation identified by params.ElicitationID has finished.
func (ss *ServerSession) NotifyElicitationComplete(ctx context.Context, params *ElicitationCompleteParams) error {
if params == nil {
return fmt.Errorf("%w: params cannot be nil", jsonrpc2.ErrInvalidParams)
}
if params.ElicitationID == "" {
return fmt.Errorf("%w: ElicitationID cannot be empty", jsonrpc2.ErrInvalidParams)
}
return handleNotify(ctx, notificationElicitationComplete, newServerRequest(ss, orZero[Params](params)))
}
// Log sends a log message to the client.
//
// For new-protocol (>= 2026-07-28) requests, the level is taken from the