{"record":{"id":"d8e1c79a94508595","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-d8e1c7","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/bigtabledeletetable/bigtabledeletetable.go","lineNumber":94,"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.DeleteTable(ctx, paramsMap[\"table_id\"].(string))\n\tif err != nil {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigtable/bigtabledeletetable/bigtabledeletetable.go#L76-L112","documentation":"ValidateSource for the bigtable-delete-table tool returns this error when the passed sources.Source does not implement its compatibleSource (Bigtable) interface. The check exists so the tool fails fast at wiring time instead of misbehaving against a foreign source.","triggerScenarios":"ValidateSource invoked with a source that is not a Bigtable source — typically a tool bound to the wrong source kind in the YAML config or programmatically.","commonSituations":"Config typos binding delete-table to another database's source; refactors replacing the Bigtable source type; integration tests reusing sources of the wrong kind.","solutions":["Bind the tool to a source of kind bigtable.","Make wrapper types implement the expected interface methods.","Double-check the source name in the tool definition.","Rebuild/restart the toolbox to load corrected config."],"exampleFix":"// before\ntools:\n  delete-table:\n    kind: bigtable-delete-table\n    source: my-bigquery-source\n// after\ntools:\n  delete-table:\n    kind: bigtable-delete-table\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(\"wrong source for bigtable-delete-table: %w\", err)\n}","preventionTips":["Double-check source references when copy-pasting tool blocks in tools.yaml.","Call ValidateSource at config-load time.","Keep custom Bigtable sources implementing the full compatibleSource interface.","Test bindings against real Bigtable sources."],"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"}