{"record":{"id":"57ae627991d6eece","repo":"github/github-mcp-server","slug":"unsupported-ref-type-s","errorCode":null,"errorMessage":"unsupported ref type: %s","messagePattern":"unsupported ref type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/github/server.go","lineNumber":206,"sourceCode":"\n\treturn s\n}\n\nfunc CompletionsHandler(getClient GetClientFn) func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {\n\treturn func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {\n\t\tif req == nil || req.Params == nil || req.Params.Ref == nil {\n\t\t\treturn nil, fmt.Errorf(\"missing required parameter: ref\")\n\t\t}\n\t\tswitch req.Params.Ref.Type {\n\t\tcase \"ref/resource\":\n\t\t\tif strings.HasPrefix(req.Params.Ref.URI, \"repo://\") {\n\t\t\t\treturn RepositoryResourceCompletionHandler(getClient)(ctx, req)\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"unsupported resource URI: %s\", req.Params.Ref.URI)\n\t\tcase \"ref/prompt\":\n\t\t\treturn nil, nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unsupported ref type: %s\", req.Params.Ref.Type)\n\t\t}\n\t}\n}\n\nfunc MarshalledTextResult(v any) *mcp.CallToolResult {\n\tdata, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn utils.NewToolResultErrorFromErr(\"failed to marshal text result to json\", err)\n\t}\n\n\treturn utils.NewToolResultText(string(data))\n}\n","sourceCodeStart":188,"sourceCodeEnd":219,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/server.go#L188-L219","documentation":"CompleteRequest.Params.Ref.Type is neither ref/prompt nor ref/resource. The MCP spec defines exactly those two ref shapes for completion; any other string (typo, future ref type, custom value) lands in the default branch and is rejected.","triggerScenarios":"Client sends ref/type=ref/tool or a custom string; newer MCP spec adds a ref type this server version does not know (version skew); handcrafted JSON requests.","commonSituations":"Client/server version drift after MCP spec additions; exploratory tooling probing the completion endpoint.","solutions":["Send only ref/prompt (with name) or ref/resource (with uri) refs","Align client and server MCP protocol versions","Handle the error client-side by skipping completion for that ref"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isSupportedRefType(t string) boolean {\n\treturn t === \"ref/prompt\" || t === \"ref/resource\";\n}","tryCatchPattern":null,"preventionTips":["Send only spec-defined ref types: ref/prompt, ref/resource","Keep client and server MCP protocol versions aligned","Add an exhaustiveness switch on ref type in client code so new types fail loudly in tests"],"tags":["mcp","protocol","type-guard"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}