{"record":{"id":"f0b729c2778b9973","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-f0b729","errorCode":null,"errorMessage":"invalid source for %q tool: source %q is not a compatible type","messagePattern":"invalid source for %q tool: source %q is not a compatible type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/looker/lookergetprojects/lookergetprojects.go","lineNumber":105,"sourceCode":"// validate interface\nvar _ tools.Tool = Tool{}\n\ntype Tool struct {\n\ttools.BaseTool[Config]\n}\n\nfunc (t Tool) GetSourceName() string {\n\treturn t.Cfg.Source\n}\n\nfunc (t Tool) ToConfig() tools.ToolConfig {\n\treturn t.Cfg\n}\n\nfunc (t Tool) ValidateSource(source sources.Source) error {\n\t_, ok := source.(compatibleSource)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid source for %q tool: source %q is not a compatible type\", t.Cfg.Type, t.Cfg.Source)\n\t}\n\treturn nil\n}\n\nfunc (t Tool) EmbedParams(ctx context.Context, paramValues parameters.ParamValues, pMgr tools.PrimitiveManagerI) (parameters.ParamValues, error) {\n\treturn parameters.ParamValues{}, nil\n}\n\nfunc (t Tool) Invoke(ctx context.Context, s sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {\n\tsource, ok := s.(compatibleSource)\n\tif !ok {\n\t\treturn nil, util.NewClientServerError(\"source used is not compatible with the tool\", http.StatusInternalServerError, nil)\n\t}\n\tlogger, err := util.LoggerFromContext(ctx)\n\tif err != nil {\n\t\treturn nil, util.NewClientServerError(\"unable to get logger from ctx\", http.StatusInternalServerError, err)\n\t}\n","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookergetprojects/lookergetprojects.go#L87-L123","documentation":"ValidateSource for the looker-get-projects tool type-asserts the supplied sources.Source to compatibleSource. If the source bound to the tool is not the Looker API source, the assertion fails and this error is returned. The tool can only operate on Looker sources.","triggerScenarios":"ValidateSource runs during toolset construction or invocation with a non-Looker source (e.g. postgres, cloud-sql, http) bound to a looker-get-projects tool entry.","commonSituations":"Wrong `source:` value in tools.yaml; source renamed so the tool silently binds elsewhere; mixing Looker tools into toolsets built for other databases.","solutions":["Update the tool's `source:` field to reference a kind: looker source.","Audit all looker-* tool entries for correct source bindings in one pass.","Restart and confirm the server starts without ValidateSource errors."],"exampleFix":"// before\nkind: looker-get-projects\nsource: pg-main\n// after\nkind: looker-get-projects\nsource: looker-main","handlingStrategy":"type-guard","validationCode":"// Cross-check looker tool kinds against source kinds at load\ntoolKinds := map[string]bool{\"looker-get-projects\": true}\nif toolKinds[toolCfg.Kind] && cfg.Sources[toolCfg.Source].GetSourceConfigType() != \"looker\" {\n    return fmt.Errorf(\"tool %s requires a looker source; got %s\", toolCfg.Name, cfg.Sources[toolCfg.Source].GetSourceConfigType())\n}","typeGuard":"func isLookerSource(s sources.Source) bool {\n    _, ok := s.(interface {\n        UseClientAuthorization() bool\n        GetAuthTokenHeaderName() string\n    })\n    return ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"looker-get-projects must bind to a kind: looker source: %w\", err)\n}","preventionTips":["Map each looker-* tool to the same Looker source in your config template.","Run `toolbox --help`-driven smoke boot in CI with production tools.yaml.","Avoid generic source names like 'api' or 'db' that invite misbinding."],"tags":["go","looker","config","source-binding"],"backgroundTag":"incompatible-source-type","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"}