@@ -184,30 +184,31 @@ type methodHandler func(map[string]interface{}) (string, map[string]interface{})
184184
185185// methodHandlers maps MCP methods to their respective handlers
186186var methodHandlers = map [string ]methodHandler {
187- "initialize" : handleInitializeMethod ,
188- "tools/call" : handleNamedResourceMethod ,
189- "prompts/get" : handleNamedResourceMethod ,
190- "resources/read" : handleResourceReadMethod ,
191- "resources/list" : handleListMethod ,
192- "tools/list" : handleListMethod ,
193- "prompts/list" : handleListMethod ,
194- "progress/update" : handleProgressMethod ,
195- "notifications/message" : handleNotificationMethod ,
196- "logging/setLevel" : handleLoggingMethod ,
197- "completion/complete" : handleCompletionMethod ,
198- "elicitation/create" : handleElicitationMethod ,
199- "sampling/createMessage" : handleSamplingMethod ,
200- "resources/subscribe" : handleResourceSubscribeMethod ,
201- "resources/unsubscribe" : handleResourceUnsubscribeMethod ,
202- "resources/templates/list" : handleListMethod ,
203- "roots/list" : handleListMethod ,
204- "notifications/progress" : handleProgressNotificationMethod ,
205- "notifications/cancelled" : handleCancelledNotificationMethod ,
206- "tasks/list" : handleListMethod ,
207- "tasks/get" : handleTaskIDMethod ,
208- "tasks/cancel" : handleTaskIDMethod ,
209- "tasks/result" : handleTaskIDMethod ,
210- "notifications/tasks/status" : handleTaskStatusNotificationMethod ,
187+ "initialize" : handleInitializeMethod ,
188+ "tools/call" : handleNamedResourceMethod ,
189+ "prompts/get" : handleNamedResourceMethod ,
190+ "resources/read" : handleResourceReadMethod ,
191+ "resources/list" : handleListMethod ,
192+ "tools/list" : handleListMethod ,
193+ "prompts/list" : handleListMethod ,
194+ "progress/update" : handleProgressMethod ,
195+ "notifications/message" : handleNotificationMethod ,
196+ "logging/setLevel" : handleLoggingMethod ,
197+ "completion/complete" : handleCompletionMethod ,
198+ "elicitation/create" : handleElicitationMethod ,
199+ "sampling/createMessage" : handleSamplingMethod ,
200+ "resources/subscribe" : handleResourceSubscribeMethod ,
201+ "resources/unsubscribe" : handleResourceUnsubscribeMethod ,
202+ "resources/templates/list" : handleListMethod ,
203+ "roots/list" : handleListMethod ,
204+ "notifications/progress" : handleProgressNotificationMethod ,
205+ "notifications/cancelled" : handleCancelledNotificationMethod ,
206+ "tasks/list" : handleListMethod ,
207+ "tasks/get" : handleTaskIDMethod ,
208+ "tasks/cancel" : handleTaskIDMethod ,
209+ "tasks/result" : handleTaskIDMethod ,
210+ "notifications/tasks/status" : handleTaskStatusNotificationMethod ,
211+ "notifications/elicitation/complete" : handleElicitationCompleteNotificationMethod ,
211212}
212213
213214// staticResourceIDs maps methods to their static resource IDs
@@ -359,6 +360,16 @@ func handleElicitationMethod(paramsMap map[string]interface{}) (string, map[stri
359360 return "" , paramsMap
360361}
361362
363+ // handleElicitationCompleteNotificationMethod extracts resource ID for elicitation complete notifications.
364+ // This notification is sent by the server when an out-of-band URL-mode elicitation is completed.
365+ // Returns the elicitationId as the resource identifier.
366+ func handleElicitationCompleteNotificationMethod (paramsMap map [string ]interface {}) (string , map [string ]interface {}) {
367+ if elicitationId , ok := paramsMap ["elicitationId" ].(string ); ok {
368+ return elicitationId , paramsMap
369+ }
370+ return "" , paramsMap
371+ }
372+
362373// handleSamplingMethod extracts resource ID for sampling/createMessage requests.
363374// Returns the model name from modelPreferences if available, otherwise returns a
364375// truncated version of the systemPrompt. The 50-character truncation provides a
0 commit comments