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.

feat(subscriptions): expose AI subscriptions + ad-hoc reports as MCP tools (#59633)

Vasco de Krijgerb50cf9191e91
diff --git a/ee/api/subscription.py b/ee/api/subscription.py
index 64f4f8574aa5..3c150d49728a 100644
--- a/ee/api/subscription.py
+++ b/ee/api/subscription.py
@@ -38,7 +38,6 @@ from posthog.exceptions_capture import capture_exception
from posthog.models.integration import Integration
from posthog.rate_limit import SubscriptionTestDeliveryThrottle
from posthog.resource_limits import LimitKey, check_count_limit, get_organization_limit
-from posthog.security.url_validation import is_url_allowed
from posthog.slo.context import SloSpec, slo_operation
from posthog.slo.types import SloArea, SloOperation
from posthog.temporal.common.client import sync_connect
@@ -202,9 +201,9 @@ class SubscriptionSerializer(serializers.ModelSerializer):
},
"dashboard": {"help_text": "Dashboard ID to subscribe to (mutually exclusive with insight on create)."},
"insight": {"help_text": "Insight ID to subscribe to (mutually exclusive with dashboard on create)."},
- "target_type": {"help_text": "Delivery channel: email, slack, or webhook."},
+ "target_type": {"help_text": "Delivery channel: email or slack."},
"target_value": {
- "help_text": "Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook."
+ "help_text": "Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack."
},
"frequency": {"help_text": "How often to deliver: daily, weekly, monthly, or yearly."},
"interval": {
@@ -393,13 +392,6 @@ class SubscriptionSerializer(serializers.ModelSerializer):
if integration.kind != "slack":
raise ValidationError({"integration_id": ["Slack subscriptions require a Slack integration."]})
- # SSRF protection for webhook subscriptions
- target_value = attrs.get("target_value") or (self.instance.target_value if self.instance else None)
- if target_type == Subscription.SubscriptionTarget.WEBHOOK and target_value:
- allowed, error = is_url_allowed(target_value)
- if not allowed:
- raise ValidationError({"target_value": [f"Invalid webhook URL: {error}"]})
-
# Only gate non-empty writes to `summary_prompt_guide`. Clearing (empty string)
# and field-absent PATCHes always pass through so users aren't stuck with a value
# they can no longer edit if the flag flips off after they set one.
@@ -752,7 +744,7 @@ class SubscriptionSerializer(serializers.ModelSerializer):
enum=[m.value for m in Subscription.SubscriptionTarget],
location=OpenApiParameter.QUERY,
required=False,
- description="Filter by delivery channel (email, Slack, or webhook).",
+ description="Filter by delivery channel (email or Slack).",
),
OpenApiParameter(
name="insight",
@@ -1028,7 +1020,7 @@ class SubscriptionDeliverySerializer(serializers.ModelSerializer):
"idempotency_key": {"help_text": "Dedupes activity retries for the same logical run."},
"trigger_type": {"help_text": "Why the run started (e.g. scheduled, manual, target_change)."},
"scheduled_at": {"help_text": "Planned send time when applicable."},
- "target_type": {"help_text": "Channel snapshot at send time (email, slack, webhook)."},
+ "target_type": {"help_text": "Channel snapshot at send time (email or slack)."},
"target_value": {"help_text": "Destination snapshot at send time (emails, channel id, URL)."},
"exported_asset_ids": {"help_text": "ExportedAsset ids generated for this send."},
"content_snapshot": {
diff --git a/ee/api/test/test_subscription.py b/ee/api/test/test_subscription.py
index f510a85ecc44..1bedd8b8039e 100644
--- a/ee/api/test/test_subscription.py
+++ b/ee/api/test/test_subscription.py
@@ -1317,7 +1317,7 @@ class TestSubscriptionTemporal(APILicensedTest):
assert results[0]["title"] == "DifferentTitle"
@parameterized.expand(
- [("slack",), ("webhook",), ("email",)],
+ [("slack",), ("email",)],
name_func=lambda f, _n, p: f"{f.__name__}__{p.args[0]}",
)
def test_list_subscriptions_filter_by_target_type(self, target_type):
@@ -1330,12 +1330,6 @@ class TestSubscriptionTemporal(APILicensedTest):
target_value="C1234|#general",
integration_id=slack_integration.id,
)
- elif target_type == "webhook":
- create_res = self._create_subscription(
- title="Webhook sub",
- target_type="webhook",
- target_value="https://example.com/hook",
- )
else:
create_res = self._create_subscription(title="Email only sub")
assert create_res.status_code == status.HTTP_201_CREATED
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 2c438a275556..894328f5c650 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -5975,9 +5975,9 @@ snapshots:
scenes-app-subscriptions-subscription-summary--insight-many-destinations--light:
hash: v1.k794b7964.7968690ed0c205c44a124a590d4378a488129c505f67436dbf3ccaa4b1127492.8bq6koR9lVBh_hOICo4GHZrNdYCDfasqz8VoDggeGsA
scenes-app-subscriptions-subscriptionstable--default--dark:
- hash: v1.k794b7964.b3f3b2c01567c7d72eba23504db526930781bbe753a4b4f020ed51aae676cfbd.tPRkawUFWJVsNMD1uAKT-Zm7kKp0-o-UudlAMTMwJXk
+ hash: v1.k794b7964.4f2d2daab150bf124d3c87737f21278ac20890d48795cee2e96bf0ca02b409e0.ymAnfMG5s4S_yoEXZp-y33G9Q_-RimQFj2w1B8jNyr8
scenes-app-subscriptions-subscriptionstable--default--light:
- hash: v1.k794b7964.283b6f5441a9bb131568f8cc918a7fa1da1c52bd1f9945668439ecd32d0acf5e.7nxMCGUyAGRC9ggvUdXH-WUKTbuopflGU1tFI_AUUVQ
+ hash: v1.k794b7964.74680a85aef1d9debc138b2233263c85dffc675752434007d63b20c45d14a10f.arV0wBxVL0hdosuF5V75r8-oLm5aB8uSxPsxvWlMrFE
scenes-app-subscriptions-subscriptionstable--with-pagination--dark:
hash: v1.k794b7964.4620b970b0112abfa403d669108c4aaa5a441fbca38949603551a4fd80f4830f.gBSKjxx7cakZ6Plja9cr9m-RmX1ZMOr-xO80xSCaQEU
scenes-app-subscriptions-subscriptionstable--with-pagination--light:
diff --git a/frontend/src/lib/components/Subscriptions/subscriptionLogic.ts b/frontend/src/lib/components/Subscriptions/subscriptionLogic.ts
index 58e11a0c9fab..dfb639f80afe 100644
--- a/frontend/src/lib/components/Subscriptions/subscriptionLogic.ts
+++ b/frontend/src/lib/components/Subscriptions/subscriptionLogic.ts
@@ -8,7 +8,7 @@ import api, { ApiError } from 'lib/api'
import { dayjs } from 'lib/dayjs'
import { recordRecentSlackChannel, slackChannelId } from 'lib/integrations/slackChannel'
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
-import { isEmail, isURL } from 'lib/utils'
+import { isEmail } from 'lib/utils'
import { getInsightId } from 'scenes/insights/utils'
import { ExportedAssetType, ExporterFormat, SubscriptionResourceTypes, SubscriptionType } from '~/types'
@@ -140,9 +140,7 @@ export const subscriptionLogic = kea<subscriptionLogicType>([
title: !title ? 'You need to give your subscription a name' : undefined,
interval: !interval ? 'You need to set an interval' : undefined,
start_date: !start_date ? 'You need to set a delivery time' : undefined,
- target_type: !['slack', 'email', 'webhook'].includes(target_type)
- ? 'Unsupported target type'
- : undefined,
+ target_type: !['slack', 'email'].includes(target_type) ? 'Unsupported target type' : undefined,
prompt: validatePrompt(resource_type, prompt),
target_value: !target_value
? 'This field is required.'
@@ -156,11 +154,7 @@ export const subscriptionLogic = kea<subscriptionLogicType>([
? !target_value
? 'A channel is required'
: undefined
- : target_type == 'webhook'
- ? !isURL(target_value)
- ? 'Must be a valid URL'
- : undefined
- : undefined,
+ : undefined,
dashboard_export_insights:
resource_type !== SubscriptionResourceTypes.AiPrompt &&
props.dashboardId &&
diff --git a/frontend/src/lib/components/Subscriptions/utils.tsx b/frontend/src/lib/components/Subscriptions/utils.tsx
index e22c602d5cbe..c57464e9a0e1 100644
--- a/frontend/src/lib/components/Subscriptions/utils.tsx
+++ b/frontend/src/lib/components/Subscriptions/utils.tsx
@@ -43,7 +43,6 @@ export const urlForSubscription = (
export const targetTypeOptions: LemonSelectOptions<'email' | 'slack'> = [
{ value: 'email', label: 'Email', icon: <IconLetter /> },
{ value: 'slack', label: 'Slack', icon: <IconSlack /> },
- // { value: 'webhook', label: 'Webhook', icon: <IconOpenInNew /> },
]
export const intervalOptions: LemonSelectOptions<number> = range(1, 13).map((x) => ({ value: x, label: x.toString() }))
diff --git a/frontend/src/lib/components/Subscriptions/views/EditSubscription.tsx b/frontend/src/lib/components/Subscriptions/views/EditSubscription.tsx
index 68b06cd276e7..591cd6669146 100644
--- a/frontend/src/lib/components/Subscriptions/views/EditSubscription.tsx
+++ b/frontend/src/lib/components/Subscriptions/views/EditSubscription.tsx
@@ -552,18 +552,6 @@ function EditSubscriptionForm({
</>
) : null}
- {subscription.target_type === 'webhook' ? (
- <>
- <LemonField name="target_value" label="Webhook URL">
- <LemonInput placeholder="https://example.com/webhooks/1234" />
- </LemonField>
- <div className="text-xs text-secondary mt-2">
- Webhooks will be called with a HTTP POST request. The webhook endpoint should
- respond with a healthy HTTP code (2xx).
- </div>
- </>
- ) : null}
-
<div>
<div className="flex items-baseline justify-between w-full">
<LemonLabel className="mb-2">Recurrence</LemonLabel>
diff --git a/frontend/src/scenes/subscriptions/components/SubscriptionsFiltersBar.tsx b/frontend/src/scenes/subscriptions/components/SubscriptionsFiltersBar.tsx
index 355983bd5ea7..65fa55f903df 100644
--- a/frontend/src/scenes/subscriptions/components/SubscriptionsFiltersBar.tsx
+++ b/frontend/src/scenes/subscriptions/components/SubscriptionsFiltersBar.tsx
@@ -14,7 +14,6 @@ const CHANNEL_FILTER_OPTIONS: { label: string; value: SubscriptionsListTargetTyp
{ label: 'All channels', value: null },
{ label: 'Email', value: TargetTypeEnumApi.Email },
{ label: 'Slack', value: TargetTypeEnumApi.Slack },
- { label: 'Webhook', value: TargetTypeEnumApi.Webhook },
]
export function SubscriptionsFiltersBar(): JSX.Element {
diff --git a/frontend/src/scenes/subscriptions/components/SubscriptionsTable.stories.tsx b/frontend/src/scenes/subscriptions/components/SubscriptionsTable.stories.tsx
index 528ee5607c9c..9475718c8528 100644
--- a/frontend/src/scenes/subscriptions/components/SubscriptionsTable.stories.tsx
+++ b/frontend/src/scenes/subscriptions/components/SubscriptionsTable.stories.tsx
@@ -93,12 +93,12 @@ const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
resource_type: ResourceTypeEnumApi.Insight,
insight: 104,
dashboard: null,
- insight_short_id: 'webhook-insight',
+ insight_short_id: 'activation-insight',
resource_name: 'Activation funnel',
- title: 'Webhook delivery to internal automation',
+ title: 'Slack delivery to internal automation',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Webhook,
- target_value: 'https://hooks.example.com/services/posthog/subscriptions/abc123def456',
+ target_type: TargetTypeEnumApi.Slack,
+ target_value: 'C1234567890|#automation-alerts',
frequency: SubscriptionFrequencyEnumApi.Weekly,
interval: 1,
start_date: '2022-01-01T00:00:00Z',
diff --git a/frontend/src/scenes/subscriptions/components/subscriptionLabels.ts b/frontend/src/scenes/subscriptions/components/subscriptionLabels.ts
index a72ff597d52b..f9be43604757 100644
--- a/frontend/src/scenes/subscriptions/components/subscriptionLabels.ts
+++ b/frontend/src/scenes/subscriptions/components/subscriptionLabels.ts
@@ -4,5 +4,4 @@ import { TargetTypeEnumApi } from '@posthog/products-subscriptions/frontend/gene
export const TARGET_TYPE_LABEL: Record<SubscriptionApi['target_type'], string> = {
[TargetTypeEnumApi.Email]: 'Email',
[TargetTypeEnumApi.Slack]: 'Slack',
- [TargetTypeEnumApi.Webhook]: 'Webhook',
}
diff --git a/frontend/src/scenes/subscriptions/subscriptionsSceneLogic.tsx b/frontend/src/scenes/subscriptions/subscriptionsSceneLogic.tsx
index 53ba5c70882a..102f13509592 100644
--- a/frontend/src/scenes/subscriptions/subscriptionsSceneLogic.tsx
+++ b/frontend/src/scenes/subscriptions/subscriptionsSceneLogic.tsx
@@ -74,9 +74,7 @@ function parseSubscriptionsSearchParams(searchParams: Record<string, unknown>):
const ttRaw = searchParams['target_type']
const targetTypeFilter: SubscriptionsListTargetType | null =
- ttRaw === TargetTypeEnumApi.Email || ttRaw === TargetTypeEnumApi.Slack || ttRaw === TargetTypeEnumApi.Webhook
- ? ttRaw
- : null
+ ttRaw === TargetTypeEnumApi.Email || ttRaw === TargetTypeEnumApi.Slack ? ttRaw : null
let page = 1
const pageRaw = searchParams['page']
diff --git a/products/exports/backend/migrations/0003_alter_subscription_target_type.py b/products/exports/backend/migrations/0003_alter_subscription_target_type.py
new file mode 100644
index 000000000000..0d02858fd81b
--- /dev/null
+++ b/products/exports/backend/migrations/0003_alter_subscription_target_type.py
@@ -0,0 +1,17 @@
+# Generated by Django 5.2.14 on 2026-06-08 12:47
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("exports", "0002_subscription_prompt"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="subscription",
+ name="target_type",
+ field=models.CharField(choices=[("email", "Email"), ("slack", "Slack")], max_length=10),
+ ),
+ ]
diff --git a/products/exports/backend/migrations/max_migration.txt b/products/exports/backend/migrations/max_migration.txt
index 7f7c1b396bf4..7e6c11d968bb 100644
--- a/products/exports/backend/migrations/max_migration.txt
+++ b/products/exports/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0002_subscription_prompt
+0003_alter_subscription_target_type
diff --git a/products/exports/backend/models/subscription.py b/products/exports/backend/models/subscription.py
index 8494dd852d32..30f30ca29983 100644
--- a/products/exports/backend/models/subscription.py
+++ b/products/exports/backend/models/subscription.py
@@ -63,7 +63,6 @@ class Subscription(ModelActivityMixin, models.Model):
class SubscriptionTarget(models.TextChoices):
EMAIL = "email"
SLACK = "slack"
- WEBHOOK = "webhook"
class SubscriptionFrequency(models.TextChoices):
DAILY = "daily"
diff --git a/products/subscriptions/frontend/generated/api.schemas.ts b/products/subscriptions/frontend/generated/api.schemas.ts
index 18370b68d93a..a27e5c3d02b4 100644
--- a/products/subscriptions/frontend/generated/api.schemas.ts
+++ b/products/subscriptions/frontend/generated/api.schemas.ts
@@ -39,7 +39,7 @@ export interface SubscriptionDeliveryApi {
* @nullable
*/
readonly scheduled_at: string | null
- /** Channel snapshot at send time (email, slack, webhook). */
+ /** Channel snapshot at send time (email or slack). */
readonly target_type: string
/** Destination snapshot at send time (emails, channel id, URL). */
readonly target_value: string
@@ -98,14 +98,12 @@ export const ResourceTypeEnumApi = {
/**
* * `email` - Email
* `slack` - Slack
- * `webhook` - Webhook
*/
export type TargetTypeEnumApi = (typeof TargetTypeEnumApi)[keyof typeof TargetTypeEnumApi]
export const TargetTypeEnumApi = {
Email: 'email',
Slack: 'slack',
- Webhook: 'webhook',
} as const
/**
@@ -233,13 +231,12 @@ export interface SubscriptionApi {
* @nullable
*/
prompt?: string | null
- /** Delivery channel: email, slack, or webhook.
+ /** Delivery channel: email or slack.
* `email` - Email
- * `slack` - Slack
- * `webhook` - Webhook */
+ * `slack` - Slack */
target_type: TargetTypeEnumApi
- /** Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook. */
+ /** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value: string
/** How often to deliver: daily, weekly, monthly, or yearly.
@@ -374,13 +371,12 @@ export interface PatchedSubscriptionApi {
* @nullable
*/
prompt?: string | null
- /** Delivery channel: email, slack, or webhook.
+ /** Delivery channel: email or slack.
* `email` - Email
- * `slack` - Slack
- * `webhook` - Webhook */
+ * `slack` - Slack */
target_type?: TargetTypeEnumApi
- /** Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook. */
+ /** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value?: string
/** How often to deliver: daily, weekly, monthly, or yearly.
@@ -507,7 +503,7 @@ export type SubscriptionsListParams = {
*/
search?: string
/**
- * Filter by delivery channel (email, Slack, or webhook).
+ * Filter by delivery channel (email or Slack).
*/
target_type?: SubscriptionsListTargetType
}
@@ -526,7 +522,6 @@ export type SubscriptionsListTargetType = (typeof SubscriptionsListTargetType)[k
export const SubscriptionsListTargetType = {
Email: 'email',
Slack: 'slack',
- Webhook: 'webhook',
} as const
export type SubscriptionsSummaryQuotaRetrieve200 = {
diff --git a/products/subscriptions/frontend/generated/api.zod.ts b/products/subscriptions/frontend/generated/api.zod.ts
index 4295f66aac65..9f5f6153ad9d 100644
--- a/products/subscriptions/frontend/generated/api.zod.ts
+++ b/products/subscriptions/frontend/generated/api.zod.ts
@@ -44,16 +44,12 @@ export const SubscriptionsCreateBody = /* @__PURE__ */ zod
"Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters."
),
target_type: zod
- .enum(['email', 'slack', 'webhook'])
- .describe('\* `email` - Email\n\* `slack` - Slack\n\* `webhook` - Webhook')
- .describe(
- 'Delivery channel: email, slack, or webhook.\n\n\* `email` - Email\n\* `slack` - Slack\n\* `webhook` - Webhook'
- ),
+ .enum(['email', 'slack'])
+ .describe('\* `email` - Email\n\* `slack` - Slack')
+ .describe('Delivery channel: email or slack.\n\n\* `email` - Email\n\* `slack` - Slack'),
target_value: zod
.string()
- .describe(
- 'Recipient(s): comma-separated email addresses for email, Slack channel name\/ID for slack, or full URL for webhook.'
- ),
+ .describe('Recipient(s): comma-separated email addresses for email, or Slack channel name\/ID for slack.'),
frequency: zod
.enum(['daily', 'weekly', 'monthly', 'yearly'])
.describe('\* `daily` - Daily\n\* `weekly` - Weekly\n\* `monthly` - Monthly\n\* `yearly` - Yearly')
@@ -156,16 +152,12 @@ export const SubscriptionsUpdateBody = /* @__PURE__ */ zod
"Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters."
),
target_type: zod
- .enum(['email', 'slack', 'webhook'])
- .describe('\* `email` - Email\n\* `slack` - Slack\n\* `webhook` - Webhook')
- .describe(
- 'Delivery channel: email, slack, or webhook.\n\n\* `email` - Email\n\* `slack` - Slack\n\* `webhook` - Webhook'
- ),
+ .enum(['email', 'slack'])
+ .describe('\* `email` - Email\n\* `slack` - Slack')
+ .describe('Delivery channel: email or slack.\n\n\* `email` - Email\n\* `slack` - Slack'),
target_value: zod
.string()
- .describe(
- 'Recipient(s): comma-separated email addresses for email, Slack channel name\/ID for slack, or full URL for webhook.'
- ),
+ .describe('Recipient(s): comma-separated email addresses for email, or Slack channel name\/ID for slack.'),
frequency: zod
.enum(['daily', 'weekly', 'monthly', 'yearly'])
.describe('\* `daily` - Daily\n\* `weekly` - Weekly\n\* `monthly` - Monthly\n\* `yearly` - Yearly')
@@ -268,18 +260,14 @@ export const SubscriptionsPartialUpdateBody = /* @__PURE__ */ zod
"Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters."
),
target_type: zod
- .enum(['email', 'slack', 'webhook'])
- .describe('\* `email` - Email\n\* `slack` - Slack\n\* `webhook` - Webhook')
+ .enum(['email', 'slack'])
+ .describe('\* `email` - Email\n\* `slack` - Slack')
.optional()
- .describe(
- 'Delivery channel: email, slack, or webhook.\n\n\* `email` - Email\n\* `slack` - Slack\n\* `webhook` - Webhook'
- ),
+ .describe('Delivery channel: email or slack.\n\n\* `email` - Email\n\* `slack` - Slack'),
target_value: zod
.string()
.optional()
- .describe(
- 'Recipient(s): comma-separated email addresses for email, Slack channel name\/ID for slack, or full URL for webhook.'
- ),
+ .describe('Recipient(s): comma-separated email addresses for email, or Slack channel name\/ID for slack.'),
frequency: zod
.enum(['daily', 'weekly', 'monthly', 'yearly'])
.describe('\* `daily` - Daily\n\* `weekly` - Weekly\n\* `monthly` - Monthly\n\* `yearly` - Yearly')
diff --git a/products/subscriptions/mcp/tools.yaml b/products/subscriptions/mcp/tools.yaml
index 04efe1c517b0..68fb85982396 100644
--- a/products/subscriptions/mcp/tools.yaml
+++ b/products/subscriptions/mcp/tools.yaml
@@ -20,20 +20,54 @@ tools:
idempotent: false
title: Create subscription
description: >
- Create a new subscription to receive scheduled deliveries of an insight or dashboard. Requires either an
- insight ID or dashboard ID. Set target_type to email, slack, or webhook and target_value to the
- recipient(s). For email: comma-separated addresses. For slack: requires an integration_id for a connected
- Slack workspace plus a channel name in target_value. For webhook: a URL. Set frequency (daily, weekly,
- monthly, yearly) and interval (required, minimum 1 — use 1 for no multiplier; e.g. 2 with weekly = every 2
- weeks), plus optional byweekday, start_date, and until_date. Dashboard subscriptions also require
- dashboard_export_insights (list of insight IDs from that dashboard, max 6).
+ Create a recurring subscription. The kind is inferred from which field you populate and returned as the
+ read-only `resource_type`:
+
+ (1) set `insight` — schedule periodic snapshots of one insight (`resource_type: "insight"`).
+
+ (2) set `dashboard` and `dashboard_export_insights` (the subset of the dashboard's insights to include, max
+ 6) — schedule periodic snapshots of one dashboard (`resource_type: "dashboard"`).
+
+ (3) set `prompt` (≤4000 chars, with no insight or dashboard) — schedule a recurring LLM-generated report
+ (`resource_type: "ai_prompt"`). Available on PostHog Cloud (self-hosted production is not eligible) once the
+ organization has approved AI data processing and prompt subscriptions are enabled for it; otherwise create
+ is rejected with a 400. Creating a prompt subscription also requires the `query:read` scope — the report
+ runs LLM-generated HogQL over your data — so a `subscription:write`-only token is rejected for this kind.
+
+ Delivery is set by `target_type` — `email` or `slack`.
+
+ The kind is fixed at create time — a PATCH that would change the populated relation to a different kind is
+ rejected.
exclude_params:
- - created_by
+ - deleted
- next_delivery_date
- - summary
- - insight_short_id
- resource_name
- - prompt
+ - insight_short_id
+ - invite_message
+ - summary_enabled
+ - summary_prompt_guide
+ subscriptions-delete:
+ operation: subscriptions_destroy
+ enabled: true
+ scopes:
+ - subscription:write
+ annotations:
+ readOnly: false
+ destructive: true
+ idempotent: true
+ title: Delete subscription
+ description: >
+ Soft-delete a subscription. Stops all future deliveries and returns the subscription with `deleted: true`.
+ One-way via MCP — there is no restore tool, so re-create the subscription if you need it back. Deleting an
+ prompt subscription additionally requires the `query:read` scope (the backend gates every write touching a
+ prompt subscription on query access).
+ param_overrides:
+ id:
+ cast: string-int
+ soft_delete: true
+ response:
+ exclude:
+ - invite_message
subscriptions-deliveries-list:
operation: subscriptions_deliveries_list
enabled: true
@@ -77,9 +111,6 @@ tools:
- content_snapshot
- recipient_results
- error
- subscriptions-destroy:
- operation: subscriptions_destroy
- enabled: false
subscriptions-list:
operation: subscriptions_list
enabled: true
@@ -92,9 +123,12 @@ tools:
list: true
title: List subscriptions
description: >
- List subscriptions for the project. Returns scheduled email, Slack, or webhook deliveries of insight or
- dashboard snapshots. Each subscription includes its schedule (frequency, interval, byweekday),
- next_delivery_date, and a human-readable summary.
+ List the team's subscriptions. Use `search` to filter by title, insight name (including the auto-generated
+ name of an unnamed insight), or dashboard name. Prompt subscriptions are only matched on their `title` — the
+ `prompt` text is not searchable.
+ response:
+ exclude:
+ - invite_message
subscriptions-partial-update:
operation: subscriptions_partial_update
enabled: true
@@ -102,20 +136,25 @@ tools:
- subscription:write
annotations:
readOnly: false
- destructive: true
+ destructive: false
idempotent: true
title: Update subscription
description: >
- Update an existing subscription by ID. Can change target_type, target_value, frequency, interval, byweekday,
- start_date, until_date, title, or deleted status. Set deleted to true to deactivate a subscription
- (subscriptions are soft-deleted). Changing target_value triggers notifications to new recipients.
+ Update a subscription's mutable fields (title, target, schedule, the `prompt` for prompt subscriptions,
+ `enabled`). The kind (`resource_type`) is fixed at create — a PATCH that would introduce another kind's
+ field (e.g. a `prompt` on an insight sub) is rejected with 400. For prompt subs, re-enabling a previously
+ auto-disabled sub requires both a valid `prompt` (already persisted or supplied in the PATCH body) and that
+ the original creator is still an active user; otherwise it is rejected with 400. Editing or re-enabling a
+ prompt subscription additionally requires the `query:read` scope. Use `subscriptions-delete` to soft-delete
+ — `deleted` is not settable here.
exclude_params:
- - created_by
+ - deleted
- next_delivery_date
- - summary
- - insight_short_id
- resource_name
- - prompt
+ - insight_short_id
+ - invite_message
+ - summary_enabled
+ - summary_prompt_guide
subscriptions-retrieve:
operation: subscriptions_retrieve
enabled: true
@@ -126,9 +165,10 @@ tools:
destructive: false
idempotent: true
title: Get subscription
- description: >
- Get a specific subscription by ID. Returns the full subscription configuration including target type and
- value, schedule details, next delivery date, and associated insight or dashboard.
+ description: Retrieve a single subscription by ID.
+ response:
+ exclude:
+ - invite_message
subscriptions-summary-quota-retrieve:
operation: subscriptions_summary_quota_retrieve
enabled: false
@@ -139,16 +179,18 @@ tools:
- subscription:write
annotations:
readOnly: false
- destructive: true
+ destructive: false
idempotent: false
title: Send test delivery
description: >
- Trigger an immediate test delivery of a subscription to its configured target(s) (email, Slack, or webhook).
- Runs the same pipeline as a scheduled delivery but with trigger_type=manual, producing a real delivery
- record you can inspect via subscriptions-deliveries-list / subscriptions-deliveries-retrieve. Returns 202
- Accepted once the delivery workflow is queued; poll subscriptions-deliveries-list (newest first) or
+ Trigger an immediate test delivery of a subscription to its configured target(s) (email or Slack). Runs the
+ same pipeline as a scheduled delivery but with trigger_type=manual, producing a real delivery record you can
+ inspect via subscriptions-deliveries-list / subscriptions-deliveries-retrieve. Returns 202 Accepted once the
+ delivery workflow is queued; poll subscriptions-deliveries-list (newest first) or
subscriptions-deliveries-retrieve for the outcome. Returns 409 if a test delivery for the same subscription
- is already in flight.
+ is already in flight, or if the subscription is disabled (re-enable it first); 404 if it has been deleted.
+ Test-delivering a prompt subscription additionally requires the `query:read` scope (it runs the AI HogQL
+ pipeline).
subscriptions-update:
operation: subscriptions_update
enabled: false
diff --git a/products/subscriptions/skills/creating-ai-subscription/SKILL.md b/products/subscriptions/skills/creating-ai-subscription/SKILL.md
new file mode 100644
index 000000000000..c3775dc80a86
--- /dev/null
+++ b/products/subscriptions/skills/creating-ai-subscription/SKILL.md
@@ -0,0 +1,168 @@
+---
+name: creating-ai-subscription
+description: >
+ Create a recurring AI-generated PostHog report — schedule a free-text prompt to
+ run on a cron, with the LLM-synthesized markdown delivered to email or Slack on
+ each tick. Use when the user wants "send me a weekly AI summary of X" rather than
+ a one-off report.
+---
+
+# Creating a prompt subscription
+
+## When to use this
+
+A **subscription** delivers a PostHog report to email or Slack on a recurring
+schedule. There are three kinds, distinguished by which field you set — the kind is
+derived and returned as the read-only `resource_type`:
+
+- **`insight`** — periodic snapshots of one existing insight (`resource_type: "insight"`)
+- **`dashboard`** — periodic snapshots of a dashboard's tiles (`resource_type: "dashboard"`)
+- **`prompt`** — a recurring **AI-generated** report from a free-text prompt: an LLM
+ plans and runs HogQL over the project's data and synthesizes a fresh markdown report
+ each tick (`resource_type: "ai_prompt"`)
+
+Use **this** skill for the **prompt** kind — i.e. when the user wants something like
+"send me a weekly AI summary of X" rather than a recurring snapshot of one existing
+insight/dashboard, or a single one-off report. Pick a prompt subscription when the
+value is the _analysis itself_ (the LLM deciding what to query and writing it up),
+not a fixed chart they already built. For an insight/dashboard subscription, set
+`insight`/`dashboard` instead of `prompt` and the AI gates below don't apply.
+
+This skill covers **creating** the subscription. Once it exists you manage its
+lifecycle with the same `subscriptions-*` tools (see below): list it, edit/disable/
+re-enable it, send a test delivery, or delete it.
+
+## Tools
+
+| Tool | Purpose |
+| -------------------------------------------- | --------------------------------------------------- |
+| `posthog:subscriptions-create` | Create the recurring prompt subscription |
+| `posthog:subscriptions-list` | Confirm it landed; inspect existing subscriptions |
+| `posthog:subscriptions-partial-update` | Edit, disable (`enabled: false`), or re-enable it |
+| `posthog:subscriptions-test-delivery-create` | Send an immediate test delivery to its target(s) |
+| `posthog:subscriptions-delete` | Soft-delete it (stops all future deliveries) |
+| `posthog:integrations-list` | Find a Slack `integration_id` (filter `kind=slack`) |
+| `posthog:integrations-channels-retrieve` | List a Slack integration's channels (id + name) |
+
+## What you need before calling
+
+The endpoint enforces three create-time gates and will return 400 if any fails:
+
+1. **PostHog Cloud, or `DEBUG=true`** — self-hosted production deployments are not
+ eligible (the LLM call routes through a PostHog-managed key).
+2. **Org-level "AI data processing approved"** — must be toggled on in
+ `Org settings → Data → AI data processing`. The user must opt in to AI features
+ for the organization first.
+3. **Prompt subscriptions enabled** for the organization — a PostHog-managed rollout
+ flag. If it's off, the org has not been granted access yet; tell the user to
+ reach out to PostHog to enable it (there is no self-serve toggle).
+
+If any of the three is missing, stop and tell the user which one to fix —
+re-calling the tool will not help.
+
+Your access token also needs the **`query:read`** scope in addition to
+`subscription:write`: a prompt subscription runs LLM-generated HogQL over the project's
+data, so the backend requires query access to create, edit/re-enable, test-deliver,
+or delete one. A `subscription:write`-only token is rejected with a 403.
+
+## Required arguments
+
+```yaml
+prompt: "..." # ≤4000 chars; setting this (with no insight/dashboard) makes it a prompt sub → resource_type "ai_prompt"
+target_type: "email" | "slack" # webhook is rejected for prompt subs
+target_value: "..." # comma-separated emails, or "<channel_id>|<channel_name>"
+frequency: "daily" | "weekly" | "monthly" | "yearly"
+interval: 1 # 1 = every tick; 2 = every other tick; etc.
+start_date: "2026-09-15T09:00:00Z" # anchors the recurrence + time-of-day; need not be in the future — the scheduler delivers the next occurrence
+title: "..." # display name in the subscriptions list
+```
+
+There is no `resource_type` argument to send — the kind is **derived**
+from which field you set (`prompt` ⇒ AI report) and returned as the read-only `resource_type`.
+
+## Optional arguments
+
+```yaml
+byweekday: ['monday', 'wednesday'] # weekly only — days the rrule fires
+bysetpos: 1 # most useful with monthly; requires byweekday — e.g. byweekday:['monday']+bysetpos:-1 = last Monday
+count: 10 # cap total deliveries
+until_date: '2026-12-31T00:00:00Z' # stop on/before this date
+integration_id: 42 # Slack only — required; from integrations-list (see "Slack target")
+```
+
+## Slack target
+
+`target_value` must be `<channel_id>|<channel_name>` (the format the integration
+returns). Build it in three steps:
+
+1. `posthog:integrations-list` filtered by `kind=slack` → pick the Slack
+ integration's `id`.
+2. `posthog:integrations-channels-retrieve` with that `id` → pick a channel; it
+ returns each channel's `id` and `name`, which you assemble into `target_value`
+ as `<id>|<name>`.
+3. Pass that integration's `id` as `integration_id` — the subscription is pinned
+ to one specific Slack integration so reconnections elsewhere don't accidentally
+ re-route deliveries.
+
+## Examples
+
+### Weekly Monday-morning AI summary by email
+
+```yaml
+prompt: 'Top events week over week, with the biggest drops and any new failure modes called out.'
+target_type: email
+target_value: [email protected]
+frequency: weekly
+interval: 1
+byweekday: ['monday']
+start_date: '2026-09-14T08:00:00Z'
+title: 'Weekly product pulse'
+```
+
+### Daily Slack report at 9am
+
+```yaml
+prompt: "Yesterday's sign-ups, where they came from, and any errors they hit during onboarding."
+target_type: slack
+target_value: 'C0123456789|growth-updates' # <channel_id>|<channel_name>; only the channel id is used, the name is cosmetic
+integration_id: 42
+frequency: daily
+interval: 1
+start_date: '2026-09-15T09:00:00Z'
+title: 'Daily onboarding watch'
+```
+
+## Pitfalls
+
+- **The kind is immutable.** It's derived from which relation is set, so you can't flip an
+ insight or dashboard sub into a prompt sub after the fact (or vice versa) — a PATCH that adds a
+ `prompt` to an insight sub is rejected. Pick the right kind at create time.
+- **Re-enabling a previously auto-disabled prompt sub** has two preconditions, both
+ enforced on the PATCH: (1) a valid `prompt` — already persisted on the row, or a
+ new one in the PATCH body (so bare `{"enabled": true}` works when the stored prompt
+ is still valid, but is rejected when the disable cause was an invalid prompt until
+ you supply a good one); and (2) the **original creator is still an active user** —
+ if that account was deactivated the sub cannot be re-enabled at all (no prompt will
+ help; re-create it instead).
+- **`next_delivery_date` is server-computed from the rrule.** Don't try to set it
+ manually — it's read-only. The first delivery fires at the first `start_date`
+ occurrence that is at least a short buffer (currently ~15 minutes) in the future,
+ so a `start_date` only seconds ahead rolls to the next occurrence.
+- **Transient send failures retry; only permanent failures auto-disable.** A
+ transient failure (Slack rate limit, SMTP blip, network) fails that delivery and
+ is retried by Temporal within the run, then re-fires on the next scheduled tick —
+ it does **not** auto-disable the subscription, so a persistently-failing channel
+ will keep retrying every tick until you fix it. Only permanent/structural causes
+ auto-disable: a disconnected Slack integration, a revoked channel permission, an
+ invalid prompt, or revoked AI data-processing consent. (For multi-recipient email,
+ a delivery only fails when _every_ recipient fails; partial successes still send.)
+ Within a single delivery run the rendered markdown is cached, so Temporal retries
+ of that run don't re-run the LLM pipeline — but each new scheduled tick generates a
+ fresh report.
+
+## After it lands
+
+`subscriptions-list` will return the new row. Confirm `resource_type: "ai_prompt"`,
+`enabled: true`, `next_delivery_date` is in the future, and `prompt` matches what
+you sent. The first scheduled tick will run the planner → HogQL → synthesis
+pipeline and email/Slack the rendered markdown.
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index a24ca19035b5..3dad00e9745c 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -5146,7 +5146,7 @@
}
},
"subscriptions-create": {
- "description": "Create a new subscription to receive scheduled deliveries of an insight or dashboard. Requires either an insight ID or dashboard ID. Set target_type to email, slack, or webhook and target_value to the recipient(s). For email: comma-separated addresses. For slack: requires an integration_id for a connected Slack workspace plus a channel name in target_value. For webhook: a URL. Set frequency (daily, weekly, monthly, yearly) and interval (required, minimum 1 — use 1 for no multiplier; e.g. 2 with weekly = every 2 weeks), plus optional byweekday, start_date, and until_date. Dashboard subscriptions also require dashboard_export_insights (list of insight IDs from that dashboard, max 6).",
+ "description": "Create a recurring subscription. The kind is inferred from which field you populate and returned as the read-only `resource_type`:\n(1) set `insight` — schedule periodic snapshots of one insight (`resource_type: \"insight\"`).\n(2) set `dashboard` and `dashboard_export_insights` (the subset of the dashboard's insights to include, max 6) — schedule periodic snapshots of one dashboard (`resource_type: \"dashboard\"`).\n(3) set `prompt` (≤4000 chars, with no insight or dashboard) — schedule a recurring LLM-generated report (`resource_type: \"ai_prompt\"`). Available on PostHog Cloud (self-hosted production is not eligible) once the organization has approved AI data processing and prompt subscriptions are enabled for it; otherwise create is rejected with a 400. Creating a prompt subscription also requires the `query:read` scope — the report runs LLM-generated HogQL over your data — so a `subscription:write`-only token is rejected for this kind.\nDelivery is set by `target_type` — `email` or `slack`.\nThe kind is fixed at create time — a PATCH that would change the populated relation to a different kind is rejected.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Create subscription",
@@ -5159,6 +5159,20 @@
"readOnlyHint": false
}
},
+ "subscriptions-delete": {
+ "description": "Soft-delete a subscription. Stops all future deliveries and returns the subscription with `deleted: true`. One-way via MCP — there is no restore tool, so re-create the subscription if you need it back. Deleting an prompt subscription additionally requires the `query:read` scope (the backend gates every write touching a prompt subscription on query access).",
+ "category": "Subscriptions",
+ "feature": "subscriptions",
+ "summary": "Delete subscription",
+ "title": "Delete subscription",
+ "required_scopes": ["subscription:write"],
+ "annotations": {
+ "destructiveHint": true,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"subscriptions-deliveries-list": {
"description": "List delivery history for a subscription — one row per send attempt. Each entry includes status (starting, completed, failed, skipped), trigger_type (scheduled, manual, target_change), and timestamps (created_at, finished_at). Filter with status=failed to quickly surface failed deliveries. Results are cursor-paginated newest first. content_snapshot, recipient_results, and error are excluded to match what the web UI exposes and to avoid leaking recipient identifiers or upstream response bodies that may contain tokens / PII.",
"category": "Subscriptions",
@@ -5188,7 +5202,7 @@
}
},
"subscriptions-list": {
- "description": "List subscriptions for the project. Returns scheduled email, Slack, or webhook deliveries of insight or dashboard snapshots. Each subscription includes its schedule (frequency, interval, byweekday), next_delivery_date, and a human-readable summary.",
+ "description": "List the team's subscriptions. Use `search` to filter by title, insight name (including the auto-generated name of an unnamed insight), or dashboard name. Prompt subscriptions are only matched on their `title` — the `prompt` text is not searchable.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "List subscriptions",
@@ -5202,21 +5216,21 @@
}
},
"subscriptions-partial-update": {
- "description": "Update an existing subscription by ID. Can change target_type, target_value, frequency, interval, byweekday, start_date, until_date, title, or deleted status. Set deleted to true to deactivate a subscription (subscriptions are soft-deleted). Changing target_value triggers notifications to new recipients.",
+ "description": "Update a subscription's mutable fields (title, target, schedule, the `prompt` for prompt subscriptions, `enabled`). The kind (`resource_type`) is fixed at create — a PATCH that would introduce another kind's field (e.g. a `prompt` on an insight sub) is rejected with 400. For prompt subs, re-enabling a previously auto-disabled sub requires both a valid `prompt` (already persisted or supplied in the PATCH body) and that the original creator is still an active user; otherwise it is rejected with 400. Editing or re-enabling a prompt subscription additionally requires the `query:read` scope. Use `subscriptions-delete` to soft-delete — `deleted` is not settable here.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Update subscription",
"title": "Update subscription",
"required_scopes": ["subscription:write"],
"annotations": {
- "destructiveHint": true,
+ "destructiveHint": false,
"idempotentHint": true,
"openWorldHint": true,
"readOnlyHint": false
}
},
"subscriptions-retrieve": {
- "description": "Get a specific subscription by ID. Returns the full subscription configuration including target type and value, schedule details, next delivery date, and associated insight or dashboard.",
+ "description": "Retrieve a single subscription by ID.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Get subscription",
@@ -5230,14 +5244,14 @@
}
},
"subscriptions-test-delivery-create": {
- "description": "Trigger an immediate test delivery of a subscription to its configured target(s) (email, Slack, or webhook). Runs the same pipeline as a scheduled delivery but with trigger_type=manual, producing a real delivery record you can inspect via subscriptions-deliveries-list / subscriptions-deliveries-retrieve. Returns 202 Accepted once the delivery workflow is queued; poll subscriptions-deliveries-list (newest first) or subscriptions-deliveries-retrieve for the outcome. Returns 409 if a test delivery for the same subscription is already in flight.",
+ "description": "Trigger an immediate test delivery of a subscription to its configured target(s) (email or Slack). Runs the same pipeline as a scheduled delivery but with trigger_type=manual, producing a real delivery record you can inspect via subscriptions-deliveries-list / subscriptions-deliveries-retrieve. Returns 202 Accepted once the delivery workflow is queued; poll subscriptions-deliveries-list (newest first) or subscriptions-deliveries-retrieve for the outcome. Returns 409 if a test delivery for the same subscription is already in flight, or if the subscription is disabled (re-enable it first); 404 if it has been deleted. Test-delivering a prompt subscription additionally requires the `query:read` scope (it runs the AI HogQL pipeline).",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Send test delivery",
"title": "Send test delivery",
"required_scopes": ["subscription:write"],
"annotations": {
- "destructiveHint": true,
+ "destructiveHint": false,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 51d0f17f4d47..189e6a73d1e7 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -5473,7 +5473,7 @@
}
},
"subscriptions-create": {
- "description": "Create a new subscription to receive scheduled deliveries of an insight or dashboard. Requires either an insight ID or dashboard ID. Set target_type to email, slack, or webhook and target_value to the recipient(s). For email: comma-separated addresses. For slack: requires an integration_id for a connected Slack workspace plus a channel name in target_value. For webhook: a URL. Set frequency (daily, weekly, monthly, yearly) and interval (required, minimum 1 — use 1 for no multiplier; e.g. 2 with weekly = every 2 weeks), plus optional byweekday, start_date, and until_date. Dashboard subscriptions also require dashboard_export_insights (list of insight IDs from that dashboard, max 6).",
+ "description": "Create a recurring subscription. The kind is inferred from which field you populate and returned as the read-only `resource_type`:\n(1) set `insight` — schedule periodic snapshots of one insight (`resource_type: \"insight\"`).\n(2) set `dashboard` and `dashboard_export_insights` (the subset of the dashboard's insights to include, max 6) — schedule periodic snapshots of one dashboard (`resource_type: \"dashboard\"`).\n(3) set `prompt` (≤4000 chars, with no insight or dashboard) — schedule a recurring LLM-generated report (`resource_type: \"ai_prompt\"`). Available on PostHog Cloud (self-hosted production is not eligible) once the organization has approved AI data processing and prompt subscriptions are enabled for it; otherwise create is rejected with a 400. Creating a prompt subscription also requires the `query:read` scope — the report runs LLM-generated HogQL over your data — so a `subscription:write`-only token is rejected for this kind.\nDelivery is set by `target_type` — `email` or `slack`.\nThe kind is fixed at create time — a PATCH that would change the populated relation to a different kind is rejected.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Create subscription",
@@ -5486,6 +5486,20 @@
"readOnlyHint": false
}
},
+ "subscriptions-delete": {
+ "description": "Soft-delete a subscription. Stops all future deliveries and returns the subscription with `deleted: true`. One-way via MCP — there is no restore tool, so re-create the subscription if you need it back. Deleting an prompt subscription additionally requires the `query:read` scope (the backend gates every write touching a prompt subscription on query access).",
+ "category": "Subscriptions",
+ "feature": "subscriptions",
+ "summary": "Delete subscription",
+ "title": "Delete subscription",
+ "required_scopes": ["subscription:write"],
+ "annotations": {
+ "destructiveHint": true,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": false
+ }
+ },
"subscriptions-deliveries-list": {
"description": "List delivery history for a subscription — one row per send attempt. Each entry includes status (starting, completed, failed, skipped), trigger_type (scheduled, manual, target_change), and timestamps (created_at, finished_at). Filter with status=failed to quickly surface failed deliveries. Results are cursor-paginated newest first. content_snapshot, recipient_results, and error are excluded to match what the web UI exposes and to avoid leaking recipient identifiers or upstream response bodies that may contain tokens / PII.",
"category": "Subscriptions",
@@ -5515,7 +5529,7 @@
}
},
"subscriptions-list": {
- "description": "List subscriptions for the project. Returns scheduled email, Slack, or webhook deliveries of insight or dashboard snapshots. Each subscription includes its schedule (frequency, interval, byweekday), next_delivery_date, and a human-readable summary.",
+ "description": "List the team's subscriptions. Use `search` to filter by title, insight name (including the auto-generated name of an unnamed insight), or dashboard name. Prompt subscriptions are only matched on their `title` — the `prompt` text is not searchable.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "List subscriptions",
@@ -5529,21 +5543,21 @@
}
},
"subscriptions-partial-update": {
- "description": "Update an existing subscription by ID. Can change target_type, target_value, frequency, interval, byweekday, start_date, until_date, title, or deleted status. Set deleted to true to deactivate a subscription (subscriptions are soft-deleted). Changing target_value triggers notifications to new recipients.",
+ "description": "Update a subscription's mutable fields (title, target, schedule, the `prompt` for prompt subscriptions, `enabled`). The kind (`resource_type`) is fixed at create — a PATCH that would introduce another kind's field (e.g. a `prompt` on an insight sub) is rejected with 400. For prompt subs, re-enabling a previously auto-disabled sub requires both a valid `prompt` (already persisted or supplied in the PATCH body) and that the original creator is still an active user; otherwise it is rejected with 400. Editing or re-enabling a prompt subscription additionally requires the `query:read` scope. Use `subscriptions-delete` to soft-delete — `deleted` is not settable here.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Update subscription",
"title": "Update subscription",
"required_scopes": ["subscription:write"],
"annotations": {
- "destructiveHint": true,
+ "destructiveHint": false,
"idempotentHint": true,
"openWorldHint": true,
"readOnlyHint": false
}
},
"subscriptions-retrieve": {
- "description": "Get a specific subscription by ID. Returns the full subscription configuration including target type and value, schedule details, next delivery date, and associated insight or dashboard.",
+ "description": "Retrieve a single subscription by ID.",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Get subscription",
@@ -5557,14 +5571,14 @@
}
},
"subscriptions-test-delivery-create": {
- "description": "Trigger an immediate test delivery of a subscription to its configured target(s) (email, Slack, or webhook). Runs the same pipeline as a scheduled delivery but with trigger_type=manual, producing a real delivery record you can inspect via subscriptions-deliveries-list / subscriptions-deliveries-retrieve. Returns 202 Accepted once the delivery workflow is queued; poll subscriptions-deliveries-list (newest first) or subscriptions-deliveries-retrieve for the outcome. Returns 409 if a test delivery for the same subscription is already in flight.",
+ "description": "Trigger an immediate test delivery of a subscription to its configured target(s) (email or Slack). Runs the same pipeline as a scheduled delivery but with trigger_type=manual, producing a real delivery record you can inspect via subscriptions-deliveries-list / subscriptions-deliveries-retrieve. Returns 202 Accepted once the delivery workflow is queued; poll subscriptions-deliveries-list (newest first) or subscriptions-deliveries-retrieve for the outcome. Returns 409 if a test delivery for the same subscription is already in flight, or if the subscription is disabled (re-enable it first); 404 if it has been deleted. Test-delivering a prompt subscription additionally requires the `query:read` scope (it runs the AI HogQL pipeline).",
"category": "Subscriptions",
"feature": "subscriptions",
"summary": "Send test delivery",
"title": "Send test delivery",
"required_scopes": ["subscription:write"],
"annotations": {
- "destructiveHint": true,
+ "destructiveHint": false,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 3b00bc220bec..964648d8e087 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -26125,7 +26125,7 @@ export namespace Schemas {
* @nullable
*/
readonly scheduled_at: string | null;
- /** Channel snapshot at send time (email, slack, webhook). */
+ /** Channel snapshot at send time (email or slack). */
readonly target_type: string;
/** Destination snapshot at send time (emails, channel id, URL). */
readonly target_value: string;
@@ -26185,7 +26185,6 @@ export namespace Schemas {
/**
* * `email` - Email
* `slack` - Slack
- * `webhook` - Webhook
*/
export type TargetTypeEnum = typeof TargetTypeEnum[keyof typeof TargetTypeEnum];
@@ -26193,7 +26192,6 @@ export namespace Schemas {
export const TargetTypeEnum = {
Email: 'email',
Slack: 'slack',
- Webhook: 'webhook',
} as const;
/**
@@ -26266,13 +26264,12 @@ export namespace Schemas {
* @nullable
*/
prompt?: string | null;
- /** Delivery channel: email, slack, or webhook.
+ /** Delivery channel: email or slack.
* `email` - Email
- * `slack` - Slack
- * `webhook` - Webhook */
+ * `slack` - Slack */
target_type: TargetTypeEnum;
- /** Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook. */
+ /** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value: string;
/** How often to deliver: daily, weekly, monthly, or yearly.
@@ -32246,13 +32243,12 @@ export namespace Schemas {
* @nullable
*/
prompt?: string | null;
- /** Delivery channel: email, slack, or webhook.
+ /** Delivery channel: email or slack.
* `email` - Email
- * `slack` - Slack
- * `webhook` - Webhook */
+ * `slack` - Slack */
target_type?: TargetTypeEnum;
- /** Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook. */
+ /** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value?: string;
/** How often to deliver: daily, weekly, monthly, or yearly.
@@ -45574,7 +45570,7 @@ export namespace Schemas {
*/
search?: string;
/**
- * Filter by delivery channel (email, Slack, or webhook).
+ * Filter by delivery channel (email or Slack).
*/
target_type?: EnvironmentsSubscriptionsListTargetType;
};
@@ -45594,7 +45590,6 @@ export namespace Schemas {
export const EnvironmentsSubscriptionsListTargetType = {
Email: 'email',
Slack: 'slack',
- Webhook: 'webhook',
} as const;
export type EnvironmentsSubscriptionsSummaryQuotaRetrieve200 = {
@@ -51763,7 +51758,7 @@ export namespace Schemas {
*/
search?: string;
/**
- * Filter by delivery channel (email, Slack, or webhook).
+ * Filter by delivery channel (email or Slack).
*/
target_type?: SubscriptionsListTargetType;
};
@@ -51783,7 +51778,6 @@ export namespace Schemas {
export const SubscriptionsListTargetType = {
Email: 'email',
Slack: 'slack',
- Webhook: 'webhook',
} as const;
export type SubscriptionsSummaryQuotaRetrieve200 = {
diff --git a/services/mcp/src/generated/subscriptions/api.ts b/services/mcp/src/generated/subscriptions/api.ts
index 3e15cdb823ac..1c46af6e8056 100644
--- a/services/mcp/src/generated/subscriptions/api.ts
+++ b/services/mcp/src/generated/subscriptions/api.ts
@@ -3,7 +3,7 @@
* MCP service uses these Zod schemas for generated tool handlers.
* To regenerate: hogli build:openapi
*
- * PostHog API - MCP 7 enabled ops
+ * PostHog API - MCP 8 enabled ops
* OpenAPI spec version: 1.0.0
*/
import * as zod from 'zod'
@@ -63,10 +63,7 @@ export const SubscriptionsListQueryParams = /* @__PURE__ */ zod.object({
.optional()
.describe('Filter by subscription resource: insight, dashboard export, or AI report.'),
search: zod.string().optional().describe('A search term.'),
- target_type: zod
- .enum(['email', 'slack', 'webhook'])
- .optional()
- .describe('Filter by delivery channel (email, Slack, or webhook).'),
+ target_type: zod.enum(['email', 'slack']).optional().describe('Filter by delivery channel (email or Slack).'),
})
export const SubscriptionsCreateParams = /* @__PURE__ */ zod.object({
@@ -87,8 +84,6 @@ export const subscriptionsCreateBodyCountMax = 2147483647
export const subscriptionsCreateBodyTitleMax = 100
-export const subscriptionsCreateBodySummaryPromptGuideMax = 500
-
export const SubscriptionsCreateBody = /* @__PURE__ */ zod
.object({
dashboard: zod
@@ -105,17 +100,19 @@ export const SubscriptionsCreateBody = /* @__PURE__ */ zod
.describe(
'List of insight IDs from the dashboard to include. Required for dashboard subscriptions, max 6.'
),
- target_type: zod
- .enum(['email', 'slack', 'webhook'])
- .describe('* `email` - Email\n* `slack` - Slack\n* `webhook` - Webhook')
+ prompt: zod
+ .string()
+ .nullish()
.describe(
- 'Delivery channel: email, slack, or webhook.\n\n* `email` - Email\n* `slack` - Slack\n* `webhook` - Webhook'
+ "Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters."
),
+ target_type: zod
+ .enum(['email', 'slack'])
+ .describe('* `email` - Email\n* `slack` - Slack')
+ .describe('Delivery channel: email or slack.\n\n* `email` - Email\n* `slack` - Slack'),
target_value: zod
.string()
- .describe(
- 'Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook.'
- ),
+ .describe('Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack.'),
frequency: zod
.enum(['daily', 'weekly', 'monthly', 'yearly'])
.describe('* `daily` - Daily\n* `weekly` - Weekly\n* `monthly` - Monthly\n* `yearly` - Yearly')
@@ -158,7 +155,6 @@ export const SubscriptionsCreateBody = /* @__PURE__ */ zod
.datetime({ offset: true })
.nullish()
.describe('When to stop delivering (ISO 8601 datetime). Null for indefinite.'),
- deleted: zod.boolean().optional().describe('Set to true to soft-delete. Subscriptions cannot be hard-deleted.'),
enabled: zod
.boolean()
.optional()
@@ -174,12 +170,6 @@ export const SubscriptionsCreateBody = /* @__PURE__ */ zod
.number()
.nullish()
.describe('ID of a connected Slack integration. Required when target_type is slack.'),
- invite_message: zod
- .string()
- .nullish()
- .describe('Optional message included in the invitation email when adding new recipients.'),
- summary_enabled: zod.boolean().optional(),
- summary_prompt_guide: zod.string().max(subscriptionsCreateBodySummaryPromptGuideMax).optional(),
})
.describe('Standard Subscription serializer.')
@@ -211,8 +201,6 @@ export const subscriptionsPartialUpdateBodyCountMax = 2147483647
export const subscriptionsPartialUpdateBodyTitleMax = 100
-export const subscriptionsPartialUpdateBodySummaryPromptGuideMax = 500
-
export const SubscriptionsPartialUpdateBody = /* @__PURE__ */ zod
.object({
dashboard: zod
@@ -229,19 +217,21 @@ export const SubscriptionsPartialUpdateBody = /* @__PURE__ */ zod
.describe(
'List of insight IDs from the dashboard to include. Required for dashboard subscriptions, max 6.'
),
- target_type: zod
- .enum(['email', 'slack', 'webhook'])
- .describe('* `email` - Email\n* `slack` - Slack\n* `webhook` - Webhook')
- .optional()
+ prompt: zod
+ .string()
+ .nullish()
.describe(
- 'Delivery channel: email, slack, or webhook.\n\n* `email` - Email\n* `slack` - Slack\n* `webhook` - Webhook'
+ "Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters."
),
+ target_type: zod
+ .enum(['email', 'slack'])
+ .describe('* `email` - Email\n* `slack` - Slack')
+ .optional()
+ .describe('Delivery channel: email or slack.\n\n* `email` - Email\n* `slack` - Slack'),
target_value: zod
.string()
.optional()
- .describe(
- 'Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook.'
- ),
+ .describe('Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack.'),
frequency: zod
.enum(['daily', 'weekly', 'monthly', 'yearly'])
.describe('* `daily` - Daily\n* `weekly` - Weekly\n* `monthly` - Monthly\n* `yearly` - Yearly')
@@ -289,7 +279,6 @@ export const SubscriptionsPartialUpdateBody = /* @__PURE__ */ zod
.datetime({ offset: true })
.nullish()
.describe('When to stop delivering (ISO 8601 datetime). Null for indefinite.'),
- deleted: zod.boolean().optional().describe('Set to true to soft-delete. Subscriptions cannot be hard-deleted.'),
enabled: zod
.boolean()
.optional()
@@ -305,15 +294,21 @@ export const SubscriptionsPartialUpdateBody = /* @__PURE__ */ zod
.number()
.nullish()
.describe('ID of a connected Slack integration. Required when target_type is slack.'),
- invite_message: zod
- .string()
- .nullish()
- .describe('Optional message included in the invitation email when adding new recipients.'),
- summary_enabled: zod.boolean().optional(),
- summary_prompt_guide: zod.string().max(subscriptionsPartialUpdateBodySummaryPromptGuideMax).optional(),
})
.describe('Standard Subscription serializer.')
+/**
+ * Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
+ */
+export const SubscriptionsDestroyParams = /* @__PURE__ */ zod.object({
+ id: zod.number().describe('A unique integer value identifying this subscription.'),
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+})
+
export const SubscriptionsTestDeliveryCreateParams = /* @__PURE__ */ zod.object({
id: zod.number().describe('A unique integer value identifying this subscription.'),
project_id: zod
diff --git a/services/mcp/src/tools/generated/subscriptions.ts b/services/mcp/src/tools/generated/subscriptions.ts
index ee2480aa264e..f61707938f17 100644
--- a/services/mcp/src/tools/generated/subscriptions.ts
+++ b/services/mcp/src/tools/generated/subscriptions.ts
@@ -7,12 +7,14 @@ import {
SubscriptionsDeliveriesListParams,
SubscriptionsDeliveriesListQueryParams,
SubscriptionsDeliveriesRetrieveParams,
+ SubscriptionsDestroyParams,
SubscriptionsListQueryParams,
SubscriptionsPartialUpdateBody,
SubscriptionsPartialUpdateParams,
SubscriptionsRetrieveParams,
SubscriptionsTestDeliveryCreateParams,
} from '@/generated/subscriptions/api'
+import { castStringToInt } from '@/tools/cast-helpers'
import { withPostHogUrl, omitResponseFields, type WithPostHogUrl } from '@/tools/tool-utils'
import type { Context, ToolBase, ZodObjectAny } from '@/tools/types'
@@ -33,6 +35,9 @@ const subscriptionsCreate = (): ToolBase<typeof SubscriptionsCreateSchema, Schem
if (params.dashboard_export_insights !== undefined) {
body['dashboard_export_insights'] = params.dashboard_export_insights
}
+ if (params.prompt !== undefined) {
+ body['prompt'] = params.prompt
+ }
if (params.target_type !== undefined) {
body['target_type'] = params.target_type
}
@@ -60,9 +65,6 @@ const subscriptionsCreate = (): ToolBase<typeof SubscriptionsCreateSchema, Schem
if (params.until_date !== undefined) {
body['until_date'] = params.until_date
}
- if (params.deleted !== undefined) {
- body['deleted'] = params.deleted
- }
if (params.enabled !== undefined) {
body['enabled'] = params.enabled
}
@@ -72,15 +74,6 @@ const subscriptionsCreate = (): ToolBase<typeof SubscriptionsCreateSchema, Schem
if (params.integration_id !== undefined) {
body['integration_id'] = params.integration_id
}
- if (params.invite_message !== undefined) {
- body['invite_message'] = params.invite_message
- }
- if (params.summary_enabled !== undefined) {
- body['summary_enabled'] = params.summary_enabled
- }
- if (params.summary_prompt_guide !== undefined) {
- body['summary_prompt_guide'] = params.summary_prompt_guide
- }
const result = await context.api.request<Schemas.Subscription>({
method: 'POST',
path: `/api/projects/${encodeURIComponent(String(projectId))}/subscriptions/`,
@@ -90,6 +83,25 @@ const subscriptionsCreate = (): ToolBase<typeof SubscriptionsCreateSchema, Schem
},
})
+const SubscriptionsDeleteSchema = SubscriptionsDestroyParams.omit({ project_id: true }).extend({
+ id: z.preprocess(castStringToInt, SubscriptionsDestroyParams.shape['id']),
+})
+
+const subscriptionsDelete = (): ToolBase<typeof SubscriptionsDeleteSchema, Schemas.Subscription> => ({
+ name: 'subscriptions-delete',
+ schema: SubscriptionsDeleteSchema,
+ handler: async (context: Context, params: z.infer<typeof SubscriptionsDeleteSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.Subscription>({
+ method: 'PATCH',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/subscriptions/${encodeURIComponent(String(params.id))}/`,
+ body: { deleted: true },
+ })
+ const filtered = omitResponseFields(result, ['invite_message']) as typeof result
+ return filtered
+ },
+})
+
const SubscriptionsDeliveriesListSchema = SubscriptionsDeliveriesListParams.omit({ project_id: true }).extend(
SubscriptionsDeliveriesListQueryParams.shape
)
@@ -164,7 +176,11 @@ const subscriptionsList = (): ToolBase<
target_type: params.target_type,
},
})
- return await withPostHogUrl(context, result, '/subscriptions')
+ const filtered = {
+ ...result,
+ results: (result.results ?? []).map((item: any) => omitResponseFields(item, ['invite_message'])),
+ } as typeof result
+ return await withPostHogUrl(context, filtered, '/subscriptions')
},
})
@@ -187,6 +203,9 @@ const subscriptionsPartialUpdate = (): ToolBase<typeof SubscriptionsPartialUpdat
if (params.dashboard_export_insights !== undefined) {
body['dashboard_export_insights'] = params.dashboard_export_insights
}
+ if (params.prompt !== undefined) {
+ body['prompt'] = params.prompt
+ }
if (params.target_type !== undefined) {
body['target_type'] = params.target_type
}
@@ -214,9 +233,6 @@ const subscriptionsPartialUpdate = (): ToolBase<typeof SubscriptionsPartialUpdat
if (params.until_date !== undefined) {
body['until_date'] = params.until_date
}
- if (params.deleted !== undefined) {
- body['deleted'] = params.deleted
- }
if (params.enabled !== undefined) {
body['enabled'] = params.enabled
}
@@ -226,15 +242,6 @@ const subscriptionsPartialUpdate = (): ToolBase<typeof SubscriptionsPartialUpdat
if (params.integration_id !== undefined) {
body['integration_id'] = params.integration_id
}
- if (params.invite_message !== undefined) {
- body['invite_message'] = params.invite_message
- }
- if (params.summary_enabled !== undefined) {
- body['summary_enabled'] = params.summary_enabled
- }
- if (params.summary_prompt_guide !== undefined) {
- body['summary_prompt_guide'] = params.summary_prompt_guide
- }
const result = await context.api.request<Schemas.Subscription>({
method: 'PATCH',
path: `/api/projects/${encodeURIComponent(String(projectId))}/subscriptions/${encodeURIComponent(String(params.id))}/`,
@@ -255,7 +262,8 @@ const subscriptionsRetrieve = (): ToolBase<typeof SubscriptionsRetrieveSchema, S
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/subscriptions/${encodeURIComponent(String(params.id))}/`,
})
- return result
+ const filtered = omitResponseFields(result, ['invite_message']) as typeof result
+ return filtered
},
})
@@ -276,6 +284,7 @@ const subscriptionsTestDeliveryCreate = (): ToolBase<typeof SubscriptionsTestDel
export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'subscriptions-create': subscriptionsCreate,
+ 'subscriptions-delete': subscriptionsDelete,
'subscriptions-deliveries-list': subscriptionsDeliveriesList,
'subscriptions-deliveries-retrieve': subscriptionsDeliveriesRetrieve,
'subscriptions-list': subscriptionsList,
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-create.json
index 8cbd33f69180..da6f8504852a 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-create.json
@@ -62,10 +62,6 @@
},
"type": "array"
},
- "deleted": {
- "description": "Set to true to soft-delete. Subscriptions cannot be hard-deleted.",
- "type": "boolean"
- },
"enabled": {
"description": "Whether the subscription is active. Set to false to pause delivery without deleting. Auto-set to false when the delivery integration becomes invalid.",
"type": "boolean"
@@ -103,7 +99,7 @@
"minimum": 1,
"type": "number"
},
- "invite_message": {
+ "prompt": {
"anyOf": [
{
"type": "string"
@@ -112,7 +108,7 @@
"type": "null"
}
],
- "description": "Optional message included in the invitation email when adding new recipients."
+ "description": "Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters."
},
"start_date": {
"description": "When to start delivering (ISO 8601 datetime).",
@@ -120,20 +116,13 @@
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
- "summary_enabled": {
- "type": "boolean"
- },
- "summary_prompt_guide": {
- "maxLength": 500,
- "type": "string"
- },
"target_type": {
- "description": "Delivery channel: email, slack, or webhook.\n\n* `email` - Email\n* `slack` - Slack\n* `webhook` - Webhook",
- "enum": ["email", "slack", "webhook"],
+ "description": "Delivery channel: email or slack.\n\n* `email` - Email\n* `slack` - Slack",
+ "enum": ["email", "slack"],
"type": "string"
},
"target_value": {
- "description": "Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook.",
+ "description": "Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack.",
"type": "string"
},
"title": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-delete.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-delete.json
new file mode 100644
index 000000000000..caa37a762a2f
--- /dev/null
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-delete.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {
+ "id": {
+ "description": "A unique integer value identifying this subscription.",
+ "type": "number"
+ }
+ },
+ "required": ["id"],
+ "type": "object"
+}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-list.json
index e773356567cc..46516e156cfd 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-list.json
@@ -35,8 +35,8 @@
"type": "string"
},
"target_type": {
- "description": "Filter by delivery channel (email, Slack, or webhook).",
- "enum": ["email", "slack", "webhook"],
+ "description": "Filter by delivery channel (email or Slack).",
+ "enum": ["email", "slack"],
"type": "string"
}
},
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-partial-update.json
index 1d7a243c2b1f..55c49d9a2da9 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-partial-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/subscriptions-partial-update.json
@@ -61,10 +61,6 @@
},
"type": "array"
},
- "deleted": {
- "description": "Set to true to soft-delete. Subscriptions cannot be hard-deleted.",
- "type": "boolean"
- },
"enabled": {
"description": "Whether the subscription is active. Set to false to pause delivery without deleting. Auto-set to false when the delivery integration becomes invalid.",
"type": "boolean"
@@ -106,7 +102,7 @@
"minimum": 1,
"type": "number"
},
- "invite_message": {
+ "prompt": {
"anyOf": [
{
"type": "string"
@@ -115,7 +111,7 @@
"type": "null"
}
],
- "description": "Optional message included in the invitation email when adding new recipients."
+ "description": "Free-text prompt that drives the AI-generated report. Required when resource_type is 'ai_prompt'. Max 4000 characters."
},
"start_date": {
"description": "When to start delivering (ISO 8601 datetime).",
@@ -123,20 +119,13 @@
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
"type": "string"
},
- "summary_enabled": {
- "type": "boolean"
- },
- "summary_prompt_guide": {
- "maxLength": 500,
- "type": "string"
- },
"target_type": {
- "description": "Delivery channel: email, slack, or webhook.\n\n* `email` - Email\n* `slack` - Slack\n* `webhook` - Webhook",
- "enum": ["email", "slack", "webhook"],
+ "description": "Delivery channel: email or slack.\n\n* `email` - Email\n* `slack` - Slack",
+ "enum": ["email", "slack"],
"type": "string"
},
"target_value": {
- "description": "Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook.",
+ "description": "Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack.",
"type": "string"
},
"title": {