:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(data-warehouse): cut sources list load for large-schema projects (#86737)
Kyle Swank7925717f26ef
diff --git a/products/data_warehouse/frontend/shared/logics/sourceManagementLogic.ts b/products/data_warehouse/frontend/shared/logics/sourceManagementLogic.tsindex e20cd5d8e37e..f9969fa89286 100644--- a/products/data_warehouse/frontend/shared/logics/sourceManagementLogic.ts+++ b/products/data_warehouse/frontend/shared/logics/sourceManagementLogic.ts@@ -39,7 +39,19 @@ import { availableSourcesLogic } from '../../scenes/NewSourceScene/availableSourimport { joinsLogic } from './joinsLogic'import { sourcesDataLogic } from './sourcesDataLogic'+// Poll fast while something is actively syncing so sync status feels live; otherwise poll slowly. The+// list response can be very large (a source can have tens of thousands of schemas), so refetching it+// every 10s when nothing is changing wastes server work and can pile up behind slow requests. The idle+// cadence still bounds how long a server-started sync (scheduled, not user-triggered) takes to appear.const REFRESH_INTERVAL = 10000+const IDLE_REFRESH_INTERVAL = 15000++const isActivelySyncing = (sources: PaginatedResponse<ExternalDataSource> | null): boolean =>+ (sources?.results ?? []).some(+ (source) =>+ source.status === ExternalDataJobStatus.Running ||+ (source.schemas ?? []).some((schema) => schema.status === ExternalDataSchemaStatus.Running)+ )// Pages that actually render the sources list and want live sync-status updates. The 10s poll// runs only on these. Every other page that mounts this logic (the new-source wizard, SQL editor,@@ -509,8 +521,10 @@ export const sourceManagementLogic = kea<sourceManagementLogicType>([updateSchema: (schema) => {posthog.capture('schema updated', { shouldSync: schema.should_sync, syncType: schema.sync_type })},- loadSourcesSuccess: () => {+ loadSourcesSuccess: ({ dataWarehouseSources }) => {if (shouldPollSources()) {+ // Poll fast while a sync is in progress, slowly otherwise.+ const interval = isActivelySyncing(dataWarehouseSources) ? REFRESH_INTERVAL : IDLE_REFRESH_INTERVALcache.disposables.add(() => {const timerId = setTimeout(() => {// Re-check at fire time: this shared logic stays mounted across navigation@@ -519,19 +533,20 @@ export const sourceManagementLogic = kea<sourceManagementLogicType>([if (shouldPollSources()) {actions.loadSources()}- }, REFRESH_INTERVAL)+ }, interval)return () => clearTimeout(timerId)}, 'refreshTimeout')}},loadSourcesFailure: () => {if (shouldPollSources()) {+ // Nothing loaded to inspect; back off to the slow cadence rather than hammering on errors.cache.disposables.add(() => {const timerId = setTimeout(() => {if (shouldPollSources()) {actions.loadSources()}- }, REFRESH_INTERVAL)+ }, IDLE_REFRESH_INTERVAL)return () => clearTimeout(timerId)}, 'refreshTimeout')}diff --git a/products/warehouse_sources/backend/presentation/views/external_data_schema.py b/products/warehouse_sources/backend/presentation/views/external_data_schema.pyindex a4d68b7ef2b8..37b0199abe6e 100644--- a/products/warehouse_sources/backend/presentation/views/external_data_schema.py+++ b/products/warehouse_sources/backend/presentation/views/external_data_schema.py@@ -244,6 +244,16 @@ def _apply_primary_key_columns()+def schema_display_status(schema: ExternalDataSchema) -> str | None:+ """The user-facing sync status, mapping the two billing-limit statuses to friendly labels.+ Shared by the full and list schema serializers so the labels stay identical."""+ if schema.status == ExternalDataSchema.Status.BILLING_LIMIT_REACHED:+ return "Billing limits"+ if schema.status == ExternalDataSchema.Status.BILLING_LIMIT_TOO_LOW:+ return "Billing limits too low"+ return schema.status++class ExternalDataSchemaSerializer(UserAccessControlSerializerMixin, serializers.ModelSerializer):"""A schema of an external data source: its sync configuration and the warehouse table it syncs into."""@@ -545,13 +555,7 @@ class ExternalDataSchemaSerializer(UserAccessControlSerializerMixin, serializersreturn attrsdef get_status(self, schema: ExternalDataSchema) -> str | None:- if schema.status == ExternalDataSchema.Status.BILLING_LIMIT_REACHED:- return "Billing limits"-- if schema.status == ExternalDataSchema.Status.BILLING_LIMIT_TOO_LOW:- return "Billing limits too low"-- return schema.status+ return schema_display_status(schema)def get_incremental(self, schema: ExternalDataSchema) -> bool:return schema.is_incremental@@ -1331,6 +1335,60 @@ class ExternalDataSchemaSerializer(UserAccessControlSerializerMixin, serializersadapter.remove_table(source, db_schema, source_table_name)+class ExternalDataSchemaListSerializer(serializers.ModelSerializer):+ """Trimmed schema representation for the source LIST endpoint.++ The sources list embeds every schema of every source, and a large project can have tens of+ thousands of schemas. This serializer emits only the fields the list consumers read: sync status,+ the sync toggle, sync type, last sync, the latest error, and the synced table's name and row count.+ It skips column metadata, the rest of the sync configuration, and the per-schema SourceRegistry/HogQL+ work that the full `ExternalDataSchemaSerializer` computes, which otherwise dominates the request.+ `sync_type` is kept as a plain stored field (no per-row recompute) because the PostHog Desktop app+ reads it from this list to decide whether a schema needs an update.+ """++ table = serializers.SerializerMethodField(+ read_only=True, help_text="The synced warehouse table (id, name, row_count), or null if not yet synced."+ )+ status = serializers.SerializerMethodField(read_only=True, help_text="Current sync status for this schema.")++ class Meta:+ model = ExternalDataSchema+ fields = [+ "id",+ "name",+ "label",+ "should_sync",+ "status",+ "sync_type",+ "last_synced_at",+ "latest_error",+ "table",+ ]+ read_only_fields = fields++ @extend_schema_field(+ {+ "type": "object",+ "nullable": True,+ "properties": {+ "id": {"type": "string"},+ "name": {"type": "string"},+ "row_count": {"type": "integer", "nullable": True},+ },+ }+ )+ def get_table(self, schema: ExternalDataSchema) -> dict[str, Any] | None:+ table = schema.table+ if table is None or table.deleted:+ return None+ return {"id": str(table.id), "name": table.name, "row_count": table.row_count}++ @extend_schema_field(serializers.CharField(allow_null=True))+ def get_status(self, schema: ExternalDataSchema) -> str | None:+ return schema_display_status(schema)++class SimpleExternalDataSchemaSerializer(serializers.ModelSerializer):class Meta:model = ExternalDataSchemadiff --git a/products/warehouse_sources/backend/presentation/views/external_data_source.py b/products/warehouse_sources/backend/presentation/views/external_data_source.pyindex d6db13312ffc..980e78d7b484 100644--- a/products/warehouse_sources/backend/presentation/views/external_data_source.py+++ b/products/warehouse_sources/backend/presentation/views/external_data_source.py@@ -161,6 +161,7 @@ from products.warehouse_sources.backend.facade.types import (ManagedWarehouseSQLMode,)from products.warehouse_sources.backend.presentation.views.external_data_schema import (+ ExternalDataSchemaListSerializer,ExternalDataSchemaSerializer,RowFiltersField,SimpleExternalDataSchemaSerializer,@@ -1129,8 +1130,22 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializerdef get_api_version_deprecation(self, instance: ExternalDataSource) -> dict[str, Any] | None:return api_version_deprecation_payload(instance.source_type, instance.api_version)+ def _prefetched_schemas(self, instance: ExternalDataSource) -> list[ExternalDataSchema] | None:+ prefetched = getattr(instance, "_prefetched_objects_cache", {}).get("schemas")+ if prefetched is None:+ return None+ return [schema for schema in prefetched if not schema.deleted]++ def _active_schemas(self, instance: ExternalDataSource) -> list[ExternalDataSchema]:+ """Schemas that are syncing or carry an error — derived in Python from the single `schemas`+ prefetch rather than a second DB scan of the same (potentially huge) table."""+ prefetched = self._prefetched_schemas(instance)+ if prefetched is not None:+ return [schema for schema in prefetched if schema.should_sync or schema.latest_error is not None]+ return list(instance.schemas.exclude(deleted=True).filter(Q(should_sync=True) | Q(latest_error__isnull=False)))+def get_status(self, instance: ExternalDataSource) -> str:- active_schemas: list[ExternalDataSchema] = list(instance.active_schemas) # type: ignore+ active_schemas: list[ExternalDataSchema] = self._active_schemas(instance)# Negative statuses should ignore schemas the user has disabled — those can linger in# active_schemas via the latest_error prefetch but shouldn't drag the source into a failed state.syncing_schemas = [schema for schema in active_schemas if schema.should_sync]@@ -1163,10 +1178,10 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializer@extend_schema_field(serializers.CharField(allow_null=True))def get_latest_error(self, instance: ExternalDataSource):- prefetched_schemas = getattr(instance, "_prefetched_objects_cache", {}).get("schemas")+ prefetched_schemas = self._prefetched_schemas(instance)if prefetched_schemas is not None:schema_with_error = next(- (schema for schema in prefetched_schemas if not schema.deleted and schema.latest_error is not None),+ (schema for schema in prefetched_schemas if schema.latest_error is not None),None,)else:@@ -1180,6 +1195,11 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializerschemas = [schema for schema in prefetched_schemas if not schema.deleted]else:schemas = list(instance.schemas.exclude(deleted=True).order_by("name"))+ # The source list embeds every schema of every source; large projects have tens of thousands.+ # The list UI only reads a handful of per-schema fields, so serialize the trimmed shape there+ # and reserve the full serializer for single-source reads.+ if self.context.get("schemas_list_only"):+ return ExternalDataSchemaListSerializer(schemas, many=True, read_only=True, context=self.context).datareturn ExternalDataSchemaSerializer(schemas, many=True, read_only=True, context=self.context).datadef update(self, instance: ExternalDataSource, validated_data: Any) -> Any:@@ -1504,18 +1524,16 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializerschemas = list(ExternalDataSchema.objects.filter(team_id=instance.team_id, source_id=updated_source.id).exclude(deleted=True)+ # This is the update() response path, which serializes the full column shape+ # (include_columns=True) — building columns reads table.credential.access_key per schema,+ # so keep the credential joined here to avoid an N+1..select_related("table__credential", "table__external_data_source").order_by("name"))- active_schemas = list(- ExternalDataSchema.objects.filter(team_id=instance.team_id, source_id=updated_source.id)- .exclude(deleted=True)- .filter(Q(should_sync=True) | Q(latest_error__isnull=False))- .select_related("source", "table__credential", "table__external_data_source")- )+ # `get_status`/`get_latest_error` derive the active/errored subset from this prefetch, so no+ # separate `active_schemas` query is needed.updated_source_any = cast(Any, updated_source)updated_source_any._prefetched_objects_cache = {"schemas": schemas}- updated_source_any.active_schemas = active_schemasreturn updated_source@@ -2066,6 +2084,8 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi# never does (it only reads name/row_count). Gate both to single-source reads.include_columns = self.action != "list"context["include_columns"] = include_columns+ # The list serializes a trimmed per-schema shape; single-source reads serialize the full one.+ context["schemas_list_only"] = self.action == "list"if include_columns:context["database"] = Database.create_for(team_id=self.team_id, user=cast(User, self.request.user))@@ -2076,6 +2096,15 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixicanonical_source = _canonical_legacy_managed_warehouse_source(queryset.filter(team_id=self.team_id))queryset = _hide_noncanonical_managed_warehouse_sources(queryset, canonical_source)+ # `table__credential` holds EncryptedTextField key material. The list never reads it (trimmed+ # schema shape, include_columns=False), so joining it across every schema — tens of thousands on+ # large sources — is pure waste there and is dropped. Every other action serializes columns+ # (include_columns=True), and building them reads `table.credential.access_key` per schema+ # (see DataWarehouseTable.hogql_definition), so keep the join off the list path only.+ schema_select = ["table__external_data_source"]+ if self.action != "list":+ schema_select.append("table__credential")+return (queryset# created_by (FK) and revenue_analytics_config (reverse 1:1) are read per source during@@ -2091,23 +2120,16 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi)[:1],to_attr="ordered_jobs",),+ # The one place schemas are read during serialization. `active_schemas` used to be a+ # second prefetch over the same rows — it's now derived in Python from this one (see+ # `_active_schemas`), so the schema table is scanned once.Prefetch("schemas",queryset=ExternalDataSchema.objects.filter(team_id=self.team_id).exclude(deleted=True)- .select_related("table__credential", "table__external_data_source")+ .select_related(*schema_select).order_by("name"),),- Prefetch(- "schemas",- queryset=ExternalDataSchema.objects.filter(team_id=self.team_id)- .exclude(deleted=True)- .filter(- Q(should_sync=True) | Q(latest_error__isnull=False)- ) # OR to include schemas with errors or marked for sync- .select_related("source", "table__credential", "table__external_data_source"),- to_attr="active_schemas",- ),).order_by(self.ordering))diff --git a/products/warehouse_sources/backend/tests/api/test_external_data_schema.py b/products/warehouse_sources/backend/tests/api/test_external_data_schema.pyindex f006807f3647..c410ff0ce668 100644--- a/products/warehouse_sources/backend/tests/api/test_external_data_schema.py+++ b/products/warehouse_sources/backend/tests/api/test_external_data_schema.py@@ -8,6 +8,7 @@ from posthog.test.base import APIBaseTestfrom unittest import mockfrom django.conf import settings+from django.test import SimpleTestCasefrom django.test.client import Client as HttpClientimport psycopg@@ -37,6 +38,7 @@ from products.warehouse_sources.backend.facade.models import (update_sync_type_config_keys,)from products.warehouse_sources.backend.facade.types import ExternalDataSourceType+from products.warehouse_sources.backend.presentation.views.external_data_schema import schema_display_statusfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.base import (VersionDeprecation,WebhookCreationResult,@@ -3965,3 +3967,16 @@ class TestFanoutParentSelection(APIBaseTest):stack.enter_context(p)response = self.client.delete(f"/api/environments/{self.team.pk}/external_data_schemas/{parent.id}")assert response.status_code == 204+++class TestSchemaDisplayStatus(SimpleTestCase):+ @parameterized.expand(+ [+ (ExternalDataSchema.Status.BILLING_LIMIT_REACHED, "Billing limits"),+ (ExternalDataSchema.Status.BILLING_LIMIT_TOO_LOW, "Billing limits too low"),+ (ExternalDataSchema.Status.RUNNING, ExternalDataSchema.Status.RUNNING),+ (None, None),+ ]+ )+ def test_maps_billing_statuses_to_labels(self, raw_status, expected):+ assert schema_display_status(ExternalDataSchema(status=raw_status)) == expecteddiff --git a/products/warehouse_sources/backend/tests/api/test_external_data_source.py b/products/warehouse_sources/backend/tests/api/test_external_data_source.pyindex b277812c70d7..cb4e96126112 100644--- a/products/warehouse_sources/backend/tests/api/test_external_data_source.py+++ b/products/warehouse_sources/backend/tests/api/test_external_data_source.py@@ -45,6 +45,7 @@ from products.data_warehouse.backend.direct_postgres import DIRECT_POSTGRES_URL_from products.data_warehouse.backend.models.revenue_analytics_config import ExternalDataSourceRevenueAnalyticsConfigfrom products.revenue_analytics.backend.joins import get_customer_revenue_view_namefrom products.warehouse_sources.backend.facade.models import (+ DataWarehouseCredential,DataWarehouseTable,ExternalDataJob,ExternalDataSchema,@@ -155,6 +156,141 @@ class TestExternalDataSource(APIBaseTest):name="Customers", team_id=self.team.pk, source_id=source_id, table=None)+ def _make_source(self, prefix: str) -> ExternalDataSource:+ return ExternalDataSource.objects.create(+ team_id=self.team.pk,+ source_id=str(uuid.uuid4()),+ connection_id=str(uuid.uuid4()),+ destination_id=str(uuid.uuid4()),+ source_type="Stripe",+ created_by=self.user,+ prefix=prefix,+ job_inputs={"auth_method": {"selection": "api_key", "stripe_secret_key": "sk_test_123"}},+ )++ def _make_schema_with_table(+ self,+ source: ExternalDataSource,+ name: str,+ *,+ status: str | None = None,+ latest_error: str | None = None,+ should_sync: bool = True,+ row_count: int = 0,+ ) -> ExternalDataSchema:+ table = DataWarehouseTable.objects.create(+ name=name, team=self.team, external_data_source=source, row_count=row_count+ )+ return ExternalDataSchema.objects.create(+ team=self.team,+ source=source,+ name=name,+ table=table,+ status=status,+ latest_error=latest_error,+ should_sync=should_sync,+ )++ def test_list_serializes_trimmed_schema_shape_while_retrieve_stays_full(self):+ # The sources list embeds every schema of every source, so it serializes a trimmed per-schema+ # shape (the fields the list UI reads); the single-source view keeps the full schema.+ source = self._make_source("trim")+ self._make_schema_with_table(source, "Customers", row_count=42)++ list_response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/")+ self.assertEqual(list_response.status_code, 200)+ listed_schema = list_response.json()["results"][0]["schemas"][0]+ self.assertEqual(+ set(listed_schema.keys()),+ {"id", "name", "label", "should_sync", "status", "sync_type", "last_synced_at", "latest_error", "table"},+ )+ self.assertEqual(listed_schema["table"]["row_count"], 42)+ self.assertEqual(listed_schema["table"]["name"], "Customers")+ # sync_type is kept for the PostHog Desktop app, which reads it from the list; without it the+ # app treats every schema as needing an update and sends a redundant PATCH per toggle.+ self.assertIn("sync_type", listed_schema)++ detail_response = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/")+ self.assertEqual(detail_response.status_code, 200)+ detail_schema = detail_response.json()["schemas"][0]+ # fields the settings page needs that the list intentionally drops+ self.assertIn("sync_type", detail_schema)+ self.assertIn("available_columns", detail_schema)++ def test_list_source_status_and_latest_error_reflect_syncing_schemas(self):+ # `active_schemas` is derived in Python from the single schemas prefetch; the derived subset+ # must still drive the source-level status/error the same way the second prefetch did.+ source = self._make_source("status")+ self._make_schema_with_table(+ source, "Customers", status=ExternalDataSchema.Status.FAILED, latest_error="boom", should_sync=True+ )+ # a disabled schema must not drag the source into a failed state+ self._make_schema_with_table(source, "Old", status=ExternalDataSchema.Status.COMPLETED, should_sync=False)++ result = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/").json()["results"][0]+ self.assertEqual(result["status"], ExternalDataSchema.Status.FAILED)+ self.assertEqual(result["latest_error"], "boom")++ def test_list_query_count_does_not_scale_with_source_count(self):+ # Guards the prefetch design: adding sources (each with schemas + tables) must not add queries.+ # A regression to per-source credential/source lookups or the duplicate schema prefetch shows up+ # here as a rising query count.+ first = self._make_source("one")+ self._make_schema_with_table(first, "A")++ # warm any per-request caches so the two measurements compare like with like+ self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/")++ with CaptureQueriesContext(connection) as one_source_queries:+ self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/")++ for index in range(4):+ extra = self._make_source(f"many-{index}")+ self._make_schema_with_table(extra, f"S{index}")++ with CaptureQueriesContext(connection) as many_source_queries:+ self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/")++ self.assertEqual(len(many_source_queries.captured_queries), len(one_source_queries.captured_queries))++ def _make_credentialed_schema(self, source: ExternalDataSource, name: str) -> ExternalDataSchema:+ credential = DataWarehouseCredential.objects.create(+ team=self.team, access_key=f"key-{name}", access_secret=f"secret-{name}"+ )+ table = DataWarehouseTable.objects.create(+ name=name,+ format=DataWarehouseTable.TableFormat.Parquet,+ team=self.team,+ url_pattern=DIRECT_POSTGRES_URL_PATTERN,+ external_data_source=source,+ credential=credential,+ columns={"id": {"clickhouse": "Int32", "hogql": "integer", "valid": True}},+ )+ return ExternalDataSchema.objects.create(+ team_id=self.team.pk, source_id=source.id, name=name, table=table, should_sync=True+ )++ def test_retrieve_query_count_does_not_scale_with_schema_count(self):+ # Retrieve serializes columns (include_columns=True), and building them reads+ # table.credential.access_key per schema. The prefetch must keep credentials joined on this+ # path; if it stops, each schema adds a credential SELECT. Guards the N+1 on the detail page.+ source = self._make_source("detail")+ self._make_credentialed_schema(source, "first")++ url = f"/api/environments/{self.team.pk}/external_data_sources/{source.id}/"+ self.client.get(url) # warm++ with CaptureQueriesContext(connection) as one_schema_queries:+ assert self.client.get(url).status_code == 200++ for index in range(4):+ self._make_credentialed_schema(source, f"more-{index}")++ with CaptureQueriesContext(connection) as many_schema_queries:+ assert self.client.get(url).status_code == 200++ self.assertEqual(len(many_schema_queries.captured_queries), len(one_schema_queries.captured_queries))+@patch("products.warehouse_sources.backend.temporal.data_imports.sources.stripe.source.StripeSource.validate_credentials",return_value=(True, None),@@ -2256,12 +2392,12 @@ class TestExternalDataSource(APIBaseTest):table=table,)- # The list view never reads schemas[].table.columns, so it skips the expensive- # HogQL field serialization and returns an empty column list.+ # The list view never reads schemas[].table.columns, so it serializes a trimmed table shape+ # (id, name, row_count) and omits columns entirely — no expensive HogQL field serialization.list_payload = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/").json()list_table = list_payload["results"][0]["schemas"][0]["table"]self.assertEqual(list_table["name"], "Accounts")- self.assertEqual(list_table["columns"], [])+ self.assertNotIn("columns", list_table)# The single-source read still populates columns for the schema detail page.retrieve_payload = self.client.get(f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}").json()diff --git a/products/warehouse_sources/mcp/tools.yaml b/products/warehouse_sources/mcp/tools.yamlindex d84df5d17388..5ad90c0badc6 100644--- a/products/warehouse_sources/mcp/tools.yaml+++ b/products/warehouse_sources/mcp/tools.yaml@@ -386,27 +386,10 @@ tools:instead of telling the user the data isn't available. Lists every configured import source with its type(Postgres, Stripe, Hubspot, etc.), connection status, prefix, schemas, latest error, and last synctimestamp. If nothing relevant is connected, offer to set one up with 'data-warehouse-source-setup'. Each- schema is summarized (name, status, sync type/frequency, last sync, error, table name, row count) — column- definitions and full sync configuration (incremental field, primary keys, row filters, column selection) are- on external-data-schemas-retrieve. To look up a single table's sync status by name use+ schema is summarized (name, label, status, sync type, last sync, error, table name, row count) — column+ definitions and full sync configuration (sync frequency, incremental field, primary keys, row filters,+ column selection) are on external-data-schemas-retrieve. To look up a single table's sync status by name useexternal-data-schemas-list with a search.- response:- exclude:- - schemas.*.table.columns- - schemas.*.available_columns- - schemas.*.label- - schemas.*.description- - schemas.*.incremental_field- - schemas.*.incremental_field_type- - schemas.*.incremental_field_lookback_seconds- - schemas.*.sync_time_of_day- - schemas.*.primary_key_columns- - schemas.*.cdc_table_mode- - schemas.*.enabled_columns- - schemas.*.row_filters- - schemas.*.source- - schemas.*.api_version- - schemas.*.api_version_deprecationexternal-data-sources-oauth-accounts-retrieve:operation: external_data_sources_oauth_accounts_retrieveenabled: falsediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 4cc87f245dc6..283ab2d03362 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -4489,7 +4489,7 @@}},"external-data-sources-list": {- "description": "Check what external data is already connected before answering any revenue, billing, subscription, CRM, support-ticket, or product-database question — call this first so you JOIN against an existing source instead of telling the user the data isn't available. Lists every configured import source with its type (Postgres, Stripe, Hubspot, etc.), connection status, prefix, schemas, latest error, and last sync timestamp. If nothing relevant is connected, offer to set one up with 'data-warehouse-source-setup'. Each schema is summarized (name, status, sync type/frequency, last sync, error, table name, row count) — column definitions and full sync configuration (incremental field, primary keys, row filters, column selection) are on external-data-schemas-retrieve. To look up a single table's sync status by name use external-data-schemas-list with a search.",+ "description": "Check what external data is already connected before answering any revenue, billing, subscription, CRM, support-ticket, or product-database question — call this first so you JOIN against an existing source instead of telling the user the data isn't available. Lists every configured import source with its type (Postgres, Stripe, Hubspot, etc.), connection status, prefix, schemas, latest error, and last sync timestamp. If nothing relevant is connected, offer to set one up with 'data-warehouse-source-setup'. Each schema is summarized (name, label, status, sync type, last sync, error, table name, row count) — column definitions and full sync configuration (sync frequency, incremental field, primary keys, row filters, column selection) are on external-data-schemas-retrieve. To look up a single table's sync status by name use external-data-schemas-list with a search.","category": "Warehouse sources","feature": "warehouse_sources","summary": "List data warehouse sources",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex b63957c76f73..c2fa126f09e9 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -4602,7 +4602,7 @@}},"external-data-sources-list": {- "description": "Check what external data is already connected before answering any revenue, billing, subscription, CRM, support-ticket, or product-database question — call this first so you JOIN against an existing source instead of telling the user the data isn't available. Lists every configured import source with its type (Postgres, Stripe, Hubspot, etc.), connection status, prefix, schemas, latest error, and last sync timestamp. If nothing relevant is connected, offer to set one up with 'data-warehouse-source-setup'. Each schema is summarized (name, status, sync type/frequency, last sync, error, table name, row count) — column definitions and full sync configuration (incremental field, primary keys, row filters, column selection) are on external-data-schemas-retrieve. To look up a single table's sync status by name use external-data-schemas-list with a search.",+ "description": "Check what external data is already connected before answering any revenue, billing, subscription, CRM, support-ticket, or product-database question — call this first so you JOIN against an existing source instead of telling the user the data isn't available. Lists every configured import source with its type (Postgres, Stripe, Hubspot, etc.), connection status, prefix, schemas, latest error, and last sync timestamp. If nothing relevant is connected, offer to set one up with 'data-warehouse-source-setup'. Each schema is summarized (name, label, status, sync type, last sync, error, table name, row count) — column definitions and full sync configuration (sync frequency, incremental field, primary keys, row filters, column selection) are on external-data-schemas-retrieve. To look up a single table's sync status by name use external-data-schemas-list with a search.","category": "Warehouse sources","feature": "warehouse_sources","summary": "List data warehouse sources",diff --git a/services/mcp/src/tools/generated/warehouse_sources.ts b/services/mcp/src/tools/generated/warehouse_sources.tsindex 3168aad6d883..c964e4838817 100644--- a/services/mcp/src/tools/generated/warehouse_sources.ts+++ b/services/mcp/src/tools/generated/warehouse_sources.ts@@ -560,29 +560,7 @@ const externalDataSourcesList = (): ToolBase<search: params.search,},})- const filtered = {- ...result,- results: (result.results ?? []).map((item: any) =>- omitResponseFields(item, [- 'schemas.*.table.columns',- 'schemas.*.available_columns',- 'schemas.*.label',- 'schemas.*.description',- 'schemas.*.incremental_field',- 'schemas.*.incremental_field_type',- 'schemas.*.incremental_field_lookback_seconds',- 'schemas.*.sync_time_of_day',- 'schemas.*.primary_key_columns',- 'schemas.*.cdc_table_mode',- 'schemas.*.enabled_columns',- 'schemas.*.row_filters',- 'schemas.*.source',- 'schemas.*.api_version',- 'schemas.*.api_version_deprecation',- ])- ),- } as typeof result- return await withPostHogUrl(context, filtered, '/data-management/sources')+ return await withPostHogUrl(context, result, '/data-management/sources')},})