{"record":{"id":"43bdfb9d03f554eb","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-43bdfb","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/lookerconversationalanalytics/lookerconversationalanalytics.go","lineNumber":195,"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\n// parseExploreReferences converts the raw explore_references parameter into typed\n// references. The parameter is declared as an array of free-form maps, so the values\n// the model supplies are not schema-validated; guard every field access instead of\n// letting an unexpected shape (a missing key, a non-string value, or a non-object\n// element) panic the tool. Mirrors the validation in datalineagesearchlineage.\nfunc parseExploreReferences(raw []any, lookerInstanceURI string) ([]LookerExploreReference, util.ToolboxError) {\n\trefs := make([]LookerExploreReference, 0, len(raw))\n\tfor i, er := range raw {\n\t\tm, ok := er.(map[string]any)\n\t\tif !ok {\n\t\t\treturn nil, util.NewAgentError(fmt.Sprintf(\"invalid explore reference at index %d in 'explore_references': expected object, got %T\", i, er), nil)\n\t\t}\n\t\tmodel, ok := m[\"model\"].(string)\n\t\tif !ok {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerconversationalanalytics/lookerconversationalanalytics.go#L177-L213","documentation":"Tool.ValidateSource asserts that the attached source implements the compatibleSource interface (the Looker source). If the source configured for this conversational-analytics tool is any other type, the tool cannot use it and returns this error naming the configured type and source name.","triggerScenarios":"Binding a looker-conversational-analytics tool to a non-Looker source (e.g. a postgres or http source) in the toolbox config, or referencing a source name that resolves to an incompatible source.","commonSituations":"Copy-pasting a tool block across configs and leaving the wrong source name; typos in source names resolving to the wrong source; combining tools from different integrations in one config.","solutions":["Point the tool's source at a Looker source (kind: looker) defined in the same config","Fix typos in the source reference so it resolves to the Looker source","Verify the referenced source initializes successfully as a *looker.Source","Move the tool under a config section where only Looker sources are defined"],"exampleFix":"// before\nsources:\n  db:\n    kind: postgres\n    ...\ntools:\n  ask:\n    kind: looker-conversational-analytics\n    source: db\n// after\nsources:\n  looker:\n    kind: looker\n    ...\ntools:\n  ask:\n    kind: looker-conversational-analytics\n    source: looker","handlingStrategy":"validation","validationCode":"// at startup, after building tools\nfor _, t := range tools {\n\tif err := t.ValidateSource(sources[t.Source()]); err != nil {\n\t\tlog.Fatalf(\"invalid tool/source binding: %v\", err)\n\t}\n}","typeGuard":"if _, ok := src.(lookercompatibleSourcesCompatible); !ok { /* not a looker source */ }","tryCatchPattern":null,"preventionTips":["Only pair looker-conversational-analytics tools with kind: looker sources","Cross-check tool kind vs source kind in CI config linting","Avoid renaming sources without updating tool references"],"tags":["looker","config","source-validation"],"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"}