MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / callElicitationCompleteHandler

Method callElicitationCompleteHandler

mcp/client.go:1081–1100  ·  view source on GitHub ↗
(ctx context.Context, req *ElicitationCompleteNotificationRequest)

Source from the content-addressed store, hash-verified

1079}
1080
1081func (c *Client) callElicitationCompleteHandler(ctx context.Context, req *ElicitationCompleteNotificationRequest) (Result, error) {
1082 // Check if there's a pending elicitation waiting for this notification.
1083 if cs, ok := req.GetSession().(*ClientSession); ok {
1084 cs.pendingElicitationsMu.Lock()
1085 if ch, exists := cs.pendingElicitations[req.Params.ElicitationID]; exists {
1086 select {
1087 case ch <- struct{}{}:
1088 default:
1089 // Channel already signaled.
1090 }
1091 }
1092 cs.pendingElicitationsMu.Unlock()
1093 }
1094
1095 // Call the user's handler if provided.
1096 if h := c.opts.ElicitationCompleteHandler; h != nil {
1097 h(ctx, req)
1098 }
1099 return nil, nil
1100}
1101
1102// NotifyProgress sends a progress notification from the client to the server
1103// associated with this session.

Callers

nothing calls this directly

Calls 1

GetSessionMethod · 0.65

Tested by

no test coverage detected