:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(feature_flags): rename bulk_keys MCP op so the name matches its read-only behavior (#60741)
Rafael Audibert3c1eabd8e986
diff --git a/ee/hogai/eval/sandboxed/surveys/scorers.py b/ee/hogai/eval/sandboxed/surveys/scorers.pyindex 7e15874c09b4..557fe2e4bd3c 100644--- a/ee/hogai/eval/sandboxed/surveys/scorers.py+++ b/ee/hogai/eval/sandboxed/surveys/scorers.py@@ -21,7 +21,6 @@ SURVEY_FORBIDDEN_WRITE_TOOLS = frozenset("update-feature-flag","delete-feature-flag","feature-flags-bulk-delete-create",- "feature-flags-bulk-keys-create","feature-flags-bulk-update-tags-create","feature-flags-copy-flags-create","scheduled-changes-create",diff --git a/products/feature_flags/backend/api/feature_flag.py b/products/feature_flags/backend/api/feature_flag.pyindex 8214f8eb0501..2d29e0d97bb8 100644--- a/products/feature_flags/backend/api/feature_flag.py+++ b/products/feature_flags/backend/api/feature_flag.py@@ -2934,6 +2934,7 @@ class FeatureFlagViewSet()@extend_schema(+ operation_id="feature_flags_bulk_keys_retrieve",request=BulkKeysRequestSerializer,responses={200: OpenApiResponse(response=BulkKeysResponseSerializer),diff --git a/products/feature_flags/frontend/generated/api.ts b/products/feature_flags/frontend/generated/api.tsindex c283190f3973..84b77098b178 100644--- a/products/feature_flags/frontend/generated/api.ts+++ b/products/feature_flags/frontend/generated/api.ts@@ -502,7 +502,7 @@ export const featureFlagsBulkDeleteCreate = async (})}-export const getFeatureFlagsBulkKeysCreateUrl = (projectId: string) => {+export const getFeatureFlagsBulkKeysRetrieveUrl = (projectId: string) => {return `/api/projects/${projectId}/feature_flags/bulk_keys/`}@@ -510,12 +510,12 @@ export const getFeatureFlagsBulkKeysCreateUrl = (projectId: string) => {* Get feature flag keys by IDs.Accepts a list of feature flag IDs and returns a mapping of ID to key.*/-export const featureFlagsBulkKeysCreate = async (+export const featureFlagsBulkKeysRetrieve = async (projectId: string,bulkKeysRequestApi?: BulkKeysRequestApi,options?: RequestInit): Promise<BulkKeysResponseApi> => {- return apiMutator<BulkKeysResponseApi>(getFeatureFlagsBulkKeysCreateUrl(projectId), {+ return apiMutator<BulkKeysResponseApi>(getFeatureFlagsBulkKeysRetrieveUrl(projectId), {...options,method: 'POST',headers: { 'Content-Type': 'application/json', ...options?.headers },diff --git a/products/feature_flags/frontend/generated/api.zod.ts b/products/feature_flags/frontend/generated/api.zod.tsindex c44ff81e637c..c66a8c3bfb2d 100644--- a/products/feature_flags/frontend/generated/api.zod.ts+++ b/products/feature_flags/frontend/generated/api.zod.ts@@ -1053,7 +1053,7 @@ export const FeatureFlagsBulkDeleteCreateBody = /* @__PURE__ */ zod.object({* Get feature flag keys by IDs.Accepts a list of feature flag IDs and returns a mapping of ID to key.*/-export const FeatureFlagsBulkKeysCreateBody = /* @__PURE__ */ zod.object({+export const FeatureFlagsBulkKeysRetrieveBody = /* @__PURE__ */ zod.object({ids: zod.array(zod.unknown()).optional()diff --git a/products/feature_flags/mcp/tools.yaml b/products/feature_flags/mcp/tools.yamlindex 8f962a6fbcd3..569b4d61bbde 100644--- a/products/feature_flags/mcp/tools.yaml+++ b/products/feature_flags/mcp/tools.yaml@@ -141,8 +141,8 @@ tools:with `filters`, and prefer explicit `ids` whenever the user has named specific flags. Flags linked to activeexperiments, early access features, or that other flags depend on are skipped and reported in `errors`.Returns `deleted` (with each flag's rollout state at deletion time) and `errors` arrays.- feature-flags-bulk-keys-create:- operation: feature_flags_bulk_keys_create+ feature-flags-bulk-keys-retrieve:+ operation: feature_flags_bulk_keys_retrieveenabled: truescopes:- feature_flag:readdiff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 56736dc7d711..819a51a55ed7 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -2198,7 +2198,7 @@"readOnlyHint": false}},- "feature-flags-bulk-keys-create": {+ "feature-flags-bulk-keys-retrieve": {"description": "Resolve feature flag IDs to their string keys in one call. Pass `ids` as a list of integer flag IDs. Returns `keys` as a mapping of stringified ID to key for the IDs that exist in this project. Useful when you have IDs from another tool (e.g., dependent flags, scheduled changes) and need the keys for downstream calls.","category": "Feature flags","feature": "flags",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 5651734a412f..25bec2641ae7 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -2424,7 +2424,7 @@"readOnlyHint": false}},- "feature-flags-bulk-keys-create": {+ "feature-flags-bulk-keys-retrieve": {"description": "Resolve feature flag IDs to their string keys in one call. Pass `ids` as a list of integer flag IDs. Returns `keys` as a mapping of stringified ID to key for the IDs that exist in this project. Useful when you have IDs from another tool (e.g., dependent flags, scheduled changes) and need the keys for downstream calls.","category": "Feature flags","feature": "flags",diff --git a/services/mcp/src/generated/feature_flags/api.ts b/services/mcp/src/generated/feature_flags/api.tsindex 1c1aea1a1b1b..262abf32aeb9 100644--- a/services/mcp/src/generated/feature_flags/api.ts+++ b/services/mcp/src/generated/feature_flags/api.ts@@ -881,7 +881,7 @@ export const FeatureFlagsBulkDeleteCreateBody = /* @__PURE__ */ zod.object({* Get feature flag keys by IDs.Accepts a list of feature flag IDs and returns a mapping of ID to key.*/-export const FeatureFlagsBulkKeysCreateParams = /* @__PURE__ */ zod.object({+export const FeatureFlagsBulkKeysRetrieveParams = /* @__PURE__ */ zod.object({project_id: zod.string().describe(@@ -889,7 +889,7 @@ export const FeatureFlagsBulkKeysCreateParams = /* @__PURE__ */ zod.object({),})-export const FeatureFlagsBulkKeysCreateBody = /* @__PURE__ */ zod.object({+export const FeatureFlagsBulkKeysRetrieveBody = /* @__PURE__ */ zod.object({ids: zod.array(zod.unknown()).optional()diff --git a/services/mcp/src/tools/generated/feature_flags.ts b/services/mcp/src/tools/generated/feature_flags.tsindex 1adafdb91dec..99444dd1ad33 100644--- a/services/mcp/src/tools/generated/feature_flags.ts+++ b/services/mcp/src/tools/generated/feature_flags.ts@@ -6,7 +6,7 @@ import {FeatureFlagsActivityRetrieveParams,FeatureFlagsActivityRetrieveQueryParams,FeatureFlagsBulkDeleteCreateBody,- FeatureFlagsBulkKeysCreateBody,+ FeatureFlagsBulkKeysRetrieveBody,FeatureFlagsBulkUpdateTagsCreateBody,FeatureFlagsCopyFlagsCreateBody,FeatureFlagsCreateBody,@@ -209,12 +209,15 @@ const featureFlagsBulkDeleteCreate = (): ToolBase<},})-const FeatureFlagsBulkKeysCreateSchema = FeatureFlagsBulkKeysCreateBody+const FeatureFlagsBulkKeysRetrieveSchema = FeatureFlagsBulkKeysRetrieveBody-const featureFlagsBulkKeysCreate = (): ToolBase<typeof FeatureFlagsBulkKeysCreateSchema, Schemas.BulkKeysResponse> => ({- name: 'feature-flags-bulk-keys-create',- schema: FeatureFlagsBulkKeysCreateSchema,- handler: async (context: Context, params: z.infer<typeof FeatureFlagsBulkKeysCreateSchema>) => {+const featureFlagsBulkKeysRetrieve = (): ToolBase<+ typeof FeatureFlagsBulkKeysRetrieveSchema,+ Schemas.BulkKeysResponse+> => ({+ name: 'feature-flags-bulk-keys-retrieve',+ schema: FeatureFlagsBulkKeysRetrieveSchema,+ handler: async (context: Context, params: z.infer<typeof FeatureFlagsBulkKeysRetrieveSchema>) => {const projectId = await context.stateManager.getProjectId()const body: Record<string, unknown> = {}if (params.ids !== undefined) {@@ -627,7 +630,7 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {'feature-flag-get-definition': featureFlagGetDefinition,'feature-flags-activity-retrieve': featureFlagsActivityRetrieve,'feature-flags-bulk-delete-create': featureFlagsBulkDeleteCreate,- 'feature-flags-bulk-keys-create': featureFlagsBulkKeysCreate,+ 'feature-flags-bulk-keys-retrieve': featureFlagsBulkKeysRetrieve,'feature-flags-bulk-update-tags-create': featureFlagsBulkUpdateTagsCreate,'feature-flags-copy-flags-create': featureFlagsCopyFlagsCreate,'feature-flags-dependent-flags-retrieve': featureFlagsDependentFlagsRetrieve,diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flags-bulk-keys-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flags-bulk-keys-retrieve.jsonsimilarity index 100%rename from services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flags-bulk-keys-create.jsonrename to services/mcp/tests/unit/__snapshots__/tool-schemas/feature-flags-bulk-keys-retrieve.json