{"record":{"id":"6da7f7486952c078","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-6da7f7","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/oracle/oraclesql/oraclesql.go","lineNumber":95,"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":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/oracle/oraclesql/oraclesql.go#L77-L113","documentation":"The oracle-sql tool's ValidateSource requires the bound source to implement its compatibleSource interface (an Oracle database source). Binding any other source type triggers this error naming the tool type and source name, preventing SQL execution against a non-Oracle backend.","triggerScenarios":"A oracle-sql tool in tools.yaml referencing a non-Oracle source (postgres, mysql, mssql, etc.); runtime call with a mismatched sources.Source implementation.","commonSituations":"Copy-pasting tool definitions and forgetting to update the source; renaming/re-kinding a source without updating tools; name typos that silently resolve to another source.","solutions":["Set the tool's source to an Oracle-based source kind (oracle).","Verify the referenced source exists and its kind is oracle.","Programmatic composition: pass the Oracle source instance to the tool."],"exampleFix":"# before\n  run-sql:\n    kind: oracle-sql\n    source: my-postgres\n# after\n  run-sql:\n    kind: oracle-sql\n    source: my-oracle","handlingStrategy":"type-guard","validationCode":"if err := tool.ValidateSource(src); err != nil { /* rebind source in tools.yaml */ }","typeGuard":"func isOracleSource(s sources.Source) bool {\n    type oracleSrc interface{ SourceType() string }\n    if o, ok := s.(oracleSrc); ok { return o.SourceType() == \"oracle\" }\n    return false\n}","tryCatchPattern":"if err := t.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"oracle-sql requires an Oracle source: %w\", err)\n}","preventionTips":["Bind oracle-sql tools only to sources of kind oracle.","After editing sources, re-run config validation before deploying.","Use distinct source names per engine to prevent accidental cross-wiring."],"tags":["go","oracle","source-compatibility","tool-configuration"],"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"}