googleapis/mcp-toolbox · error
incorrect settings: %w
Error message
incorrect settings: %w
What it means
After building the Looker SDK session with client credentials, Initialize performs a smoke-test call to the Looker /user (Me) endpoint. If that login/API call fails, the credentials or base URL settings are wrong and this wrapped error is returned, embedding the SDK's underlying message. It converts a runtime auth failure into a clear startup error.
Source
Thrown at internal/sources/looker/looker.go:137
var tokenSource oauth2.TokenSource
tokenSource, _ = initGoogleCloudConnection(ctx)
s := &Source{
Config: r,
ApiSettings: &cfg,
TokenSource: tokenSource,
AuthTokenHeaderName: "Authorization",
}
if strings.ToLower(r.UseClientOAuth) == "false" {
if r.ClientId == "" || r.ClientSecret == "" {
return nil, fmt.Errorf("client_id and client_secret need to be specified")
}
s.Client = v4.NewLookerSDK(rtl.NewAuthSession(cfg))
resp, err := s.Client.Me("", s.ApiSettings)
if err != nil {
return nil, fmt.Errorf("incorrect settings: %w", err)
}
logger.DebugContext(ctx, fmt.Sprintf("logged in as %s %s", *resp.FirstName, *resp.LastName))
} else {
if strings.ToLower(r.UseClientOAuth) != "true" {
s.AuthTokenHeaderName = r.UseClientOAuth
}
logger.DebugContext(ctx, fmt.Sprintf("Using AuthTokenHeaderName: %s", s.AuthTokenHeaderName))
}
return s, nil
}
var _ sources.Source = &Source{}
type Source struct {
Config
Client *v4.LookerSDKView on GitHub (pinned to 8cc6e09de2)
Solutions
- Verify the embedded SDK error in the message and re-generate Looker API3 client_id/client_secret for an active user.
- Confirm baseUrl points to your actual Looker instance (e.g. https://mycompany.looker.com) and is reachable (curl it).
- Ensure the Looker user owning the credentials can log in via API and has permission to view their own user record.
Example fix
# before (stale secret)
client_id: abc123
client_secret: old-secret
# after
client_id: abc123
client_secret: ${LOOKER_CLIENT_SECRET} # freshly generated in Looker Admin > Users > API3 Defensive patterns
Strategy: try-catch
Validate before calling
// before start: confirm Looker API is reachable and credentials work
curl -sS -o /dev/null -w '%{http_code}' https://mycompany.looker.com/api/4.0/login -d "client_id=$LOOKER_CLIENT_ID&client_secret=$LOOKER_CLIENT_SECRET"
// expect 200; non-2xx means the toolbox will fail with 'incorrect settings' Try / catch
src, err := cfg.Initialize(ctx, tracer)
if err != nil {
if strings.Contains(err.Error(), "incorrect settings") {
var sdkErr error
if errors.As(err, &sdkErr) || true { /* wrapped %w */ }
fmt.Printf("Looker login failed: %v — check credentials, baseUrl, and network reachability\n", err)
}
return err
} Prevention
- Smoke-test Looker API3 credentials with a login curl call before deploying.
- Keep baseUrl aligned with your Looker instance domain.
- Rotate credentials in the toolbox immediately when rotating them in Looker admin.
When it happens
Trigger: client_id/client_secret present but invalid/revoked, baseUrl pointing at a non-Looker or wrong-instance URL, network/DNS failure to Looker, or API3 credentials without sufficient permissions — the Me call returns an error.
Common situations: Rotated Looker API3 keys still configured in the toolbox; wrong baseUrl (e.g. missing instance subdomain); firewall/proxy blocking the Looker API; credentials from a disabled Looker user.
Related errors
- error fetching connections: %w
- unable to create bigtable.NewClient: %w
- error creating new sqladmin service: %w
- failed to find default Google Cloud credentials for project
- failed to initialize Firebase Rules client: %w
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/e86307b898237e26.
Report an issue: GitHub.