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): allow null created_via on source update (#58670)

Sean Mallia669e2bcdc29f
diff --git a/products/data_warehouse/backend/api/external_data_source.py b/products/data_warehouse/backend/api/external_data_source.py
index 2d40bfbd0d67..05816aace925 100644
--- a/products/data_warehouse/backend/api/external_data_source.py
+++ b/products/data_warehouse/backend/api/external_data_source.py
@@ -402,9 +402,12 @@ class ExternalDataSourceSerializers(UserAccessControlSerializerMixin, serializer
# in the viewset to preserve backward compatibility with direct API callers that
# predate this field; the in-app UI and MCP tool always send it explicitly.
# `update` strips it to make the field write-once.
+ # `allow_null=True` because historical rows (created before migration 0049) have
+ # `created_via=NULL`, and the settings page spreads the GET payload back into PATCH.
created_via = serializers.ChoiceField(
choices=ExternalDataSource.CreatedVia.choices,
required=False,
+ allow_null=True,
help_text=(
"How this source was created. Defaults to `api` on create when omitted. "
"`web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. "
diff --git a/products/data_warehouse/backend/api/test/test_external_data_source.py b/products/data_warehouse/backend/api/test/test_external_data_source.py
index 03123b992220..669ce6e3f8b0 100644
--- a/products/data_warehouse/backend/api/test/test_external_data_source.py
+++ b/products/data_warehouse/backend/api/test/test_external_data_source.py
@@ -348,6 +348,23 @@ class TestExternalDataSource(APIBaseTest):
source.refresh_from_db()
assert source.created_via == ExternalDataSource.CreatedVia.WEB
+ def test_patch_external_data_source_accepts_null_created_via(self):
+ # Historical rows created before migration 0049 have created_via=NULL. The
+ # settings page spreads the GET payload back into PATCH, so null round-trips
+ # through the serializer. allow_null=True keeps that path working.
+ source = self._create_external_data_source()
+ ExternalDataSource.objects.filter(pk=source.pk).update(created_via=None)
+
+ response = self.client.patch(
+ f"/api/environments/{self.team.pk}/external_data_sources/{source.pk}/",
+ data={"created_via": None, "description": "edited"},
+ )
+
+ assert response.status_code == 200, response.json()
+ source.refresh_from_db()
+ assert source.created_via is None
+ assert source.description == "edited"
+
@patch(
"products.data_warehouse.backend.api.external_data_schema.external_data_workflow_exists",
return_value=False,
diff --git a/products/data_warehouse/frontend/generated/api.schemas.ts b/products/data_warehouse/frontend/generated/api.schemas.ts
index 20602ec85906..29a8e246e203 100644
--- a/products/data_warehouse/frontend/generated/api.schemas.ts
+++ b/products/data_warehouse/frontend/generated/api.schemas.ts
@@ -750,7 +750,7 @@ export interface ExternalDataSourceSerializersApi {
* `web` - web
* `api` - api
* `mcp` - mcp */
- created_via?: CreatedViaEnumApi
+ created_via?: CreatedViaEnumApi | null
readonly status: string
client_secret: string
account_id: string
@@ -990,7 +990,7 @@ export interface PatchedExternalDataSourceSerializersApi {
* `web` - web
* `api` - api
* `mcp` - mcp */
- created_via?: CreatedViaEnumApi
+ created_via?: CreatedViaEnumApi | null
readonly status?: string
client_secret?: string
account_id?: string
diff --git a/products/data_warehouse/frontend/generated/api.zod.ts b/products/data_warehouse/frontend/generated/api.zod.ts
index f9986e1b4d66..5e2dcda09a6b 100644
--- a/products/data_warehouse/frontend/generated/api.zod.ts
+++ b/products/data_warehouse/frontend/generated/api.zod.ts
@@ -735,8 +735,10 @@ export const externalDataSourcesUpdateBodyDescriptionMax = 400
export const ExternalDataSourcesUpdateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -759,8 +761,10 @@ export const externalDataSourcesPartialUpdateBodyDescriptionMax = 400
export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -829,8 +833,10 @@ export const externalDataSourcesCreateWebhookCreateBodyDescriptionMax = 400
export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -853,8 +859,10 @@ export const externalDataSourcesDeleteWebhookCreateBodyDescriptionMax = 400
export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -877,8 +885,10 @@ export const externalDataSourcesRefreshSchemasCreateBodyDescriptionMax = 400
export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -901,8 +911,10 @@ export const externalDataSourcesReloadCreateBodyDescriptionMax = 400
export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -925,8 +937,10 @@ export const externalDataSourcesRevenueAnalyticsConfigPartialUpdateBodyDescripti
export const ExternalDataSourcesRevenueAnalyticsConfigPartialUpdateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -952,8 +966,10 @@ export const externalDataSourcesUpdateWebhookInputsCreateBodyDescriptionMax = 40
export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
@@ -1139,8 +1155,10 @@ export const externalDataSourcesSourcePrefixCreateBodyDescriptionMax = 400
export const ExternalDataSourcesSourcePrefixCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent\/MCP tool calls. Ignored on update.\n\n\* `web` - web\n\* `api` - api\n\* `mcp` - mcp'
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 8ee301d2a160..b2d15a24a005 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -15960,7 +15960,7 @@ export namespace Schemas {
* `web` - web
* `api` - api
* `mcp` - mcp */
- created_via?: CreatedViaEnum;
+ created_via?: CreatedViaEnum | null;
readonly status: string;
client_secret: string;
account_id: string;
@@ -26732,7 +26732,7 @@ export namespace Schemas {
* `web` - web
* `api` - api
* `mcp` - mcp */
- created_via?: CreatedViaEnum;
+ created_via?: CreatedViaEnum | null;
readonly status?: string;
client_secret?: string;
account_id?: string;
diff --git a/services/mcp/src/generated/data_warehouse/api.ts b/services/mcp/src/generated/data_warehouse/api.ts
index 7542543aa5a1..6d2a46f29854 100644
--- a/services/mcp/src/generated/data_warehouse/api.ts
+++ b/services/mcp/src/generated/data_warehouse/api.ts
@@ -679,8 +679,10 @@ export const externalDataSourcesPartialUpdateBodyDescriptionMax = 400
export const ExternalDataSourcesPartialUpdateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('* `web` - web\n* `api` - api\n* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
@@ -724,8 +726,10 @@ export const externalDataSourcesCreateWebhookCreateBodyDescriptionMax = 400
export const ExternalDataSourcesCreateWebhookCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('* `web` - web\n* `api` - api\n* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
@@ -757,8 +761,10 @@ export const externalDataSourcesDeleteWebhookCreateBodyDescriptionMax = 400
export const ExternalDataSourcesDeleteWebhookCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('* `web` - web\n* `api` - api\n* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
@@ -786,8 +792,10 @@ export const ExternalDataSourcesRefreshSchemasCreateParams = /* @__PURE__ */ zod
export const ExternalDataSourcesRefreshSchemasCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('* `web` - web\n* `api` - api\n* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
@@ -810,8 +818,10 @@ export const ExternalDataSourcesReloadCreateParams = /* @__PURE__ */ zod.object(
export const ExternalDataSourcesReloadCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('* `web` - web\n* `api` - api\n* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
@@ -838,8 +848,10 @@ export const externalDataSourcesUpdateWebhookInputsCreateBodyDescriptionMax = 40
export const ExternalDataSourcesUpdateWebhookInputsCreateBody = /* @__PURE__ */ zod
.object({
created_via: zod
- .enum(['web', 'api', 'mcp'])
- .describe('* `web` - web\n* `api` - api\n* `mcp` - mcp')
+ .union([
+ zod.enum(['web', 'api', 'mcp']).describe('* `web` - web\n* `api` - api\n* `mcp` - mcp'),
+ zod.null(),
+ ])
.optional()
.describe(
'How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp'
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-create-webhook-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-create-webhook-create.json
index 2eb6e4a66cf7..9d1ee749b002 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-create-webhook-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-create-webhook-create.json
@@ -8,9 +8,17 @@
"type": "string"
},
"created_via": {
- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp",
- "enum": ["web", "api", "mcp"],
- "type": "string"
+ "anyOf": [
+ {
+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp",
+ "enum": ["web", "api", "mcp"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
"description": {
"anyOf": [
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-delete-webhook-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-delete-webhook-create.json
index 2eb6e4a66cf7..9d1ee749b002 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-delete-webhook-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-delete-webhook-create.json
@@ -8,9 +8,17 @@
"type": "string"
},
"created_via": {
- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp",
- "enum": ["web", "api", "mcp"],
- "type": "string"
+ "anyOf": [
+ {
+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp",
+ "enum": ["web", "api", "mcp"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
"description": {
"anyOf": [
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-partial-update.json
index 76fe24802941..2aa7763e66a9 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-partial-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-partial-update.json
@@ -8,9 +8,17 @@
"type": "string"
},
"created_via": {
- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp",
- "enum": ["web", "api", "mcp"],
- "type": "string"
+ "anyOf": [
+ {
+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp",
+ "enum": ["web", "api", "mcp"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
"description": {
"anyOf": [
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-refresh-schemas.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-refresh-schemas.json
index f62df5608512..e41365059ed5 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-refresh-schemas.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-refresh-schemas.json
@@ -2,9 +2,17 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"created_via": {
- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp",
- "enum": ["web", "api", "mcp"],
- "type": "string"
+ "anyOf": [
+ {
+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp",
+ "enum": ["web", "api", "mcp"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
"id": {
"description": "A UUID string identifying this external data source.",
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-reload.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-reload.json
index f62df5608512..e41365059ed5 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-reload.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-reload.json
@@ -2,9 +2,17 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"created_via": {
- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp",
- "enum": ["web", "api", "mcp"],
- "type": "string"
+ "anyOf": [
+ {
+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp",
+ "enum": ["web", "api", "mcp"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
"id": {
"description": "A UUID string identifying this external data source.",
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-update-webhook-inputs-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-update-webhook-inputs-create.json
index 2eb6e4a66cf7..9d1ee749b002 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-update-webhook-inputs-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/common/external-data-sources-update-webhook-inputs-create.json
@@ -8,9 +8,17 @@
"type": "string"
},
"created_via": {
- "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp",
- "enum": ["web", "api", "mcp"],
- "type": "string"
+ "anyOf": [
+ {
+ "description": "* `web` - web\n* `api` - api\n* `mcp` - mcp",
+ "enum": ["web", "api", "mcp"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "How this source was created. Defaults to `api` on create when omitted. `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. Ignored on update.\n\n* `web` - web\n* `api` - api\n* `mcp` - mcp"
},
"description": {
"anyOf": [