{"record":{"id":"2a764dd1c85dfa4d","repo":"googleapis/mcp-toolbox","slug":"unable-to-parse-as-s-w","errorCode":null,"errorMessage":"unable to parse as %s: %w","messagePattern":"unable to parse as (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/config.go","lineNumber":401,"sourceCode":"\t}\n\treturn sourceConfig, nil\n}\n\nfunc UnmarshalYAMLAuthServiceConfig(ctx context.Context, name string, r map[string]any) (auth.AuthServiceConfig, error) {\n\tresourceType, ok := r[\"type\"].(string)\n\tif !ok {\n\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\")","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/config.go#L383-L419","documentation":"Error \"unable to parse as %s: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/config.go:401 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"}