{"record":{"id":"ab2c60e868141481","repo":"googleapis/mcp-toolbox","slug":"source-is-not-compatible-with-the-tool-ab2c60","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/bigtableupdatematerializedview/bigtableupdatematerializedview.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.UpdateMaterializedView(ctx, paramsMap[\"instance_id\"].(string), paramsMap[\"materialized_view_id\"].(string), paramsMap[\"query\"].(string))\n\tif err != nil {","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/bigtable/bigtableupdatematerializedview/bigtableupdatematerializedview.go#L78-L114","documentation":"Thrown by the bigtableupdatematerializedview Tool.ValidateSource when the provided sources.Source does not implement the tool's compatibleSource interface. The materialized-view update is blocked before any Bigtable mutation.","triggerScenarios":"ValidateSource/Invoke is called with a source failing the type assertion to the tool's compatibleSource interface — e.g. the tool's source key references a source of the wrong kind in tools.yaml.","commonSituations":"Attaching bigtable-update-materialized-view to a non-Bigtable source; template reuse across sources; stale source names after a config refactor.","solutions":["Point the tool's source field at a compatible bigtable source","Verify the referenced source exists and is a Bigtable source","Restart the toolbox to load the fixed config","When invoking programmatically, pass a Source implementing the tool's compatibleSource"],"exampleFix":"// before (tools.yaml)\ntools:\n  update-materialized-view:\n    kind: bigtable-update-materialized-view\n    source: my-spanner\n// after\ntools:\n  update-materialized-view:\n    kind: bigtable-update-materialized-view\n    source: my-bigtable-instance","handlingStrategy":"type-guard","validationCode":"// Verify the source before invoking the materialized-view update\nif err := tool.ValidateSource(mySource); err != nil {\n    return fmt.Errorf(\"source %s cannot back bigtable-update-materialized-view\", sourceName)\n}","typeGuard":"func isCompatibleMaterializedViewSource(s sources.Source) bool {\n    _, ok := s.(bigtableupdatematerializedview.CompatibleSource)\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Only wire bigtable-update-materialized-view to Bigtable sources","Add a config lint that checks source kinds per tool kind","Avoid copy-pasting tool blocks across different source types","Restart and smoke-test the toolbox after config edits"],"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"}