{"record":{"id":"9ee8a44001170c79","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-9ee8a4","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/bigtablelistclusters/bigtablelistclusters.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.ListClusters(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/bigtablelistclusters/bigtablelistclusters.go#L76-L112","documentation":"bigtable-list-clusters' ValidateSource emits this error when the passed source cannot be asserted to compatibleSource (which requires ListClusters(context.Context) (any, error) semantics on the Bigtable source type). Because sources are resolved by name at runtime, any non-Bigtable source bound to this admin tool fails. This is purely a compatibility check ahead of the actual instance-admin call.","triggerScenarios":"Invoking the list-clusters tool, or calling ValidateSource directly, with a source of a different engine kind or a Bigtable source lacking the ListClusters method in the current version.","commonSituations":"tools.yaml maps the tool to a SQL source; a source was renamed/re-pointed during refactoring; a custom source implementation is missing the admin method set.","solutions":["Bind bigtable-list-clusters to a source declared with kind: bigtable","Confirm the source implements the tool's compatibleSource method set","Rebuild config and restart so tool/source registration matches","Add an automated config-lint step in CI that checks tool-source kinds"],"exampleFix":"// before\nkind: bigtable-list-clusters\nsource: spanner-src\n// after\nkind: bigtable-list-clusters\nsource: bigtable-src","handlingStrategy":"validation","validationCode":"if err := tool.ValidateSource(src); err != nil {\n    return fmt.Errorf(\"bigtable-list-clusters requires a bigtable source: %w\", err)\n}","typeGuard":"func isBigtableAdminSource(s sources.Source) bool {\n    _, ok := s.(interface{ ListClusters(context.Context) (any, error) })\n    return ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    log.Fatalf(\"incompatible source for bigtable-list-clusters: %v\", err)\n}","preventionTips":["Use kind: bigtable sources for instance-admin tools","Add automated tool-source compatibility checks in CI","Keep environments' configs in sync with a single template","Re-validate bindings after each toolbox release"],"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"}