{"record":{"id":"86e031f592673bc5","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-86e031","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/bigtablelistinstances/bigtablelistinstances.go","lineNumber":92,"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\tinstances, err := source.ListInstances(ctx)\n\tif err != nil {\n\t\treturn nil, util.ProcessGcpError(err)\n\t}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigtable/bigtablelistinstances/bigtablelistinstances.go#L74-L110","documentation":"The bigtable-list-instances tool's ValidateSource returns this error when the provided sources.Source does not satisfy its compatibleSource interface (the Bigtable source that can list instances). The assertion fails for any source type other than the Bigtable source or a build where its method set changed. It is raised before any Bigtable admin API call is attempted.","triggerScenarios":"ValidateSource is invoked, or the tool is executed through the server, with a non-Bigtable source (e.g. postgres, alloydb, bigquery) or an incompatible custom source.","commonSituations":"Wrong source referenced in the tool's tools.yaml entry; source kind edited by mistake; version mismatch after a toolbox upgrade altered the internal source interface.","solutions":["Set the tool's source to a bigtable-kind source in tools.yaml","Verify the source implements the expected ListInstances capability","Align toolbox and source versions and rebuild","Validate configuration at startup to surface mismatches immediately"],"exampleFix":"// before\nsource: bigquery-warehouse\n// after\nsource: bigtable-instance-source","handlingStrategy":"validation","validationCode":"if err := tool.ValidateSource(mySource); err != nil {\n    return fmt.Errorf(\"bigtable-list-instances needs a bigtable source: %w\", err)\n}","typeGuard":"func isBigtableInstanceSource(s sources.Source) bool {\n    _, ok := s.(interface{ ListInstances(context.Context) (any, error) })\n    return ok\n}","tryCatchPattern":"if err := tool.ValidateSource(src); err != nil {\n    log.Fatalf(\"wrong source for bigtable-list-instances: %v\", err)\n}","preventionTips":["Check that tools.yaml tool entries reference bigtable sources","Validate config at startup before accepting requests","Avoid hand-editing kind: fields in shared configs","Pin the toolbox version used across environments"],"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"}