googleapis/mcp-toolbox · error

source is not compatible with the tool

Error message

source is not compatible with the tool

What it means

bigtable-list-logical-views' ValidateSource throws this when its compatibleSource assertion fails, i.e. the supplied source cannot supply logical-view listings for Bigtable. Only the concrete Bigtable source implements the needed method; any other source kind fails the check. The error surfaces before any admin API request is made.

Source

Thrown at internal/tools/bigtable/bigtablelistlogicalviews/bigtablelistlogicalviews.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.ListLogicalViews(ctx, paramsMap["instance_id"].(string))
	if err != nil {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Point the tool at a source with kind: bigtable
  2. Confirm the source type implements the list-logical-views method
  3. Rebuild/redeploy with matching toolbox and config versions
  4. Lint tool-source pairings in CI to catch kind mismatches

Example fix

// before
source: my-postgres-source
// after
source: my-bigtable-source
Defensive patterns

Strategy: validation

Validate before calling

if err := tool.ValidateSource(src); err != nil {
    return fmt.Errorf("bigtable-list-logical-views requires a bigtable source: %w", err)
}

Type guard

func isBigtableLogicalViewsSource(s sources.Source) bool {
    _, ok := s.(interface{ ListLogicalViews(context.Context) (any, error) })
    return ok
}

Try / catch

if err := tool.ValidateSource(src); err != nil {
    log.Fatalf("incompatible source for bigtable-list-logical-views: %v", err)
}

Prevention

When it happens

Trigger: Calling ValidateSource or running the tool with a source that is not the Bigtable source, or a source whose method set no longer matches this toolbox version's interface.

Common situations: Tool bound to the wrong source in tools.yaml; refactoring renamed/replaced the source; custom source implementations not updated after a toolbox release.

Related errors


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