{"record":{"id":"047541a28a08c40d","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool","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/bigtabledeletematerializedview/bigtabledeletematerializedview.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.DeleteMaterializedView(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/bigtabledeletematerializedview/bigtabledeletematerializedview.go#L77-L113","documentation":"ValidateSource for the bigtable-delete-materialized-view tool asserts that the provided source implements its compatibleSource (Bigtable source) interface. On failure it returns the generic 'source is not compatible with the tool' error, meaning the tool was handed a source it cannot operate on.","triggerScenarios":"ValidateSource called with a non-Bigtable sources.Source — e.g. the tool bound to a Postgres/BigQuery source in the config.","commonSituations":"Wrong source kind under the tool in tools.yaml; a wrapper type around Bigtable that doesn't implement the interface; tests passing another source implementation.","solutions":["Set the tool's source to a bigtable-kind source.","Implement the compatibleSource interface on any custom Bigtable wrapper.","Verify the referenced source name exists and is the intended Bigtable source.","Restart the server after fixing the config."],"exampleFix":"// before\ntools:\n  delete-mv:\n    kind: bigtable-delete-materialized-view\n    source: my-postgres-source\n// after\ntools:\n  delete-mv:\n    kind: bigtable-delete-materialized-view\n    source: my-bigtable-source","handlingStrategy":"type-guard","validationCode":"func isBigtableSource(s sources.Source) bool {\n    _, ok := s.(interface{ BigtableClient() *bigtable.Client }); return ok\n}\n// then tool.ValidateSource(src)","typeGuard":"func asBigtable(s sources.Source) (compatibleSource, bool) { c, ok := s.(compatibleSource); return c, ok }","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"bigtable tool requires a bigtable source: %w\", err)\n}","preventionTips":["Match bigtable tools to kind: bigtable sources in tools.yaml.","Run ValidateSource during wiring to fail fast.","Avoid generic wrappers that drop the Bigtable interface methods.","Add per-tool binding smoke tests."],"tags":["go","bigtable","type-assertion","configuration"],"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"}