{"record":{"id":"7e26381141966b34","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-7e2638","errorCode":null,"errorMessage":"source is not compatible with the tool","messagePattern":"source is not compatible with the tool","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/bigtable/bigtablegetmaterializedview/bigtablegetmaterializedview.go","lineNumber":95,"sourceCode":"\t\t\tallParameters,\n\t\t),\n\t}, nil\n}\n\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) ValidateSource(src sources.Source) error {\n\t_, ok := src.(compatibleSource)\n\tif !ok {\n\t\treturn fmt.Errorf(\"source is not compatible with the tool\")\n\t}\n\treturn nil\n}\n\nfunc (t Tool) ToConfig() tools.ToolConfig {\n\treturn t.Cfg\n}\n\nfunc (t Tool) Invoke(ctx context.Context, src sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {\n\tsource, ok := src.(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\n\tres, err := source.GetMaterializedView(ctx, paramsMap[\"instance_id\"].(string), paramsMap[\"materialized_view_id\"].(string))\n\tif err != nil {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigtable/bigtablegetmaterializedview/bigtablegetmaterializedview.go#L77-L113","documentation":"bigtable-get-materialized-view's ValidateSource throws this when the provided source fails the type assertion against its compatibleSource interface (a GetMaterializedView(context.Context, string) (any, error) provider). The check exists because the tool depends on Bigtable-admin-specific functionality that only the Bigtable source implements. Any other source kind, or a stale source implementation, triggers it.","triggerScenarios":"Calling ValidateSource or invoking the tool with a source that is not the Bigtable source, e.g. a SQL database source, or a Bigtable source build lacking the GetMaterializedView method.","commonSituations":"Miswired tools.yaml (tool referencing another engine's source); copy-paste of tool blocks without updating the source field; upgrading toolbox so a custom source no longer satisfies the interface.","solutions":["Set the tool's source field to a bigtable-kind source","Ensure the source implements GetMaterializedView(context.Context, string) (any, error)","Sync toolbox and source versions; rebuild the binary","Validate the merged config at startup before serving requests"],"exampleFix":"// before\ntools:\n  get-mv:\n    kind: bigtable-get-materialized-view\n    source: postgres-prod\n// after\ntools:\n  get-mv:\n    kind: bigtable-get-materialized-view\n    source: bigtable-prod","handlingStrategy":"validation","validationCode":"if err := tool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"bigtable-get-materialized-view requires a bigtable source: %w\", err)\n}","typeGuard":"func isBigtableMVSource(s sources.Source) bool {\n    _, ok := s.(interface{ GetMaterializedView(context.Context, string) (any, error) })\n    return ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    log.Fatalf(\"incompatible source for bigtable-get-materialized-view: %v\", err)\n}","preventionTips":["Only pair bigtable admin tools with kind: bigtable sources","Add a CI lint that checks tool kind vs source kind","Keep custom sources' method sets aligned with the toolbox version","Test tool registration locally before deploying"],"tags":["go","bigtable","source-compatibility","configuration"],"backgroundTag":"source-not-compatible-with-tool","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"}