{"record":{"id":"5c4ca160491e3b94","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-5c4ca1","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/postgresliststoredprocedure/postgresliststoredprocedure.go","lineNumber":167,"sourceCode":"\t\t}\n\t\tout = append(out, rowMap)\n\t}\n\n\treturn out, 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":149,"sourceCodeEnd":171,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/postgres/postgresliststoredprocedure/postgresliststoredprocedure.go#L149-L171","documentation":"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.","triggerScenarios":"A `postgres-list-stored-procedure` tool whose `source:` names an incompatible source kind (mysql, mssql, sqlite, http, etc.) or an undefined source key.","commonSituations":"Reusing postgres tool blocks in other engines' configs; typos in source names; prebuilt-config edits that changed the source without the tool.","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."],"exampleFix":"# before\ntools:\n  list-sprocs:\n    kind: postgres-list-stored-procedure\n    source: mssql-erp\n# after\ntools:\n  list-sprocs:\n    kind: postgres-list-stored-procedure\n    source: pg-erp","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-stored-procedure 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":["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."],"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"}