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

  1. Set `source:` to a Postgres-family source (postgres, cloud-sql-postgres, alloydb-postgres).
  2. Check the source is declared under `sources:` with a Postgres `kind`.
  3. 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

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


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