googleapis/mcp-toolbox · error

source is not compatible with the tool

Error message

source is not compatible with the tool

What it means

The bigtable-get-table tool returns this error from ValidateSource when its compatibleSource type assertion fails, meaning the source does not provide the required GetTable(context.Context, string) (any, error) behavior. The toolbox performs this check before every invocation to guarantee the tool can talk to the source. It signals a source/tool wiring mismatch rather than a runtime Bigtable error.

Source

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

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Point the tool at a source with kind: bigtable in the config
  2. Verify the source's concrete type implements the expected GetTable method
  3. Pin/upgrade toolbox and source to matching versions
  4. Run config validation on startup to catch incompatible pairings early

Example fix

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

Strategy: validation

Validate before calling

if err := tool.ValidateSource(mySource); err != nil {
    return fmt.Errorf("bigtable-get-table needs a bigtable source: %w", err)
}

Type guard

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

Try / catch

if err := tool.ValidateSource(src); err != nil {
    log.Fatalf("wrong source kind for bigtable-get-table: %v", err)
}

Prevention

When it happens

Trigger: ValidateSource called with, or server invocation receiving, a non-Bigtable source such as postgres/mysql/bigquery, or a source implementation missing the GetTable method for this toolbox version.

Common situations: Wrong 'source:' value under the tool in tools.yaml; a custom Source whose methods don't match the current interface; skipping across toolbox versions where interfaces changed.

Related errors


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