googleapis/mcp-toolbox · error

source is not compatible with the tool

Error message

source is not compatible with the tool

What it means

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.

Source

Thrown at internal/tools/bigtable/bigtableupdatematerializedview/bigtableupdatematerializedview.go:96

			allParameters,
		),
	}, nil
}

var _ tools.Tool = Tool{}

type Tool struct {
	tools.BaseTool[Config]
}

func (t Tool) GetSourceName() string {
	return t.Cfg.Source
}

func (t Tool) ValidateSource(src sources.Source) error {
	_, ok := src.(compatibleSource)
	if !ok {
		return fmt.Errorf("source is not compatible with the tool")
	}
	return nil
}

func (t Tool) ToConfig() tools.ToolConfig {
	return t.Cfg
}

func (t Tool) Invoke(ctx context.Context, src sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {
	source, ok := src.(compatibleSource)
	if !ok {
		return nil, util.NewClientServerError("source used is not compatible with the tool", http.StatusInternalServerError, nil)
	}

	paramsMap := params.AsMap()

	res, err := source.UpdateMaterializedView(ctx, paramsMap["instance_id"].(string), paramsMap["materialized_view_id"].(string), paramsMap["query"].(string))
	if err != nil {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Point the tool's source field at a compatible bigtable source
  2. Verify the referenced source exists and is a Bigtable source
  3. Restart the toolbox to load the fixed config
  4. When invoking programmatically, pass a Source implementing the tool's compatibleSource

Example fix

// before (tools.yaml)
tools:
  update-materialized-view:
    kind: bigtable-update-materialized-view
    source: my-spanner
// after
tools:
  update-materialized-view:
    kind: bigtable-update-materialized-view
    source: my-bigtable-instance
Defensive patterns

Strategy: type-guard

Validate before calling

// Verify the source before invoking the materialized-view update
if err := tool.ValidateSource(mySource); err != nil {
    return fmt.Errorf("source %s cannot back bigtable-update-materialized-view", sourceName)
}

Type guard

func isCompatibleMaterializedViewSource(s sources.Source) bool {
    _, ok := s.(bigtableupdatematerializedview.CompatibleSource)
    return ok
}

Prevention

When it happens

Trigger: 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.

Common situations: Attaching bigtable-update-materialized-view to a non-Bigtable source; template reuse across sources; stale source names after a config refactor.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/ab2c60e868141481. Report an issue: GitHub.