{"record":{"id":"b353b6281fe2050f","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-b353b6","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/firebird/firebirdsql/firebirdsql.go","lineNumber":107,"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\tstatement, 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":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firebird/firebirdsql/firebirdsql.go#L89-L125","documentation":"Tool.ValidateSource for the Firebird SQL tool fails when the provided source does not implement its compatibleSource interface (not a Firebird source). The message echoes the tool type and configured source name for diagnosis.","triggerScenarios":"Config wires a firebird-sql tool to a source of a different kind (e.g., alloydbpg, mssql); or the named source resolved to an incompatible implementation at runtime.","commonSituations":"Shared/copied tool configs pointing at the wrong source; renaming sources and leaving stale references; mixing prebuilt configs with custom sources of other kinds.","solutions":["Point the tool's 'source' at a source declared with kind: firebird.","Confirm the sources map entry name and kind match what the tool expects.","Run toolbox with the corrected config and verify tool loading succeeds."],"exampleFix":"// before\nsource: cloudsql-pg\n// after\nsource: firebird-db","handlingStrategy":"validation","validationCode":"# Ensure kind compatibility\nassert cfg['sources'][tool['source']]['kind'] == 'firebird', \"firebird-sql needs a firebird source\"","typeGuard":null,"tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"rebind source: %w\", err)\n}","preventionTips":["Map each tool to a source of the matching engine kind.","Use consistent source naming conventions.","Validate the full config before serving.","Update stale source references after renames."],"tags":["firebird","config","source-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"}