{"record":{"id":"91347b30e21ae161","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-91347b","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/scylladb/scyllacql/scyllacql.go","lineNumber":102,"sourceCode":"\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// Invoke implements tools.Tool.\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\tparamsMap := params.AsMap()\n\tnewStatement, err := parameters.ResolveTemplateParams(t.Cfg.TemplateParameters, t.Cfg.Statement, paramsMap)\n\tif err != nil {\n\t\treturn nil, util.NewAgentError(\"unable to extract template params\", err)\n\t}\n\n\tnewParams, err := parameters.GetParams(t.Cfg.Parameters, paramsMap)\n\tif err != nil {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/scylladb/scyllacql/scyllacql.go#L84-L120","documentation":"ValidateSource checks that the source wired to the scylla-cql tool implements the compatibleSource interface (i.e. is a ScyllaDB/ScyllaDB-compatible source exposing a CQL session). If the configured source is of a different type (e.g. a Postgres source), initialization fails with this error. It is a startup-time type-compatibility guard, not a runtime query failure.","triggerScenarios":"At toolbox startup, a tool config maps tool 'type: scylla-cql' to a source whose Go type does not implement compatibleSource — for example pointing the tool at a postgres, mysql, or cloud-sql source instead of a scylladb source.","commonSituations":"Copy-pasting a prebuilt config and forgetting to change the source reference; renaming sources so the tool binds to the wrong source entry; mixing source kinds in one YAML file.","solutions":["Open the tools config YAML and confirm the tool's 'source:' field references a source whose 'kind' is scylladb","Fix the source reference so the scylla-cql tool points at a ScyllaDB source","Restart the server and confirm initialization succeeds"],"exampleFix":"# before\nsources:\n  db:\n    kind: postgres\n    uri: ...\ntools:\n  do-cql:\n    source: db\n# after\nsources:\n  db:\n    kind: scylladb\n    addresses: [...]\ntools:\n  do-cql:\n    source: db","handlingStrategy":"type-guard","validationCode":"// Go caller can pre-verify the source implements the compatible interface\nif _, ok := src.(scyllacql.CompatibleSource); !ok {\n    return fmt.Errorf(\"source %T cannot back a scylla-cql tool\", src)\n}\nerr := tool.ValidateSource(src)","typeGuard":"func isCompatibleScyllaSource(s sources.Source) bool {\n    _, ok := s.(scyllacql.CompatibleSource)\n    return ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    log.Fatalf(\"bind failed, check 'source:' kind in YAML: %v\", err)\n}","preventionTips":["Keep tool 'source:' references pointing at sources with matching 'kind'","Name sources descriptively (e.g. scylla-prod) to avoid cross-kind references","Review tool/source bindings after any YAML refactor or rename"],"tags":["config","type-mismatch","scylladb","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"}