{"record":{"id":"d2077294aae43f45","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-d20772","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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/looker/lookerupdatedashboardelement/lookerupdatedashboardelement.go","lineNumber":132,"sourceCode":"\tvisType  string = \"vis\"\n)\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) 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\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\tlogger.DebugContext(ctx, \"params = \", params)\n\n\twq, err := lookercommon.ProcessQueryArgs(ctx, params)\n\tif err != nil {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerupdatedashboardelement/lookerupdatedashboardelement.go#L114-L150","documentation":"ValidateSource for looker-update-dashboard-element asserts the bound source implements compatibleSource. Failure means the tool is attached to a non-Looker source; since all Invoke paths call Looker SDK methods through that interface, the tool rejects the binding with this error.","triggerScenarios":"Invoked during startup validation of tool-source pairs, or immediately before Invoke; triggers when `source:` in the tool config names a source that is not a Looker source.","commonSituations":"Misconfigured source reference; source renamed so a wrong/placeholder source resolves; programmatic wiring with an incompatible sources.Source implementation.","solutions":["Set the tool's `source` to your Looker source name","Confirm the source's kind is looker in the sources section of the config","Check startup logs that the Looker source initialized before tool validation"],"exampleFix":"// before\nsource: my-looker-look (typo, resolves to another source)\n// after\nsource: my-looker-source","handlingStrategy":"type-guard","validationCode":"if _, ok := src.(looker.Source); !ok {\n    return fmt.Errorf(\"expected looker source, got %T\", src)\n}","typeGuard":"func isLookerSource(s sources.Source) bool {\n    _, ok := s.(looker.Source)\n    return ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    if strings.Contains(err.Error(), \"not a compatible type\") {\n        // correct the tool->source mapping and revalidate\n    }\n    return err\n}","preventionTips":["Cross-check `source:` names against the sources: section of the config","Validate all tool/source bindings at startup with ValidateSource","Use exact-match source names to avoid typo resolutions"],"tags":["go","looker","type-assertion","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"}