File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1092,6 +1092,13 @@ func (s *MCPServer) handleCompletion(
1092
1092
handler = arg .CompletionHandler
1093
1093
}
1094
1094
}
1095
+ } else {
1096
+ s .promptsMu .RUnlock ()
1097
+ return nil , & requestError {
1098
+ id : id ,
1099
+ code : mcp .INVALID_PARAMS ,
1100
+ err : fmt .Errorf ("prompt '%s' not found: %w" , promptRef .Name , ErrPromptNotFound ),
1101
+ }
1095
1102
}
1096
1103
s .promptsMu .RUnlock ()
1097
1104
} else if resourceRef != nil {
@@ -1100,6 +1107,13 @@ func (s *MCPServer) handleCompletion(
1100
1107
if h , ok := resourceTemplate .template .URITemplate .ArgumentCompletionHandlers [request .Params .Argument .Name ]; ok {
1101
1108
handler = & h
1102
1109
}
1110
+ } else {
1111
+ s .resourcesMu .RUnlock ()
1112
+ return nil , & requestError {
1113
+ id : id ,
1114
+ code : mcp .INVALID_PARAMS ,
1115
+ err : fmt .Errorf ("resource template '%s' not found: %w" , resourceRef .URI , ErrResourceNotFound ),
1116
+ }
1103
1117
}
1104
1118
s .resourcesMu .RUnlock ()
1105
1119
}
You can’t perform that action at this time.
0 commit comments