googleapis/mcp-toolbox · error

invalid source for %q tool: source %q is not a compatible ty

Error message

invalid source for %q tool: source %q is not a compatible type

What it means

Tool.ValidateSource for the Firebird SQL tool fails when the provided source does not implement its compatibleSource interface (not a Firebird source). The message echoes the tool type and configured source name for diagnosis.

Source

Thrown at internal/tools/firebird/firebirdsql/firebirdsql.go:107

// validate interface
var _ tools.Tool = Tool{}

type Tool struct {
	tools.BaseTool[Config]
}

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

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

func (t Tool) ValidateSource(source sources.Source) error {
	_, ok := source.(compatibleSource)
	if !ok {
		return fmt.Errorf("invalid source for %q tool: source %q is not a compatible type", t.Cfg.Type, t.Cfg.Source)
	}
	return nil
}

func (t Tool) Invoke(ctx context.Context, s sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {
	source, ok := s.(compatibleSource)
	if !ok {
		return nil, util.NewClientServerError("source used is not compatible with the tool", http.StatusInternalServerError, nil)
	}
	paramsMap := params.AsMap()
	statement, err := parameters.ResolveTemplateParams(t.Cfg.TemplateParameters, t.Cfg.Statement, paramsMap)
	if err != nil {
		return nil, util.NewAgentError("unable to extract template params", err)
	}

	newParams, err := parameters.GetParams(t.Cfg.Parameters, paramsMap)
	if err != nil {
		return nil, util.NewAgentError("unable to extract standard params", err)

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Point the tool's 'source' at a source declared with kind: firebird.
  2. Confirm the sources map entry name and kind match what the tool expects.
  3. Run toolbox with the corrected config and verify tool loading succeeds.

Example fix

// before
source: cloudsql-pg
// after
source: firebird-db
Defensive patterns

Strategy: validation

Validate before calling

# Ensure kind compatibility
assert cfg['sources'][tool['source']]['kind'] == 'firebird', "firebird-sql needs a firebird source"

Try / catch

if err := tool.ValidateSource(src); err != nil {
    return fmt.Errorf("rebind source: %w", err)
}

Prevention

When it happens

Trigger: Config wires a firebird-sql tool to a source of a different kind (e.g., alloydbpg, mssql); or the named source resolved to an incompatible implementation at runtime.

Common situations: Shared/copied tool configs pointing at the wrong source; renaming sources and leaving stale references; mixing prebuilt configs with custom sources of other kinds.

Related errors


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