{"record":{"id":"88c6a3d1ea008760","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-88c6a3","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/falkordblistgraphs/falkordblistgraphs.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\tgraphs, err := source.FalkorDBClient().ListGraphs()\n\tif err != nil {\n\t\treturn nil, util.ProcessGeneralError(err)\n\t}\n\treturn map[string]any{\"graphs\": graphs}, nil\n}\n","sourceCodeStart":82,"sourceCodeEnd":117,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/falkordb/falkordblistgraphs/falkordblistgraphs.go#L82-L117","documentation":"ValidateSource for falkordb-listgraphs asserts the provided sources.Source implements `compatibleSource` (FalkorDB). A source of another type fails the assertion and the tool returns this error, refusing to list graphs from an incompatible backend.","triggerScenarios":"Binding a `falkordb-listgraphs` tool to a source entry whose kind is not `falkordb` in tools.yaml.","commonSituations":"Multi-source configs where the listgraphs tool was copied from another engine's section; environment-specific overrides swapping the source to a different database; typo'd source names falling through to a similarly named source.","solutions":["Set the tool's `source` to the FalkorDB source defined in the same file","Cross-check every tool's source reference against the sources map","Use distinct source names per engine to prevent accidental rebinding","Restart the toolbox and verify the tool validates cleanly"],"exampleFix":"// before (tools.yaml)\ntools:\n  list-graphs:\n    kind: falkordb-listgraphs\n    source: redis-src\n// after\ntools:\n  list-graphs:\n    kind: falkordb-listgraphs\n    source: falkordb-src","handlingStrategy":"validation","validationCode":"if src.Kind != \"falkordb\" {\n    return fmt.Errorf(\"listgraphs tool requires falkordb source, got kind=%s\", src.Kind)\n}","typeGuard":"if _, ok := src.(falkordblistgraphs.CompatibleSource); !ok {\n    return fmt.Errorf(\"%T is not usable by falkordb-listgraphs\", src)\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"rebind %s to falkordb source: %w\", toolName, err)\n}","preventionTips":["Keep one FalkorDB source and reference it consistently across falkordb-* tools","Watch for env-specific config overrides silently swapping the source","Diff source names between environments when promoting configs","Run startup validation after every config change"],"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"}