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(experiments/mcp): Replace nonexistent tool names in help text (#62663)

Marcel Poelkeradf644043e32
diff --git a/products/experiments/backend/presentation/serializers.py b/products/experiments/backend/presentation/serializers.py
index fe3e5b1ec0d4..19a8bc6cd02a 100644
--- a/products/experiments/backend/presentation/serializers.py
+++ b/products/experiments/backend/presentation/serializers.py
@@ -100,7 +100,7 @@ class ExperimentSerializer(UserAccessControlSerializerMixin, serializers.ModelSe
source="get_feature_flag_key",
help_text=(
"Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. "
- "Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible."
+ "Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible."
),
)
created_by = UserBasicSerializer(read_only=True)
@@ -165,7 +165,7 @@ class ExperimentSerializer(UserAccessControlSerializerMixin, serializers.ModelSe
"'funnel' (set series to an array of EventsNode steps), "
"'ratio' (set numerator and denominator EventsNode entries), or "
"'retention' (set start_event and completion_event). "
- "Use the event-definitions-list tool to find available events in the project."
+ "Use the read-data-schema tool with query kind 'events' to find available events in the project."
),
)
metrics_secondary = ExperimentMetricsField(
diff --git a/products/experiments/frontend/generated/api.schemas.ts b/products/experiments/frontend/generated/api.schemas.ts
index 030f5fcaae04..1284c3f4d273 100644
--- a/products/experiments/frontend/generated/api.schemas.ts
+++ b/products/experiments/frontend/generated/api.schemas.ts
@@ -520,7 +520,7 @@ export interface ExperimentApi {
start_date?: string | null
/** @nullable */
end_date?: string | null
- /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible. */
+ /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible. */
feature_flag_key: string
readonly feature_flag: MinimalFeatureFlagApi
readonly holdout: ExperimentHoldoutApi
@@ -555,7 +555,7 @@ export interface ExperimentApi {
type?: ExperimentTypeEnumApi | null
/** Exposure configuration including filter test accounts and custom exposure events. */
exposure_criteria?: ExperimentApiExposureCriteriaApi | null
- /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project. */
+ /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project. */
metrics?: _ExperimentApiMetricsListApi | null
/** Secondary metrics for additional measurements. Same format as primary metrics. */
metrics_secondary?: _ExperimentApiMetricsListApi | null
@@ -620,7 +620,7 @@ export interface PatchedExperimentApi {
start_date?: string | null
/** @nullable */
end_date?: string | null
- /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible. */
+ /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible. */
feature_flag_key?: string
readonly feature_flag?: MinimalFeatureFlagApi
readonly holdout?: ExperimentHoldoutApi
@@ -655,7 +655,7 @@ export interface PatchedExperimentApi {
type?: ExperimentTypeEnumApi | null
/** Exposure configuration including filter test accounts and custom exposure events. */
exposure_criteria?: ExperimentApiExposureCriteriaApi | null
- /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project. */
+ /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project. */
metrics?: _ExperimentApiMetricsListApi | null
/** Secondary metrics for additional measurements. Same format as primary metrics. */
metrics_secondary?: _ExperimentApiMetricsListApi | null
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 804a99d1155e..9da1a475fb64 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -17209,7 +17209,7 @@ export namespace Schemas {
start_date?: string | null;
/** @nullable */
end_date?: string | null;
- /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible. */
+ /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible. */
feature_flag_key: string;
readonly feature_flag: MinimalFeatureFlag;
readonly holdout: ExperimentHoldout;
@@ -17244,7 +17244,7 @@ export namespace Schemas {
type?: ExperimentTypeEnum | null;
/** Exposure configuration including filter test accounts and custom exposure events. */
exposure_criteria?: ExperimentApiExposureCriteria | null;
- /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project. */
+ /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project. */
metrics?: _ExperimentApiMetricsList | null;
/** Secondary metrics for additional measurements. Same format as primary metrics. */
metrics_secondary?: _ExperimentApiMetricsList | null;
@@ -29979,7 +29979,7 @@ export namespace Schemas {
start_date?: string | null;
/** @nullable */
end_date?: string | null;
- /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible. */
+ /** Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible. */
feature_flag_key?: string;
readonly feature_flag?: MinimalFeatureFlag;
readonly holdout?: ExperimentHoldout;
@@ -30014,7 +30014,7 @@ export namespace Schemas {
type?: ExperimentTypeEnum | null;
/** Exposure configuration including filter test accounts and custom exposure events. */
exposure_criteria?: ExperimentApiExposureCriteria | null;
- /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project. */
+ /** Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project. */
metrics?: _ExperimentApiMetricsList | null;
/** Secondary metrics for additional measurements. Same format as primary metrics. */
metrics_secondary?: _ExperimentApiMetricsList | null;
diff --git a/services/mcp/src/generated/experiments/api.ts b/services/mcp/src/generated/experiments/api.ts
index 99eacd1678f1..85eec3ec6f26 100644
--- a/services/mcp/src/generated/experiments/api.ts
+++ b/services/mcp/src/generated/experiments/api.ts
@@ -247,7 +247,7 @@ export const ExperimentsCreateBody = /* @__PURE__ */ zod
feature_flag_key: zod
.string()
.describe(
- "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible."
+ "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible."
),
holdout_id: zod.number().nullish().describe('ID of a holdout group to exclude from the experiment.'),
parameters: zod
@@ -1413,7 +1413,7 @@ export const ExperimentsCreateBody = /* @__PURE__ */ zod
])
.optional()
.describe(
- "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project."
+ "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project."
),
metrics_secondary: zod
.union([
@@ -2546,7 +2546,7 @@ export const ExperimentsPartialUpdateBody = /* @__PURE__ */ zod
.string()
.optional()
.describe(
- "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible."
+ "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible."
),
holdout_id: zod.number().nullish().describe('ID of a holdout group to exclude from the experiment.'),
parameters: zod
@@ -3709,7 +3709,7 @@ export const ExperimentsPartialUpdateBody = /* @__PURE__ */ zod
])
.optional()
.describe(
- "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project."
+ "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project."
),
metrics_secondary: zod
.union([
@@ -4873,7 +4873,7 @@ export const ExperimentsDuplicateCreateBody = /* @__PURE__ */ zod
feature_flag_key: zod
.string()
.describe(
- "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible."
+ "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible."
),
holdout_id: zod.number().nullish().describe('ID of a holdout group to exclude from the experiment.'),
parameters: zod
@@ -6039,7 +6039,7 @@ export const ExperimentsDuplicateCreateBody = /* @__PURE__ */ zod
])
.optional()
.describe(
- "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project."
+ "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project."
),
metrics_secondary: zod
.union([
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.json
index efcfd8121400..1ba9ac9dce83 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.json
@@ -197,7 +197,7 @@
"description": "Exposure configuration including filter test accounts and custom exposure events."
},
"feature_flag_key": {
- "description": "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible.",
+ "description": "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible.",
"type": "string"
},
"holdout_id": {
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json
index a62cab646a5a..c3ef87cab10a 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json
@@ -248,7 +248,7 @@
"description": "Exposure configuration including filter test accounts and custom exposure events."
},
"feature_flag_key": {
- "description": "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible.",
+ "description": "Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flag-get-all tool first — reuse an existing flag when possible.",
"type": "string"
},
"filters": {},
@@ -1903,7 +1903,7 @@
"type": "null"
}
],
- "description": "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project."
+ "description": "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project."
},
"metrics_secondary": {
"anyOf": [
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json
index 5df0d8131dd0..ac7045be4bff 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json
@@ -1874,7 +1874,7 @@
"type": "null"
}
],
- "description": "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project."
+ "description": "Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the read-data-schema tool with query kind 'events' to find available events in the project."
},
"metrics_secondary": {
"anyOf": [