Skip to content

: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.

fix(data-warehouse): expose sync_frequency in view-update MCP schema (#63393)

posthog[bot]d367441939c0
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index 430b67069dd9..214dc22043ee 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -514,6 +514,34 @@ SPECTACULAR_SETTINGS = {
# generated names so the shared enums don't get component-prefixed auto-names on collision.
"ExperimentTypeEnum": ["web", "product", None],
"ExperimentStatusEnum": ["draft", "running", "paused", "stopped"],
+ # Two `sync_frequency` ChoiceFields with different member sets: warehouse-source schemas
+ # accept sub-15min cadences, while saved-query (view) materialization floors at 15min.
+ # Pin both to stable names so neither gets a component-prefixed auto-name on collision.
+ # "SyncFrequencyEnum" keeps the source-schema enum at its pre-existing generated name.
+ "SyncFrequencyEnum": [
+ "never",
+ "1min",
+ "5min",
+ "15min",
+ "30min",
+ "1hour",
+ "6hour",
+ "12hour",
+ "24hour",
+ "7day",
+ "30day",
+ ],
+ "SavedQuerySyncFrequencyEnum": [
+ "never",
+ "15min",
+ "30min",
+ "1hour",
+ "6hour",
+ "12hour",
+ "24hour",
+ "7day",
+ "30day",
+ ],
# Signals now has two serializers (single SignalReportStateRequest + bulk
# SignalReportBulkStateRequest) that both expose the same `state` ChoiceField. Pin the
# shared enum to a stable name so it doesn't collide with the other `state` enums
diff --git a/products/data_warehouse/backend/api/saved_query.py b/products/data_warehouse/backend/api/saved_query.py
index 11aff8a8ab63..83dfa0141a3f 100644
--- a/products/data_warehouse/backend/api/saved_query.py
+++ b/products/data_warehouse/backend/api/saved_query.py
@@ -70,6 +70,51 @@ from products.warehouse_sources.backend.models.util import (
logger = structlog.get_logger(__name__)
+# Cadences offered for view materialization. 15min is the fastest — sub-15min intervals
+# (1min, 5min) are source-only and not meaningful for materialized views, matching the
+# frontend `DataModelingSyncInterval` type. All values are accepted by
+# `sync_frequency_to_sync_frequency_interval`.
+SYNC_FREQUENCY_CHOICES = [
+ ("never", "never"),
+ ("15min", "15min"),
+ ("30min", "30min"),
+ ("1hour", "1hour"),
+ ("6hour", "6hour"),
+ ("12hour", "12hour"),
+ ("24hour", "24hour"),
+ ("7day", "7day"),
+ ("30day", "30day"),
+]
+
+# Deprecated sub-15min cadences clamped up to the 15min floor for backwards compatibility
+# with any legacy caller still sending them.
+DEPRECATED_FAST_SYNC_FREQUENCIES = {"1min", "5min"}
+
+
+class SyncFrequencyField(serializers.ChoiceField):
+ """Writable sync-cadence field for saved queries.
+
+ The cadence is stored on the model as a `sync_frequency_interval` duration, so reads derive
+ the cadence string from it; writes are validated against the choices and consumed by the
+ serializer's `update()`. Declaring it as a real (non read-only) field is what lets the
+ cadence flow into the generated PATCH body and MCP tool schema.
+ """
+
+ def __init__(self, **kwargs: Any) -> None:
+ kwargs.setdefault("choices", SYNC_FREQUENCY_CHOICES)
+ kwargs.setdefault("required", False)
+ kwargs.setdefault("allow_null", True)
+ super().__init__(**kwargs)
+
+ def to_internal_value(self, data: Any) -> str:
+ # Clamp deprecated sub-15min cadences up to the floor before validating against choices.
+ if data in DEPRECATED_FAST_SYNC_FREQUENCIES:
+ data = "15min"
+ return super().to_internal_value(data)
+
+ def get_attribute(self, instance: DataWarehouseSavedQuery) -> str | None:
+ return sync_frequency_interval_to_sync_frequency(instance.sync_frequency_interval)
+
def delete_saved_query(saved_query: DataWarehouseSavedQuery) -> None:
from products.data_modeling.backend.services.saved_query_dag_sync import HasDependentsError, delete_node_from_dag
@@ -212,7 +257,13 @@ class DataWarehouseSavedQuerySerializer(
query = QueryDefinitionField(
help_text='HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key (always "HogQLQuery"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {"kind": "HogQLQuery", "query": "SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100"}',
)
- sync_frequency = serializers.SerializerMethodField()
+ sync_frequency = SyncFrequencyField(
+ help_text=(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', "
+ "'24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest "
+ "cadence available."
+ ),
+ )
latest_history_id = serializers.SerializerMethodField(read_only=True)
last_run_at = serializers.SerializerMethodField(read_only=True)
managed_viewset_kind = serializers.SerializerMethodField(read_only=True)
@@ -317,6 +368,9 @@ class DataWarehouseSavedQuerySerializer(
validated_data["origin"] = DataWarehouseSavedQuery.Origin.DATA_WAREHOUSE
soft_update = validated_data.pop("soft_update", False)
dag_id = validated_data.pop("dag_id", None)
+ # Sync cadence is configured via materialization, not on creation — drop it so it
+ # isn't passed to the model constructor.
+ validated_data.pop("sync_frequency", None)
view = DataWarehouseSavedQuery(**validated_data)
if not soft_update:
@@ -405,7 +459,7 @@ class DataWarehouseSavedQuerySerializer(
except DataWarehouseSavedQuery.DoesNotExist:
before_update = None
- sync_frequency = self.context["request"].data.get("sync_frequency", None)
+ sync_frequency = validated_data.pop("sync_frequency", None)
if sync_frequency and posthoganalytics.feature_enabled(
"data-modeling-backend-v2",
@@ -440,9 +494,6 @@ class DataWarehouseSavedQuerySerializer(
locked_instance.sync_frequency_interval = None
validated_data["sync_frequency_interval"] = None
elif sync_frequency:
- # Clamp deprecated 5min interval to 15min for saved queries
- if sync_frequency == "5min":
- sync_frequency = "15min"
sync_frequency_interval = sync_frequency_to_sync_frequency_interval(sync_frequency)
validated_data["sync_frequency_interval"] = sync_frequency_interval
locked_instance.sync_frequency_interval = sync_frequency_interval
diff --git a/products/data_warehouse/backend/api/test/test_saved_query.py b/products/data_warehouse/backend/api/test/test_saved_query.py
index a64aa62e2fbb..a2abf72d5711 100644
--- a/products/data_warehouse/backend/api/test/test_saved_query.py
+++ b/products/data_warehouse/backend/api/test/test_saved_query.py
@@ -6,6 +6,8 @@ from posthog.test.base import APIBaseTest
from unittest import mock
from unittest.mock import patch
+from parameterized import parameterized
+
from posthog.models import ActivityLog
from products.data_modeling.backend.models.data_modeling_job import DataModelingJob
@@ -627,6 +629,61 @@ class TestSavedQuery(APIBaseTest):
mock_workflow_exists.assert_called_once_with(saved_query)
mock_pause_saved_query_schedule.assert_called_once_with(saved_query)
+ def test_sync_frequency_is_a_writable_field(self):
+ # Regression: sync_frequency used to be a read-only SerializerMethodField, so it was
+ # marked readOnly in the generated OpenAPI/MCP schemas and silently dropped from writes.
+ from products.data_warehouse.backend.api.saved_query import DataWarehouseSavedQuerySerializer
+
+ field = DataWarehouseSavedQuerySerializer().fields["sync_frequency"]
+ self.assertFalse(field.read_only)
+
+ def _create_saved_query(self) -> dict:
+ response = self.client.post(
+ f"/api/environments/{self.team.id}/warehouse_saved_queries/",
+ {
+ "name": "event_view",
+ "query": {
+ "kind": "HogQLQuery",
+ "query": "select event as event from events LIMIT 100",
+ },
+ },
+ )
+ self.assertEqual(response.status_code, 201)
+ return response.json()
+
+ @parameterized.expand(
+ [
+ ("15min", "15min", timedelta(minutes=15)),
+ ("6hour", "6hour", timedelta(hours=6)),
+ ("1hour", "1hour", timedelta(hours=1)),
+ ("30day", "30day", timedelta(days=30)),
+ # Sub-15min cadences are deprecated for saved queries and clamped up to the "15min" floor.
+ ("5min", "15min", timedelta(minutes=15)),
+ ("1min", "15min", timedelta(minutes=15)),
+ ]
+ )
+ def test_update_sync_frequency_round_trip(self, sent: str, expected_value: str, expected_interval: timedelta):
+ saved_query = self._create_saved_query()
+
+ response = self.client.patch(
+ f"/api/environments/{self.team.id}/warehouse_saved_queries/{saved_query['id']}",
+ {"sync_frequency": sent},
+ )
+ self.assertEqual(response.status_code, 200, response.content)
+ self.assertEqual(response.json()["sync_frequency"], expected_value)
+
+ updated_query = DataWarehouseSavedQuery.objects.get(id=saved_query["id"])
+ self.assertEqual(updated_query.sync_frequency_interval, expected_interval)
+
+ def test_update_sync_frequency_rejects_invalid_value(self):
+ saved_query = self._create_saved_query()
+
+ response = self.client.patch(
+ f"/api/environments/{self.team.id}/warehouse_saved_queries/{saved_query['id']}",
+ {"sync_frequency": "every_fortnight"},
+ )
+ self.assertEqual(response.status_code, 400, response.content)
+
def test_update_with_types(self):
response = self.client.post(
f"/api/projects/{self.team.id}/warehouse_saved_queries/",
diff --git a/products/data_warehouse/frontend/generated/api.schemas.ts b/products/data_warehouse/frontend/generated/api.schemas.ts
index e2f422ac5c86..642ecba6c22b 100644
--- a/products/data_warehouse/frontend/generated/api.schemas.ts
+++ b/products/data_warehouse/frontend/generated/api.schemas.ts
@@ -533,6 +533,32 @@ export type DataWarehouseSavedQueryApiQuery = {
export type DataWarehouseSavedQueryApiColumnsItem = { [key: string]: unknown }
+/**
+ * * `never` - never
+ * * `15min` - 15min
+ * * `30min` - 30min
+ * * `1hour` - 1hour
+ * * `6hour` - 6hour
+ * * `12hour` - 12hour
+ * * `24hour` - 24hour
+ * * `7day` - 7day
+ * * `30day` - 30day
+ */
+export type SavedQuerySyncFrequencyEnumApi =
+ (typeof SavedQuerySyncFrequencyEnumApi)[keyof typeof SavedQuerySyncFrequencyEnumApi]
+
+export const SavedQuerySyncFrequencyEnumApi = {
+ Never: 'never',
+ '15min': '15min',
+ '30min': '30min',
+ '1hour': '1hour',
+ '6hour': '6hour',
+ '12hour': '12hour',
+ '24hour': '24hour',
+ '7day': '7day',
+ '30day': '30day',
+} as const
+
/**
* Shared methods for DataWarehouseSavedQuery serializers.
*
@@ -551,8 +577,18 @@ export interface DataWarehouseSavedQueryApi {
query: DataWarehouseSavedQueryApiQuery
readonly created_by: UserBasicApi
readonly created_at: string
- /** @nullable */
- readonly sync_frequency: string | null
+ /** How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.
+ *
+ * * `never` - never
+ * * `15min` - 15min
+ * * `30min` - 30min
+ * * `1hour` - 1hour
+ * * `6hour` - 6hour
+ * * `12hour` - 12hour
+ * * `24hour` - 24hour
+ * * `7day` - 7day
+ * * `30day` - 30day */
+ sync_frequency?: SavedQuerySyncFrequencyEnumApi | null
readonly columns: readonly DataWarehouseSavedQueryApiColumnsItem[]
/** The status of when this SavedQuery last ran.
*
@@ -652,8 +688,18 @@ export interface PatchedDataWarehouseSavedQueryApi {
query?: PatchedDataWarehouseSavedQueryApiQuery
readonly created_by?: UserBasicApi
readonly created_at?: string
- /** @nullable */
- readonly sync_frequency?: string | null
+ /** How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.
+ *
+ * * `never` - never
+ * * `15min` - 15min
+ * * `30min` - 30min
+ * * `1hour` - 1hour
+ * * `6hour` - 6hour
+ * * `12hour` - 12hour
+ * * `24hour` - 24hour
+ * * `7day` - 7day
+ * * `30day` - 30day */
+ sync_frequency?: SavedQuerySyncFrequencyEnumApi | null
readonly columns?: readonly PatchedDataWarehouseSavedQueryApiColumnsItem[]
/** The status of when this SavedQuery last ran.
*
diff --git a/products/data_warehouse/frontend/generated/api.zod.ts b/products/data_warehouse/frontend/generated/api.zod.ts
index 5cb73ca72415..7834f81ff193 100644
--- a/products/data_warehouse/frontend/generated/api.zod.ts
+++ b/products/data_warehouse/frontend/generated/api.zod.ts
@@ -190,6 +190,19 @@ export const WarehouseSavedQueriesCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -233,6 +246,19 @@ export const WarehouseSavedQueriesUpdateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -278,6 +304,19 @@ export const WarehouseSavedQueriesPartialUpdateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -325,6 +364,19 @@ export const WarehouseSavedQueriesAncestorsCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -368,6 +420,19 @@ export const WarehouseSavedQueriesCancelCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -415,6 +480,19 @@ export const WarehouseSavedQueriesDescendantsCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -458,6 +536,19 @@ export const WarehouseSavedQueriesMaterializeCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -504,6 +595,19 @@ export const WarehouseSavedQueriesRevertMaterializationCreateBody = /* @__PURE__
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -547,6 +651,19 @@ export const WarehouseSavedQueriesRunCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -593,6 +710,19 @@ export const WarehouseSavedQueriesResumeSchedulesCreateBody = /* @__PURE__ */ zo
.describe(
'HogQL query definition as a JSON object with a \"query\" key containing the SQL string and a \"kind\" key (always \"HogQLQuery\"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {\"kind\": \"HogQLQuery\", \"query\": \"SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100\"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n\* `never` - never\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
diff --git a/products/data_warehouse/mcp/tools.yaml b/products/data_warehouse/mcp/tools.yaml
index b2acbcccd386..f45d03018aa9 100644
--- a/products/data_warehouse/mcp/tools.yaml
+++ b/products/data_warehouse/mcp/tools.yaml
@@ -320,9 +320,10 @@ tools:
description: >
Update an existing data warehouse saved query (view). Can change the name, HogQL query, or sync frequency.
Changing the query triggers column re-inference and sets the status to 'modified'. Use sync_frequency to
- control materialization schedule: '24hour', '12hour', '6hour', '1hour', '30min', or 'never'. IMPORTANT: when
- updating the query field, you must first retrieve the view to get its latest_history_id, then pass that
- value as edited_history_id for conflict detection.
+ control materialization schedule: '15min' (the fastest cadence), '30min', '1hour', '6hour', '12hour',
+ '24hour', '7day', '30day', or 'never' to pause scheduled materialization. IMPORTANT: when updating the query
+ field, you must first retrieve the view to get its latest_history_id, then pass that value as
+ edited_history_id for conflict detection.
exclude_params:
- deleted
- soft_update
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index e1f0f4aa5856..82caeae53785 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -7404,7 +7404,7 @@
}
},
"view-update": {
- "description": "Update an existing data warehouse saved query (view). Can change the name, HogQL query, or sync frequency. Changing the query triggers column re-inference and sets the status to 'modified'. Use sync_frequency to control materialization schedule: '24hour', '12hour', '6hour', '1hour', '30min', or 'never'. IMPORTANT: when updating the query field, you must first retrieve the view to get its latest_history_id, then pass that value as edited_history_id for conflict detection.",
+ "description": "Update an existing data warehouse saved query (view). Can change the name, HogQL query, or sync frequency. Changing the query triggers column re-inference and sets the status to 'modified'. Use sync_frequency to control materialization schedule: '15min' (the fastest cadence), '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. IMPORTANT: when updating the query field, you must first retrieve the view to get its latest_history_id, then pass that value as edited_history_id for conflict detection.",
"category": "Data warehouse",
"feature": "data_warehouse",
"summary": "Update saved query",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 2e532f5c8abd..f65085a7f121 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -7927,7 +7927,7 @@
}
},
"view-update": {
- "description": "Update an existing data warehouse saved query (view). Can change the name, HogQL query, or sync frequency. Changing the query triggers column re-inference and sets the status to 'modified'. Use sync_frequency to control materialization schedule: '24hour', '12hour', '6hour', '1hour', '30min', or 'never'. IMPORTANT: when updating the query field, you must first retrieve the view to get its latest_history_id, then pass that value as edited_history_id for conflict detection.",
+ "description": "Update an existing data warehouse saved query (view). Can change the name, HogQL query, or sync frequency. Changing the query triggers column re-inference and sets the status to 'modified'. Use sync_frequency to control materialization schedule: '15min' (the fastest cadence), '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. IMPORTANT: when updating the query field, you must first retrieve the view to get its latest_history_id, then pass that value as edited_history_id for conflict detection.",
"category": "Data warehouse",
"feature": "data_warehouse",
"summary": "Update saved query",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 74fb0c0034d2..6f1f89614a54 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -14610,6 +14610,32 @@ export namespace Schemas {
export type DataWarehouseSavedQueryColumnsItem = { [key: string]: unknown };
+ /**
+ * * `never` - never
+ * * `15min` - 15min
+ * * `30min` - 30min
+ * * `1hour` - 1hour
+ * * `6hour` - 6hour
+ * * `12hour` - 12hour
+ * * `24hour` - 24hour
+ * * `7day` - 7day
+ * * `30day` - 30day
+ */
+ export type SavedQuerySyncFrequencyEnum = typeof SavedQuerySyncFrequencyEnum[keyof typeof SavedQuerySyncFrequencyEnum];
+
+
+ export const SavedQuerySyncFrequencyEnum = {
+ Never: 'never',
+ '15min': '15min',
+ '30min': '30min',
+ '1hour': '1hour',
+ '6hour': '6hour',
+ '12hour': '12hour',
+ '24hour': '24hour',
+ '7day': '7day',
+ '30day': '30day',
+ } as const;
+
/**
* * `Cancelled` - Cancelled
* * `Modified` - Modified
@@ -14660,8 +14686,18 @@ export namespace Schemas {
query: DataWarehouseSavedQueryQuery;
readonly created_by: UserBasic;
readonly created_at: string;
- /** @nullable */
- readonly sync_frequency: string | null;
+ /** How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.
+ *
+ * * `never` - never
+ * * `15min` - 15min
+ * * `30min` - 30min
+ * * `1hour` - 1hour
+ * * `6hour` - 6hour
+ * * `12hour` - 12hour
+ * * `24hour` - 24hour
+ * * `7day` - 7day
+ * * `30day` - 30day */
+ sync_frequency?: SavedQuerySyncFrequencyEnum | null;
readonly columns: readonly DataWarehouseSavedQueryColumnsItem[];
/** The status of when this SavedQuery last ran.
*
@@ -34820,8 +34856,18 @@ export namespace Schemas {
query?: PatchedDataWarehouseSavedQueryQuery;
readonly created_by?: UserBasic;
readonly created_at?: string;
- /** @nullable */
- readonly sync_frequency?: string | null;
+ /** How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.
+ *
+ * * `never` - never
+ * * `15min` - 15min
+ * * `30min` - 30min
+ * * `1hour` - 1hour
+ * * `6hour` - 6hour
+ * * `12hour` - 12hour
+ * * `24hour` - 24hour
+ * * `7day` - 7day
+ * * `30day` - 30day */
+ sync_frequency?: SavedQuerySyncFrequencyEnum | null;
readonly columns?: readonly PatchedDataWarehouseSavedQueryColumnsItem[];
/** The status of when this SavedQuery last ran.
*
diff --git a/services/mcp/src/generated/data_warehouse/api.ts b/services/mcp/src/generated/data_warehouse/api.ts
index adc599f4dc8f..382dee299b66 100644
--- a/services/mcp/src/generated/data_warehouse/api.ts
+++ b/services/mcp/src/generated/data_warehouse/api.ts
@@ -205,6 +205,19 @@ export const WarehouseSavedQueriesCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key (always "HogQLQuery"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {"kind": "HogQLQuery", "query": "SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -262,6 +275,19 @@ export const WarehouseSavedQueriesPartialUpdateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key (always "HogQLQuery"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {"kind": "HogQLQuery", "query": "SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -322,6 +348,19 @@ export const WarehouseSavedQueriesMaterializeCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key (always "HogQLQuery"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {"kind": "HogQLQuery", "query": "SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -377,6 +416,19 @@ export const WarehouseSavedQueriesRevertMaterializationCreateBody = /* @__PURE__
.describe(
'HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key (always "HogQLQuery"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {"kind": "HogQLQuery", "query": "SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
@@ -429,6 +481,19 @@ export const WarehouseSavedQueriesRunCreateBody = /* @__PURE__ */ zod
.describe(
'HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key (always "HogQLQuery"). Format the SQL string multi-line with indentation and inline `--` comments for non-obvious logic — the SQL editor renders it verbatim, so avoid minified single-line SQL. Example: {"kind": "HogQLQuery", "query": "SELECT\\n event,\\n count() AS cnt\\nFROM events\\nGROUP BY event\\nLIMIT 100"}'
),
+ sync_frequency: zod
+ .union([
+ zod
+ .enum(['never', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])
+ .describe(
+ '* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
+ ),
folder_id: zod
.uuid()
.nullish()
diff --git a/services/mcp/src/tools/generated/data_warehouse.ts b/services/mcp/src/tools/generated/data_warehouse.ts
index d5685bfbd5e3..33853b93c1ca 100644
--- a/services/mcp/src/tools/generated/data_warehouse.ts
+++ b/services/mcp/src/tools/generated/data_warehouse.ts
@@ -141,6 +141,9 @@ const viewCreate = (): ToolBase<typeof ViewCreateSchema, WithPostHogUrl<Schemas.
if (params.query !== undefined) {
body['query'] = params.query
}
+ if (params.sync_frequency !== undefined) {
+ body['sync_frequency'] = params.sync_frequency
+ }
if (params.folder_id !== undefined) {
body['folder_id'] = params.folder_id
}
@@ -243,6 +246,9 @@ const viewMaterialize = (): ToolBase<
if (params.query !== undefined) {
body['query'] = params.query
}
+ if (params.sync_frequency !== undefined) {
+ body['sync_frequency'] = params.sync_frequency
+ }
if (params.folder_id !== undefined) {
body['folder_id'] = params.folder_id
}
@@ -286,6 +292,9 @@ const viewRun = (): ToolBase<typeof ViewRunSchema, WithPostHogUrl<Schemas.DataWa
if (params.query !== undefined) {
body['query'] = params.query
}
+ if (params.sync_frequency !== undefined) {
+ body['sync_frequency'] = params.sync_frequency
+ }
if (params.folder_id !== undefined) {
body['folder_id'] = params.folder_id
}
@@ -347,6 +356,9 @@ const viewUnmaterialize = (): ToolBase<
if (params.query !== undefined) {
body['query'] = params.query
}
+ if (params.sync_frequency !== undefined) {
+ body['sync_frequency'] = params.sync_frequency
+ }
if (params.folder_id !== undefined) {
body['folder_id'] = params.folder_id
}
@@ -394,6 +406,9 @@ const viewUpdate = (): ToolBase<typeof ViewUpdateSchema, WithPostHogUrl<Schemas.
if (params.query !== undefined) {
body['query'] = params.query
}
+ if (params.sync_frequency !== undefined) {
+ body['sync_frequency'] = params.sync_frequency
+ }
if (params.folder_id !== undefined) {
body['folder_id'] = params.folder_id
}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-create.json
index e00e6dfd6e97..b0b3323b1d46 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-create.json
@@ -50,6 +50,19 @@
},
"required": ["query"],
"type": "object"
+ },
+ "sync_frequency": {
+ "anyOf": [
+ {
+ "description": "* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
}
},
"required": ["name", "query"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-materialize.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-materialize.json
index ab90f674a65c..0c7559ff3bec 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-materialize.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-materialize.json
@@ -86,6 +86,19 @@
}
],
"description": "If true, skip column inference and validation. For saving drafts."
+ },
+ "sync_frequency": {
+ "anyOf": [
+ {
+ "description": "* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
}
},
"required": ["id", "name", "query"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-run.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-run.json
index ab90f674a65c..0c7559ff3bec 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-run.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-run.json
@@ -86,6 +86,19 @@
}
],
"description": "If true, skip column inference and validation. For saving drafts."
+ },
+ "sync_frequency": {
+ "anyOf": [
+ {
+ "description": "* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
}
},
"required": ["id", "name", "query"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-unmaterialize.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-unmaterialize.json
index ab90f674a65c..0c7559ff3bec 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-unmaterialize.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-unmaterialize.json
@@ -86,6 +86,19 @@
}
],
"description": "If true, skip column inference and validation. For saving drafts."
+ },
+ "sync_frequency": {
+ "anyOf": [
+ {
+ "description": "* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
}
},
"required": ["id", "name", "query"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-update.json
index 7f695a1e901c..63b2c104428b 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/view-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/view-update.json
@@ -65,6 +65,19 @@
},
"required": ["query"],
"type": "object"
+ },
+ "sync_frequency": {
+ "anyOf": [
+ {
+ "description": "* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day",
+ "enum": ["never", "15min", "30min", "1hour", "6hour", "12hour", "24hour", "7day", "30day"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How often to materialize this view. One of '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day', or 'never' to pause scheduled materialization. 15min is the fastest cadence available.\n\n* `never` - never\n* `15min` - 15min\n* `30min` - 30min\n* `1hour` - 1hour\n* `6hour` - 6hour\n* `12hour` - 12hour\n* `24hour` - 24hour\n* `7day` - 7day\n* `30day` - 30day"
}
},
"required": ["id"],