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
ValidateSource type-asserts the resolved source against the tool's compatibleSource interface (RunSQL over pgx). The error fires when the tool is bound to a source that is not a Postgres-compatible source, i.e. the tool kind and source kind in the YAML configuration are incompatible.
Source
Thrown at internal/tools/postgres/postgresgetcolumncardinality/postgresgetcolumncardinality.go:141
resp, err := source.RunSQL(ctx, getColumnCardinality, sliceParams)
if err != nil {
return nil, util.ProcessGeneralError(err)
}
return resp, nil
}
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
}
View on GitHub (pinned to 8cc6e09de2)
Solutions
- Point the tool's 'source' field at a Postgres-compatible source (e.g. postgres, cloudsql-postgres, alloydb-postgres) defined in tools.yaml
- Ensure the source kind implements RunSQL over pgx/v5
- Correct any typo in the source name that resolved to the wrong source
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/tools/postgres/postgresgetcolumncardinality/postgresgetcolumncardinality.go:141 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/a19cb8fa4e3fd5be.
Report an issue: GitHub.