{"record":{"id":"3818e2baa6f7a98e","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-3818e2","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/falkordbexecutecypher/falkordbexecutecypher.go","lineNumber":120,"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\tcypherStr, ok := paramsMap[\"cypher\"].(string)\n\tif !ok {\n\t\treturn nil, util.NewAgentError(fmt.Sprintf(\"unable to cast cypher parameter %s\", paramsMap[\"cypher\"]), nil)\n\t}\n\n\tif cypherStr == \"\" {\n\t\treturn nil, util.NewAgentError(\"parameter 'cypher' must be a non-empty string\", nil)","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/falkordb/falkordbexecutecypher/falkordbexecutecypher.go#L102-L138","documentation":"ValidateSource for falkordb-execute-cypher performs a type assertion of the injected source to `compatibleSource`; only FalkorDB sources satisfy it. When the bound source is a different implementation, the tool returns this error instead of attempting to run Cypher against an unsupported backend.","triggerScenarios":"A `falkordb-execute-cypher` tool whose `source` field references a non-FalkorDB source in tools.yaml or via the programmatic sources map.","commonSituations":"Composing configs from multiple teams where source names overlap; migrating from another graph DB (e.g. Neo4j) and reusing the old source binding; copying prebuilt config fragments without adjusting source names.","solutions":["Rebind the tool to a `falkordb`-kind source","Audit all tools in the file for source references after any source rename","If a compatible wrapper source is intended, use the correct source kind that implements the FalkorDB interface","Restart the server so ValidateSource runs against the corrected config"],"exampleFix":"// before (tools.yaml)\ntools:\n  exec-cypher:\n    kind: falkordb-execute-cypher\n    source: neo4j-src\n// after\ntools:\n  exec-cypher:\n    kind: falkordb-execute-cypher\n    source: falkordb-src","handlingStrategy":"validation","validationCode":"// falkordb-execute-cypher requires kind == \"falkordb\"\nif tool.SourceKind != \"falkordb\" {\n    return fmt.Errorf(\"execute-cypher tool bound to %q source; expected falkordb\", tool.SourceName)\n}","typeGuard":"if fdbSrc, ok := src.(falkordbexecutecypher.CompatibleSource); ok {\n    _ = fdbSrc\n} else {\n    return fmt.Errorf(\"source %T incompatible with falkordb-execute-cypher\", src)\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"config error: %s must reference the falkordb source: %w\", toolName, err)\n}","preventionTips":["Audit source bindings when migrating between graph databases","Validate the full tools.yaml at CI time by starting the toolbox once","Avoid copy-pasting tool blocks from other engines without updating `source`","Keep a single canonical FalkorDB source definition per environment"],"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"}