{"record":{"id":"7cee13df94407714","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-7cee13","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/bigtableupdateinstance/bigtableupdateinstance.go","lineNumber":95,"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.UpdateInstance(ctx, paramsMap[\"instance_id\"].(string), paramsMap[\"display_name\"].(string))\n\tif err != nil {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigtable/bigtableupdateinstance/bigtableupdateinstance.go#L77-L113","documentation":"Thrown by the bigtableupdateinstance Tool.ValidateSource when the provided sources.Source does not implement the tool's compatibleSource interface. It prevents the instance-update tool from operating on an incompatible source before any mutation occurs.","triggerScenarios":"ValidateSource/Invoke is called with a source failing the type assertion to the bigtableupdateinstance compatibleSource interface — typically a tools.yaml source reference of the wrong kind.","commonSituations":"Wiring bigtable-update-instance to a source of another database kind; copy-paste tool templates; config refactor that swapped source names.","solutions":["Point the tool's source field at a compatible bigtable source","Verify the source name matches an initialized Bigtable source","Restart the toolbox to apply the corrected config","Pass the correct concrete Source type when invoking programmatically"],"exampleFix":"// before (tools.yaml)\ntools:\n  update-instance:\n    kind: bigtable-update-instance\n    source: my-mysql-db\n// after\ntools:\n  update-instance:\n    kind: bigtable-update-instance\n    source: my-bigtable-instance","handlingStrategy":"type-guard","validationCode":"// Verify compatibility before invoking the instance-update tool\nif err := tool.ValidateSource(mySource); err != nil {\n    return fmt.Errorf(\"source %s cannot back bigtable-update-instance\", sourceName)\n}","typeGuard":"func isCompatibleUpdateInstanceSource(s sources.Source) bool {\n    _, ok := s.(bigtableupdateinstance.CompatibleSource)\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Ensure bigtable-update-instance references a bigtable source kind","Add startup config validation to catch mismatched source kinds early","Review tool source references after config refactors","Test tool initialization locally before merging config changes"],"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"}