{"record":{"id":"3a65ab87edf162bc","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-3a65ab","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/mindsdb/mindsdbsql/mindsdbsql.go","lineNumber":104,"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\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 {\n\t\treturn nil, util.NewAgentError(\"unable to extract standard params\", err)","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/mindsdb/mindsdbsql/mindsdbsql.go#L86-L122","documentation":"Tool.ValidateSource for mindsdb-sql rejects any source that does not implement the MindsDB compatibleSource interface. The tool cannot obtain a DB connection from an incompatible source, so the mismatch is surfaced as this error during tool/source validation.","triggerScenarios":"Attaching a mindsdb-sql tool to a non-MindsDB source in tools.yaml; server startup calls ValidateSource for each tool/source pair.","commonSituations":"Wrong source reference in the tool config; source swapped to a different database kind; duplicated tool blocks where one kept an old source name.","solutions":["Set the tool's `source` to a source of kind `mindsdb`","Cross-check `sources:` names against the tool's `source` field","Run a local toolbox start to validate every binding"],"exampleFix":"// before\nsource: my-bigquery\n// after\nsource: my-mindsdb","handlingStrategy":"validation","validationCode":"if err := mindsdbSQLTool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"mindsdb-sql %q: %w\", name, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only attach mindsdb-sql to MindsDB sources","Validate tool/source pairs at load time","Review diffs of tools.yaml for source field changes"],"tags":["go","mindsdb","source-binding","type-mismatch"],"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"}