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
The postgres-list-stored-procedure tool's ValidateSource rejects the attached source because it lacks compatibleSource (PostgresPool() *pgxpool.Pool and RunSQL). Stored-procedure introspection requires Postgres catalog access, so only Postgres-family sources are compatible. The check runs at startup during tool/source binding.
Source
Thrown at internal/tools/postgres/postgresliststoredprocedure/postgresliststoredprocedure.go:167
}
out = append(out, rowMap)
}
return out, 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
- Set `source:` to a Postgres-family source (postgres, cloud-sql-postgres, alloydb-postgres).
- Check the source is declared under `sources:` with a Postgres `kind`.
- Use the equivalent tool for your actual engine if not Postgres.
Example fix
# before
tools:
list-sprocs:
kind: postgres-list-stored-procedure
source: mssql-erp
# after
tools:
list-sprocs:
kind: postgres-list-stored-procedure
source: pg-erp Defensive patterns
Strategy: validation
Validate before calling
src := myConfig.sources[tool.Source]
if _, ok := src.(interface {
PostgresPool() *pgxpool.Pool
RunSQL(context.Context, string, []any) (any, error)
}); !ok {
return fmt.Errorf("postgres-list-stored-procedure requires a Postgres-family source, got %T", src)
} Type guard
func isCompatiblePostgresSource(s sources.Source) bool {
_, ok := s.(interface {
PostgresPool() *pgxpool.Pool
RunSQL(context.Context, string, []any) (any, error)
})
return ok
} Prevention
- Use stored-procedure tools only with Postgres-family sources.
- Keep tool `source:` values synced with `sources:` keys via review or linting.
- Validate configs with a startup smoke test in CI.
When it happens
Trigger: A `postgres-list-stored-procedure` tool whose `source:` names an incompatible source kind (mysql, mssql, sqlite, http, etc.) or an undefined source key.
Common situations: Reusing postgres tool blocks in other engines' configs; typos in source names; prebuilt-config edits that changed the source without the tool.
Related errors
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
- invalid source for %q tool: source %q is not a compatible ty
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/5c4ca160491e3b94.
Report an issue: GitHub.