googleapis/mcp-toolbox · error

source is not compatible with the tool

Error message

source is not compatible with the tool

What it means

ValidateSource for the bigtable-delete-table tool returns this error when the passed sources.Source does not implement its compatibleSource (Bigtable) interface. The check exists so the tool fails fast at wiring time instead of misbehaving against a foreign source.

Source

Thrown at internal/tools/bigtable/bigtabledeletetable/bigtabledeletetable.go:94

			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.DeleteTable(ctx, paramsMap["table_id"].(string))
	if err != nil {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Bind the tool to a source of kind bigtable.
  2. Make wrapper types implement the expected interface methods.
  3. Double-check the source name in the tool definition.
  4. Rebuild/restart the toolbox to load corrected config.

Example fix

// before
tools:
  delete-table:
    kind: bigtable-delete-table
    source: my-bigquery-source
// after
tools:
  delete-table:
    kind: bigtable-delete-table
    source: my-bigtable-source
Defensive patterns

Strategy: type-guard

Validate before calling

func isBigtableSource(s sources.Source) bool {
    _, ok := s.(interface{ BigtableClient() *bigtable.Client }); return ok
}
// then tool.ValidateSource(src)

Type guard

func asBigtable(s sources.Source) (compatibleSource, bool) { c, ok := s.(compatibleSource); return c, ok }

Try / catch

if err := tool.ValidateSource(src); err != nil {
    return fmt.Errorf("wrong source for bigtable-delete-table: %w", err)
}

Prevention

When it happens

Trigger: ValidateSource invoked with a source that is not a Bigtable source — typically a tool bound to the wrong source kind in the YAML config or programmatically.

Common situations: Config typos binding delete-table to another database's source; refactors replacing the Bigtable source type; integration tests reusing sources of the wrong kind.

Related errors


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