{"record":{"id":"e92f6b9f84e24622","repo":"github/github-mcp-server","slug":"failed-to-unmarshal-toolsets-w-e92f6b","errorCode":null,"errorMessage":"failed to unmarshal toolsets: %w","messagePattern":"failed to unmarshal toolsets: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/github-mcp-server/main.go","lineNumber":82,"sourceCode":"\t\t\t}\n\t\t\tif appAuthRequested && token != \"\" {\n\t\t\t\treturn errors.New(\"GitHub App authentication and GITHUB_PERSONAL_ACCESS_TOKEN are mutually exclusive: set only one\")\n\t\t\t}\n\t\t\tif appAuthRequested && oauthClientID != \"\" {\n\t\t\t\treturn errors.New(\"GitHub App authentication and OAuth login (--oauth-client-id) are mutually exclusive: set only one\")\n\t\t\t}\n\n\t\t\t// If you're wondering why we're not using viper.GetStringSlice(\"toolsets\"),\n\t\t\t// it's because viper doesn't handle comma-separated values correctly for env\n\t\t\t// vars when using GetStringSlice.\n\t\t\t// https://github.com/spf13/viper/issues/380\n\t\t\t//\n\t\t\t// Additionally, viper.UnmarshalKey returns an empty slice even when the flag\n\t\t\t// is not set, but we need nil to indicate \"use defaults\". So we check IsSet first.\n\t\t\tvar enabledToolsets []string\n\t\t\tif viper.IsSet(\"toolsets\") {\n\t\t\t\tif err := viper.UnmarshalKey(\"toolsets\", &enabledToolsets); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to unmarshal toolsets: %w\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// else: enabledToolsets stays nil, meaning \"use defaults\"\n\n\t\t\t// Parse tools (similar to toolsets)\n\t\t\tvar enabledTools []string\n\t\t\tif viper.IsSet(\"tools\") {\n\t\t\t\tif err := viper.UnmarshalKey(\"tools\", &enabledTools); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to unmarshal tools: %w\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Parse excluded tools (similar to tools)\n\t\t\tvar excludeTools []string\n\t\t\tif viper.IsSet(\"exclude_tools\") {\n\t\t\t\tif err := viper.UnmarshalKey(\"exclude_tools\", &excludeTools); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to unmarshal exclude-tools: %w\", err)\n\t\t\t\t}","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/cmd/github-mcp-server/main.go#L64-L100","documentation":"Error \"failed to unmarshal toolsets: %w\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at cmd/github-mcp-server/main.go:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}