{"record":{"id":"5bf8e7ddbf980cef","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-5bf8e7","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/bigtablegetinstance/bigtablegetinstance.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.GetInstance(ctx, paramsMap[\"instance_id\"].(string))\n\tif err != nil {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigtable/bigtablegetinstance/bigtablegetinstance.go#L76-L112","documentation":"This error is returned by the bigtable-get-instance tool's ValidateSource when the sources.Source handed to it does not implement the tool's private compatibleSource interface (here, a type exposing GetInstance(context.Context, string) (any, error)). MCP Toolbox only wires a tool to a source at runtime, so any source whose concrete type lacks the required Bigtable method fails the type assertion. It is a configuration/wiring mismatch, not a Bigtable API failure.","triggerScenarios":"Calling ValidateSource (or invoking the tool through the server) with a source whose concrete type is not the Bigtable source, e.g. a postgres, mysql, or bigquery source, or a Bigtable source from an incompatible version that lacks the GetInstance method.","commonSituations":"A tools.yaml binds bigtable-get-instance to a source of the wrong kind (copy-pasted config, wrong 'kind:' field); a custom source implementation is passed programmatically without the GetInstance method; or the toolbox version was upgraded and the source/tool interfaces drifted.","solutions":["Point the tool's source in tools.yaml at a source declared with kind: bigtable","Verify the source implements GetInstance(context.Context, string) (any, error) (custom sources) and matches the toolbox version","Rebuild/regenerate the config so the tool and source versions align","Run the toolbox with --prebuilt or validate the config at startup to catch mismatches before serving"],"exampleFix":"// before (tools.yaml)\ntools:\n  get-instance:\n    kind: bigtable-get-instance\n    source: my-postgres-source\n// after\ntools:\n  get-instance:\n    kind: bigtable-get-instance\n    source: my-bigtable-source","handlingStrategy":"validation","validationCode":"if err := tool.ValidateSource(mySource); err != nil {\n    return fmt.Errorf(\"bigtable-get-instance needs a bigtable source: %w\", err)\n}","typeGuard":"func isBigtableSource(s sources.Source) bool {\n    _, ok := s.(interface{ GetInstance(context.Context, string) (any, error) })\n    return ok\n}","tryCatchPattern":"source, err := loadSource(cfg.SourceName)\nif err := tool.ValidateSource(source); err != nil {\n    log.Fatalf(\"incompatible source for bigtable-get-instance: %v\", err)\n}","preventionTips":["Keep each bigtable-* tool bound to a source with kind: bigtable in tools.yaml","Run the server once with config validation enabled before deploying","Diff source fields after copy-pasting tool blocks between engines","Pin toolbox versions so tool/source interfaces stay in sync"],"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"}