{"record":{"id":"04d01265e109cd02","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-04d012","errorCode":null,"errorMessage":"invalid source for %q tool: source %q is not a compatible type","messagePattern":"invalid source for %q tool: source %q is not a compatible type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/postgres/postgreslistschemas/postgreslistschemas.go","lineNumber":175,"sourceCode":"\tresp, err := source.RunSQL(ctx, listSchemasStatement, sliceParams)\n\tif err != nil {\n\t\treturn nil, util.ProcessGeneralError(err)\n\t}\n\treturn resp, nil\n}\n\nfunc (t Tool) GetSourceName() string {\n\treturn t.Cfg.Source\n}\n\nfunc (t Tool) ToConfig() tools.ToolConfig {\n\treturn t.Cfg\n}\n\nfunc (t Tool) ValidateSource(source sources.Source) error {\n\t_, ok := source.(compatibleSource)\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid source for %q tool: source %q is not a compatible type\", t.Cfg.Type, t.Cfg.Source)\n\t}\n\treturn nil\n}\n","sourceCodeStart":157,"sourceCodeEnd":179,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/postgres/postgreslistschemas/postgreslistschemas.go#L157-L179","documentation":"The postgres-list-schemas tool's ValidateSource rejects the attached source because it does not implement compatibleSource (PostgresPool() *pgxpool.Pool and RunSQL). Schema introspection uses pg_catalog via the pgx pool, so only Postgres-family sources qualify. The error fires during startup source/tool validation.","triggerScenarios":"A `postgres-list-schemas` tool whose `source:` resolves to an incompatible source kind (mysql, mssql, sqlite, http, etc.) or to a name not present in `sources:`.","commonSituations":"Editing prebuilt configs by hand; source renamed without updating tool references; accidental cross-engine tool reuse.","solutions":["Set `source:` to a Postgres-family source (postgres, cloud-sql-postgres, alloydb-postgres).","Confirm the source is defined and its `kind` supports the pgx pool interface.","Use the engine-appropriate tool if the source is not Postgres."],"exampleFix":"# before\ntools:\n  list-schemas:\n    kind: postgres-list-schemas\n    source: mssql-warehouse\n# after\ntools:\n  list-schemas:\n    kind: postgres-list-schemas\n    source: pg-warehouse","handlingStrategy":"validation","validationCode":"src := myConfig.sources[tool.Source]\nif _, ok := src.(interface {\n    PostgresPool() *pgxpool.Pool\n    RunSQL(context.Context, string, []any) (any, error)\n}); !ok {\n    return fmt.Errorf(\"postgres-list-schemas requires a Postgres-family source, got %T\", src)\n}","typeGuard":"func isCompatiblePostgresSource(s sources.Source) bool {\n    _, ok := s.(interface {\n        PostgresPool() *pgxpool.Pool\n        RunSQL(context.Context, string, []any) (any, error)\n    })\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Only bind schema tools to Postgres-family sources.","After renaming a source, grep the yaml for stale tool references.","Use prebuilt configs as the source of truth."],"tags":["postgres","source-validation","config","go"],"backgroundTag":"incompatible-source-type","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}