{"record":{"id":"58fe664222e23088","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-58fe66","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/snowflake/snowflakesql/snowflakesql.go","lineNumber":106,"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) 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":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/snowflake/snowflakesql/snowflakesql.go#L88-L124","documentation":"Tool.ValidateSource in the snowflake-sql tool asserts that the configured source implements the tool's compatibleSource interface. When the source registered under the tool's `source` name is of a different concrete type, the assertion fails and this error is returned during config validation.","triggerScenarios":"ValidateSource is invoked (at toolbox startup or via the tools API) with a sources.Source that does not satisfy compatibleSource — e.g. wiring snowflake-sql to a cloud-sql-postgres source.","commonSituations":"Mismatched `source:` reference in tools.yaml; renamed sources causing a tool to bind to a leftover source of another engine; building tools programmatically with the wrong Source instance.","solutions":["Point the snowflake-sql tool's `source:` field at a source of kind snowflake.","Cross-check every tool's source reference against the `sources:` section of your config; each snowflake tool must reference a snowflake-kind source.","If registering sources in code, pass the concrete snowflake source (which implements SpannerClient/RunSQL-equivalent methods) to the tool."],"exampleFix":"// before (tools.yaml)\ntools:\n  my-sql:\n    kind: snowflake-sql\n    source: bigquery-src\n// after\ntools:\n  my-sql:\n    kind: snowflake-sql\n    source: snowflake-src","handlingStrategy":"type-guard","validationCode":"if _, ok := src.(compatibleSource); !ok {\n\treturn fmt.Errorf(\"source %q does not implement compatibleSource\", srcName)\n}","typeGuard":"cs, ok := source.(compatibleSource)\nif !ok {\n\treturn nil, fmt.Errorf(\"snowflake-sql requires a snowflake-compatible source\")\n}","tryCatchPattern":null,"preventionTips":["Match each snowflake tool to a snowflake-kind source in the same config.","Run startup validation in CI before deployment.","Avoid reusing a single tool definition across projects with different source layouts."],"tags":["go","snowflake","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"}