{"record":{"id":"09356ff58a52f87a","repo":"googleapis/mcp-toolbox","slug":"scopesrequired-is-not-allowed-when-mcpenabled-09356f","errorCode":null,"errorMessage":"`scopesRequired` is not allowed when `mcpEnabled` is false","messagePattern":"`scopesRequired` is not allowed when `mcpEnabled` is false","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/config.go","lineNumber":408,"sourceCode":"\t\treturn nil, fmt.Errorf(\"missing 'type' field or it is not a string\")\n\t}\n\tdec, err := util.NewStrictDecoder(r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating decoder: %s\", err)\n\t}\n\n\tswitch resourceType {\n\tcase google.AuthServiceType:\n\t\tactual := google.Config{Name: name}\n\t\tif err := dec.DecodeContext(ctx, &actual); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse as %s: %w\", name, err)\n\t\t}\n\t\tif !actual.McpEnabled {\n\t\t\tif actual.Audience != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"`audience` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t\tif len(actual.ScopesRequired) > 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"`scopesRequired` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t}\n\t\treturn actual, nil\n\tcase generic.AuthServiceType:\n\t\tactual := generic.Config{Name: name}\n\t\tif err := dec.DecodeContext(ctx, &actual); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to parse as %s: %w\", name, err)\n\t\t}\n\t\tif !actual.McpEnabled {\n\t\t\tif actual.IntrospectionEndpoint != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"`introspectionEndpoint` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t\tif actual.IntrospectionMethod != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"`introspectionMethod` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t\tif actual.IntrospectionParamName != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"`introspectionParamName` is not allowed when `mcpEnabled` is false\")\n\t\t\t}","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/config.go#L390-L426","documentation":"Error \"`scopesRequired` is not allowed when `mcpEnabled` is false\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/config.go:408 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":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}