{"record":{"id":"5d7d71c451511007","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-5d7d71","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/falkordb/falkordbcypher/falkordbcypher.go","lineNumber":100,"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\n\tparamsMap := params.AsMap()\n\tresp, err := source.RunQuery(ctx, \"\", t.Cfg.Statement, paramsMap, false, false)\n\tif err != nil {\n\t\treturn nil, util.ProcessGeneralError(err)\n\t}\n\treturn resp, nil\n}\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/falkordb/falkordbcypher/falkordbcypher.go#L82-L118","documentation":"ValidateSource for the falkordb-cypher tool asserts the bound source implements the tool's private `compatibleSource` interface (a FalkorDB source). Any other source kind fails the assertion, so the tool reports the source is not a compatible type and will not serve Cypher execution against it.","triggerScenarios":"A `falkordb-cypher` tool bound via its `source` field to a source defined with a non-FalkorDB kind (Postgres, MySQL, Elasticsearch, etc.).","commonSituations":"Reusing a shared tools.yaml where the source name collides with another engine's source; switching graph backends without updating tool source bindings; typos in the source name resolving to the wrong entry.","solutions":["Point the tool's `source` at a source with kind `falkordb`","Verify the sources section: the referenced source must be the FalkorDB one","Remove or rename duplicate source names to avoid ambiguity","Rebuild/restart the toolbox and re-check tool loading"],"exampleFix":"// before (tools.yaml)\ntools:\n  cypher:\n    kind: falkordb-cypher\n    source: postgres-src\n// after\ntools:\n  cypher:\n    kind: falkordb-cypher\n    source: falkordb-src","handlingStrategy":"validation","validationCode":"// falkordb-cypher requires a falkordb source:\nif src.Kind != \"falkordb\" {\n    return fmt.Errorf(\"tool %s needs kind=falkordb, got %s\", toolName, src.Kind)\n}","typeGuard":"if _, ok := src.(falkordbcypher.CompatibleSource); !ok {\n    return fmt.Errorf(\"source %T is not a FalkorDB source\", src)\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    log.Fatalf(\"rebind %s to the falkordb source: %v\", toolName, err)\n}","preventionTips":["Verify the `source:` line of every graph tool points at the falkordb source","Keep graph and relational sources in clearly separated config sections","Test tool loading after any source rename or backend migration","Use unique, engine-prefixed source names in shared configs"],"tags":["go","configuration","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"}