googleapis/mcp-toolbox · error

error creating new alloydb service: %w

Error message

error creating new alloydb service: %w

What it means

Error "error creating new alloydb service: %w" thrown in googleapis/mcp-toolbox.

Source

Thrown at internal/sources/alloydbadmin/alloydbadmin.go:90

	var client *http.Client
	if r.UseClientOAuth {
		client = &http.Client{
			Transport: util.NewUserAgentRoundTripper(ua, http.DefaultTransport),
		}
	} else {
		// Use Application Default Credentials
		creds, err := google.FindDefaultCredentials(ctx, alloydbrestapi.CloudPlatformScope)
		if err != nil {
			return nil, fmt.Errorf("failed to find default credentials: %w", err)
		}
		baseClient := oauth2.NewClient(ctx, creds.TokenSource)
		baseClient.Transport = util.NewUserAgentRoundTripper(ua, baseClient.Transport)
		client = baseClient
	}

	service, err := alloydbrestapi.NewService(ctx, option.WithHTTPClient(client))
	if err != nil {
		return nil, fmt.Errorf("error creating new alloydb service: %w", err)
	}

	s := &Source{
		Config:  r,
		BaseURL: "https://alloydb.googleapis.com",
		Service: service,
	}

	return s, nil
}

var _ sources.Source = &Source{}

type Source struct {
	Config
	BaseURL string
	Service *alloydbrestapi.Service
}

View on GitHub (pinned to 8cc6e09de2)

When it happens

Trigger: Thrown at internal/sources/alloydbadmin/alloydbadmin.go:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/ad19bee36a6870e6. Report an issue: GitHub.