{"record":{"id":"b28d1ee19314645c","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-b28d1e","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/bigtableupdatecluster/bigtableupdatecluster.go","lineNumber":96,"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.UpdateCluster(ctx, paramsMap[\"instance_id\"].(string), paramsMap[\"cluster_id\"].(string), int32(paramsMap[\"serve_nodes\"].(int)))\n\tif err != nil {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigtable/bigtableupdatecluster/bigtableupdatecluster.go#L78-L114","documentation":"Thrown by the bigtableupdatecluster Tool.ValidateSource when the supplied sources.Source does not implement the tool's compatibleSource interface. The tool refuses to run against a source it cannot use, before any Bigtable API call is made.","triggerScenarios":"Invoke/ValidateSource receives a source whose concrete type fails the type assertion to bigtableupdatecluster's compatibleSource — i.e. the tool is wired to a source that is not a compatible Bigtable source in tools.yaml.","commonSituations":"Pointing the bigtable-update-cluster tool at a non-Bigtable source; reusing a tool config template across sources of different kinds; renaming or replacing a source and missing the tool reference.","solutions":["Set the tool's source field to a compatible bigtable source in tools.yaml","Confirm the referenced source initializes successfully as a Bigtable source","Restart the toolbox to reload the corrected configuration","If invoking programmatically, pass the correct concrete Source type satisfying compatibleSource"],"exampleFix":"// before (tools.yaml)\ntools:\n  update-cluster:\n    kind: bigtable-update-cluster\n    source: my-postgres-db\n// after\ntools:\n  update-cluster:\n    kind: bigtable-update-cluster\n    source: my-bigtable-instance","handlingStrategy":"type-guard","validationCode":"// Assert source-tool compatibility before invoking\nif err := tool.ValidateSource(mySource); err != nil {\n    return fmt.Errorf(\"cannot attach source %s to bigtable-update-cluster: %w\", sourceName, err)\n}","typeGuard":"func isCompatibleUpdateClusterSource(s sources.Source) bool {\n    _, ok := s.(bigtableupdatecluster.CompatibleSource)\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Use Bigtable sources for bigtable-update-* tools","Run config validation before deploying the toolbox","Audit tools.yaml after every source rename or deletion","Keep one source per kind and reference them explicitly"],"tags":["go","config","type-mismatch","bigtable"],"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"}