{"record":{"id":"4cc9349890cfbd2e","repo":"googleapis/mcp-toolbox","slug":"failed-to-find-default-google-cloud-credentials-wi-4cc934","errorCode":null,"errorMessage":"failed to find default Google Cloud credentials with scope %q: %w","messagePattern":"failed to find default Google Cloud credentials with scope %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/cloudhealthcare/cloud_healthcare.go","lineNumber":179,"sourceCode":"\t}\n\tts := oauth2.StaticTokenSource(token)\n\n\t// Initialize the Healthcare service with tokenSource\n\tservice, err := healthcare.NewService(ctx, option.WithUserAgent(userAgent), option.WithTokenSource(ts))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create Healthcare service: %w\", err)\n\t}\n\tservice.UserAgent = userAgent\n\treturn service, nil\n}\n\nfunc initHealthcareConnection(ctx context.Context, tracer trace.Tracer, name string) (*healthcare.Service, oauth2.TokenSource, error) {\n\tctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, name)\n\tdefer span.End()\n\n\tcred, err := google.FindDefaultCredentials(ctx, healthcare.CloudHealthcareScope)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to find default Google Cloud credentials with scope %q: %w\", healthcare.CloudHealthcareScope, err)\n\t}\n\n\tuserAgent, err := util.UserAgentFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tservice, err := healthcare.NewService(ctx, option.WithUserAgent(userAgent), option.WithCredentials(cred))\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to create Healthcare service: %w\", err)\n\t}\n\tservice.UserAgent = userAgent\n\treturn service, cred.TokenSource, nil\n}\n\nvar _ sources.Source = &Source{}\n\ntype Source struct {","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/cloudhealthcare/cloud_healthcare.go#L161-L197","documentation":"Error \"failed to find default Google Cloud credentials with scope %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/cloudhealthcare/cloud_healthcare.go:179 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"}