: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
feat(signals): expose inbox report state via mcp (#60219)
Andrew Maguirede75240c200f
diff --git a/products/signals/backend/test/test_signal_report_api.py b/products/signals/backend/test/test_signal_report_api.pyindex 1caecda6d673..e06f4259d6c9 100644--- a/products/signals/backend/test/test_signal_report_api.py+++ b/products/signals/backend/test/test_signal_report_api.py@@ -651,3 +651,74 @@ class TestSignalReportSuppressionAPI(APIBaseTest):assert not SignalReportArtefact.objects.filter(report=report, type=SignalReportArtefact.ArtefactType.DISMISSAL).exists()++ def test_rejects_unknown_state(self):+ report = self._create_report()+ response = self.client.post(+ self._state_url(str(report.id)),+ data=json.dumps({"state": "ready"}),+ content_type="application/json",+ )+ assert response.status_code == status.HTTP_400_BAD_REQUEST++ def test_snooze_for_delays_repromotion(self):+ report = SignalReport.objects.create(+ team=self.team, status=SignalReport.Status.READY, title="t", summary="s", signal_count=5+ )+ response = self.client.post(+ self._state_url(str(report.id)),+ data=json.dumps({"state": "potential", "snooze_for": 10}),+ content_type="application/json",+ )+ assert response.status_code == status.HTTP_200_OK, response.json()+ report.refresh_from_db()+ assert report.status == SignalReport.Status.POTENTIAL+ assert report.signals_at_run == 15++ @parameterized.expand([("zero", 0), ("negative", -1), ("too_large", 100_001)])+ def test_snooze_for_out_of_bounds_rejected(self, _name, snooze_for):+ report = self._create_report()+ response = self.client.post(+ self._state_url(str(report.id)),+ data=json.dumps({"state": "potential", "snooze_for": snooze_for}),+ content_type="application/json",+ )+ assert response.status_code == status.HTTP_400_BAD_REQUEST+ report.refresh_from_db()+ assert report.status == SignalReport.Status.READY++ def test_internal_transition_kwargs_are_not_injectable(self):+ # Callers must not be able to reach internal transition_to kwargs through the body.+ report = SignalReport.objects.create(+ team=self.team, status=SignalReport.Status.READY, title="t", summary="s", signal_count=5, total_weight=9.0+ )+ response = self.client.post(+ self._state_url(str(report.id)),+ data=json.dumps(+ {+ "state": "potential",+ "reset_weight": True,+ "error": "injected",+ "signals_at_run_increment": 999,+ }+ ),+ content_type="application/json",+ )+ assert response.status_code == status.HTTP_200_OK, response.json()+ report.refresh_from_db()+ assert report.status == SignalReport.Status.POTENTIAL+ # None of the injected kwargs took effect.+ assert report.total_weight == 9.0+ assert report.error is None+ assert report.signals_at_run == 0++ def test_can_reopen_suppressed_report(self):+ report = self._create_report(report_status=SignalReport.Status.SUPPRESSED)+ response = self.client.post(+ self._state_url(str(report.id)),+ data=json.dumps({"state": "potential"}),+ content_type="application/json",+ )+ assert response.status_code == status.HTTP_200_OK, response.json()+ report.refresh_from_db()+ assert report.status == SignalReport.Status.POTENTIALdiff --git a/products/signals/backend/views.py b/products/signals/backend/views.pyindex 44b5de00458a..3d37066376fc 100644--- a/products/signals/backend/views.py+++ b/products/signals/backend/views.py@@ -315,6 +315,46 @@ class SignalTeamConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):return Response(serializer.data)+SIGNAL_REPORT_DISMISSAL_NOTE_MAX_LENGTH = 4000+# Upper bound on how far a snooze can push out re-promotion. Generous enough for any+# realistic snooze, but bounded so a caller can't effectively block a report forever.+SIGNAL_REPORT_MAX_SNOOZE_FOR = 100_000+++class SignalReportStateRequestSerializer(serializers.Serializer):+ state = serializers.ChoiceField(+ choices=[("suppressed", "suppressed"), ("potential", "potential")],+ help_text=(+ "Target state for the report. Use 'suppressed' to dismiss the report from the inbox, "+ "or 'potential' to snooze/reopen it for later review."+ ),+ )+ dismissal_reason = serializers.CharField(+ required=False,+ allow_blank=True,+ help_text=(+ "Optional short reason code for the dismissal (e.g. 'not_a_bug', 'wont_fix', 'duplicate'). "+ "The set of reason codes is owned by the caller and is not validated server-side."+ ),+ )+ dismissal_note = serializers.CharField(+ required=False,+ allow_blank=True,+ max_length=SIGNAL_REPORT_DISMISSAL_NOTE_MAX_LENGTH,+ help_text="Optional free-form note explaining the dismissal. Capped at 4000 characters.",+ )+ snooze_for = serializers.IntegerField(+ required=False,+ min_value=1,+ max_value=SIGNAL_REPORT_MAX_SNOOZE_FOR,+ help_text=(+ "Optional, only honored when state is 'potential'. Number of additional signals the report "+ "must accumulate before it is re-promoted into the pipeline — effectively snoozing it until then. "+ "Omit to let the report re-enter the pipeline on the next matching signal."+ ),+ )++@extend_schema_view(destroy=extend_schema(exclude=True),)@@ -384,6 +424,11 @@ class SignalReportViewSet(status_filter = self.request.query_params.get("status")if status_filter:return queryset.filter(status__in=[s.strip() for s in status_filter.split(",") if s.strip()])+ # The `state` action reopens dismissed reports, so it must be able to reach a suppressed+ # report by ID — otherwise transitioning one back to "potential" would 404. Everywhere+ # else suppressed reports stay hidden unless an explicit `status` filter asks for them.+ if self.action == "state":+ return querysetreturn queryset.exclude(status=SignalReport.Status.SUPPRESSED)def _apply_signal_report_search_filter(self, queryset):@@ -762,60 +807,47 @@ class SignalReportViewSet(signals_list = fetch_signals_for_report_sync(self.team, str(report.id))return Response({"report": report_data, "signals": signals_list})- # The set of allowed reason codes is owned by PostHog Code (the calling UI),- # not validated here -- we just persist whatever the client sends.- DISMISSAL_NOTE_MAX_LENGTH = 4000-- @extend_schema(exclude=True)+ @extend_schema(+ request=SignalReportStateRequestSerializer,+ responses={200: SignalReportSerializer},+ )@action(detail=True, methods=["post"], url_path="state", required_scopes=["task:write"])def state(self, request, pk=None, **kwargs):"""Transition a report to a new state. The model validates allowed transitions.+ The request body is validated by SignalReportStateRequestSerializer — only the+ fields it declares (state, dismissal_reason, dismissal_note, snooze_for) are read,+ and only snooze_for is ever forwarded to transition_to. Any other key is ignored,+ so internal transition_to kwargs (reset_weight, error, ...) can't be injected.+Body: {"state": "suppressed" | "potential",# Optional dismissal feedback (honored when state == "suppressed" or "potential"):"dismissal_reason": "<any string code, owned by the caller>","dismissal_note": "free-form text",- ...other kwargs passed to transition_to+ # Optional, only honored for state == "potential":+ "snooze_for": <number of additional signals before re-promotion>,}"""report = cast(SignalReport, self.get_object())- target = request.data.get("state")- if target not in ("suppressed", "potential"):- return Response(- {"error": "state must be one of ['suppressed', 'potential']"},- status=status.HTTP_400_BAD_REQUEST,- )-- # Pull dismissal fields out before passing the rest to transition_to.- dismissal_reason = request.data.get("dismissal_reason")- dismissal_note = request.data.get("dismissal_note")- transition_kwargs = {- k: v for k, v in request.data.items() if k not in ("state", "dismissal_reason", "dismissal_note")- }+ serializer = SignalReportStateRequestSerializer(data=request.data)+ serializer.is_valid(raise_exception=True)+ data = serializer.validated_data- if dismissal_reason is not None and not isinstance(dismissal_reason, str):- return Response(- {"error": "dismissal_reason must be a string."},- status=status.HTTP_400_BAD_REQUEST,- )+ target = data["state"]+ dismissal_reason = data.get("dismissal_reason")+ dismissal_note = data.get("dismissal_note")- if dismissal_note is not None:- if not isinstance(dismissal_note, str):- return Response(- {"error": "dismissal_note must be a string."},- status=status.HTTP_400_BAD_REQUEST,- )- if len(dismissal_note) > self.DISMISSAL_NOTE_MAX_LENGTH:- return Response(- {"error": f"dismissal_note must be at most {self.DISMISSAL_NOTE_MAX_LENGTH} characters."},- status=status.HTTP_400_BAD_REQUEST,- )+ # Only `snooze_for` (on a snooze back to "potential") is caller-controllable. Every other+ # `transition_to` kwarg (signals_at_run_increment, reset_weight, title, summary, error) is an+ # internal pipeline concern and must never be reachable from this public API surface, so it is+ # passed explicitly rather than splatting caller-supplied kwargs.+ snooze_for = data.get("snooze_for") if target == "potential" else Nonetry:- updated_fields = report.transition_to(SignalReport.Status(target), **transition_kwargs)+ updated_fields = report.transition_to(SignalReport.Status(target), snooze_for=snooze_for)except InvalidStatusTransition as e:logger.warning("Invalid status transition for SignalReport %s: %s", report.id, e, exc_info=True)return Response(diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.tsindex 54627ffde0dd..275774dbab18 100644--- a/products/signals/frontend/generated/api.schemas.ts+++ b/products/signals/frontend/generated/api.schemas.ts@@ -108,6 +108,39 @@ export interface PaginatedSignalReportListApi {results: SignalReportApi[]}+/**+ * * `suppressed` - suppressed+ * `potential` - potential+ */+export type SignalReportStateRequestStateEnumApi =+ (typeof SignalReportStateRequestStateEnumApi)[keyof typeof SignalReportStateRequestStateEnumApi]++export const SignalReportStateRequestStateEnumApi = {+ Suppressed: 'suppressed',+ Potential: 'potential',+} as const++export interface SignalReportStateRequestApi {+ /** Target state for the report. Use 'suppressed' to dismiss the report from the inbox, or 'potential' to snooze/reopen it for later review.++ * `suppressed` - suppressed+ * `potential` - potential */+ state: SignalReportStateRequestStateEnumApi+ /** Optional short reason code for the dismissal (e.g. 'not_a_bug', 'wont_fix', 'duplicate'). The set of reason codes is owned by the caller and is not validated server-side. */+ dismissal_reason?: string+ /**+ * Optional free-form note explaining the dismissal. Capped at 4000 characters.+ * @maxLength 4000+ */+ dismissal_note?: string+ /**+ * Optional, only honored when state is 'potential'. Number of additional signals the report must accumulate before it is re-promoted into the pipeline — effectively snoozing it until then. Omit to let the report re-enter the pipeline on the next matching signal.+ * @minimum 1+ * @maximum 100000+ */+ snooze_for?: number+}+/*** `inventory.project_context` — free-form orientation about the project's product.*/diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.tsindex ccd9cbe5d084..193c09351f36 100644--- a/products/signals/frontend/generated/api.ts+++ b/products/signals/frontend/generated/api.ts@@ -23,6 +23,7 @@ import type {RememberRequestApi,ScratchpadEntryApi,SignalReportApi,+ SignalReportStateRequestApi,SignalScoutRunDetailApi,SignalScoutRunSummaryApi,SignalSourceConfigApi,@@ -161,6 +162,41 @@ export const signalsReportsRetrieve = async (})}+export const getSignalsReportsStateCreateUrl = (projectId: string, id: string) => {+ return `/api/projects/${projectId}/signals/reports/${id}/state/`+}++/**+ * Transition a report to a new state. The model validates allowed transitions.++The request body is validated by SignalReportStateRequestSerializer — only the+fields it declares (state, dismissal_reason, dismissal_note, snooze_for) are read,+and only snooze_for is ever forwarded to transition_to. Any other key is ignored,+so internal transition_to kwargs (reset_weight, error, ...) can't be injected.++Body: {+ "state": "suppressed" | "potential",+ # Optional dismissal feedback (honored when state == "suppressed" or "potential"):+ "dismissal_reason": "<any string code, owned by the caller>",+ "dismissal_note": "free-form text",+ # Optional, only honored for state == "potential":+ "snooze_for": <number of additional signals before re-promotion>,+}+ */+export const signalsReportsStateCreate = async (+ projectId: string,+ id: string,+ signalReportStateRequestApi: SignalReportStateRequestApi,+ options?: RequestInit+): Promise<SignalReportApi> => {+ return apiMutator<SignalReportApi>(getSignalsReportsStateCreateUrl(projectId, id), {+ ...options,+ method: 'POST',+ headers: { 'Content-Type': 'application/json', ...options?.headers },+ body: JSON.stringify(signalReportStateRequestApi),+ })+}+export const getSignalsScoutProjectProfileGetUrl = (projectId: string,params?: SignalsScoutProjectProfileGetParamsdiff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.tsindex 34a65cc683fa..9af82f533dbd 100644--- a/products/signals/frontend/generated/api.zod.ts+++ b/products/signals/frontend/generated/api.zod.ts@@ -18,6 +18,55 @@ export const SignalsProcessingPauseUpdateBody = /* @__PURE__ */ zod.object({.describe('Pause the grouping pipeline until this timestamp (ISO 8601).'),})+/**+ * Transition a report to a new state. The model validates allowed transitions.++The request body is validated by SignalReportStateRequestSerializer — only the+fields it declares (state, dismissal_reason, dismissal_note, snooze_for) are read,+and only snooze_for is ever forwarded to transition_to. Any other key is ignored,+so internal transition_to kwargs (reset_weight, error, ...) can't be injected.++Body: {+ "state": "suppressed" | "potential",+ # Optional dismissal feedback (honored when state == "suppressed" or "potential"):+ "dismissal_reason": "<any string code, owned by the caller>",+ "dismissal_note": "free-form text",+ # Optional, only honored for state == "potential":+ "snooze_for": <number of additional signals before re-promotion>,+}+ */+export const signalsReportsStateCreateBodyDismissalNoteMax = 4000++export const signalsReportsStateCreateBodySnoozeForMax = 100000++export const SignalsReportsStateCreateBody = /* @__PURE__ */ zod.object({+ state: zod+ .enum(['suppressed', 'potential'])+ .describe('\* `suppressed` - suppressed\n\* `potential` - potential')+ .describe(+ "Target state for the report. Use 'suppressed' to dismiss the report from the inbox, or 'potential' to snooze\/reopen it for later review.\n\n\* `suppressed` - suppressed\n\* `potential` - potential"+ ),+ dismissal_reason: zod+ .string()+ .optional()+ .describe(+ "Optional short reason code for the dismissal (e.g. 'not_a_bug', 'wont_fix', 'duplicate'). The set of reason codes is owned by the caller and is not validated server-side."+ ),+ dismissal_note: zod+ .string()+ .max(signalsReportsStateCreateBodyDismissalNoteMax)+ .optional()+ .describe('Optional free-form note explaining the dismissal. Capped at 4000 characters.'),+ snooze_for: zod+ .number()+ .min(1)+ .max(signalsReportsStateCreateBodySnoozeForMax)+ .optional()+ .describe(+ "Optional, only honored when state is 'potential'. Number of additional signals the report must accumulate before it is re-promoted into the pipeline — effectively snoozing it until then. Omit to let the report re-enter the pipeline on the next matching signal."+ ),+})+/*** Fire `emit_signal` with `source_product = signals_scout`. The `finding_id` is baked into the deterministic `Signal.source_id = run:<id>:finding:<id>` for traceability, but this is NOT idempotent — a second call with the same `finding_id` emits a second signal, so do not retry an emit that may have already succeeded.* @summary Emit a finding for a rundiff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yamlindex fc3aacb7b583..e5b842c93d1e 100644--- a/products/signals/mcp/tools.yaml+++ b/products/signals/mcp/tools.yaml@@ -69,6 +69,24 @@ tools:actionability judgments, signal_count, total_weight, source products, and the URL of the implementation PRif one has been opened. To inspect the underlying signals or judgment artefacts, follow up with a HogQLquery (see the 'signals' skill) — those endpoints are not yet exposed via MCP.+ inbox-reports-set-state:+ operation: signals_reports_state_create+ enabled: true+ scopes:+ - task:write+ annotations:+ readOnly: false+ destructive: true+ idempotent: false+ enrich_url: '{id}'+ title: Dismiss or snooze a signal report+ description: >+ Transition a signal report to a new state. Use 'suppressed' to dismiss the report from the inbox (the user+ has reviewed it and decided no action is needed), or 'potential' to snooze it back into the pipeline for+ later review. Optionally include a `dismissal_reason` (a short string code owned by the caller, e.g.+ 'not_a_bug', 'wont_fix', 'duplicate') and a `dismissal_note` (free-form text, up to 4000 chars) — both are+ persisted as a DISMISSAL artefact on the report so the rationale is preserved even if the report transitions+ again later. Returns 409 if the transition is not allowed from the report's current status.inbox-source-configs-create:operation: signals_source_configs_createenabled: falsediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex bd6c747e1586..bb61490c1d01 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -2422,6 +2422,20 @@"readOnlyHint": true}},+ "inbox-reports-set-state": {+ "description": "Transition a signal report to a new state. Use 'suppressed' to dismiss the report from the inbox (the user has reviewed it and decided no action is needed), or 'potential' to snooze it back into the pipeline for later review. Optionally include a `dismissal_reason` (a short string code owned by the caller, e.g. 'not_a_bug', 'wont_fix', 'duplicate') and a `dismissal_note` (free-form text, up to 4000 chars) — both are persisted as a DISMISSAL artefact on the report so the rationale is preserved even if the report transitions again later. Returns 409 if the transition is not allowed from the report's current status.",+ "category": "Signals",+ "feature": "signals",+ "summary": "Dismiss or snooze a signal report",+ "title": "Dismiss or snooze a signal report",+ "required_scopes": ["task:write"],+ "annotations": {+ "destructiveHint": true,+ "idempotentHint": false,+ "openWorldHint": true,+ "readOnlyHint": false+ }+ },"inbox-source-configs-list": {"description": "List the configured signal sources for the current project. A signal source ties a product (e.g. error_tracking, session_replay, github, linear, zendesk) and a source_type to an enabled flag and configuration. The 'status' field reflects the current state of the underlying data import or workflow (running, completed, failed) when applicable.","category": "Signals",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 8fe82f8b1304..f0ec384852a5 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -2662,6 +2662,20 @@"readOnlyHint": true}},+ "inbox-reports-set-state": {+ "description": "Transition a signal report to a new state. Use 'suppressed' to dismiss the report from the inbox (the user has reviewed it and decided no action is needed), or 'potential' to snooze it back into the pipeline for later review. Optionally include a `dismissal_reason` (a short string code owned by the caller, e.g. 'not_a_bug', 'wont_fix', 'duplicate') and a `dismissal_note` (free-form text, up to 4000 chars) — both are persisted as a DISMISSAL artefact on the report so the rationale is preserved even if the report transitions again later. Returns 409 if the transition is not allowed from the report's current status.",+ "category": "Signals",+ "feature": "signals",+ "summary": "Dismiss or snooze a signal report",+ "title": "Dismiss or snooze a signal report",+ "required_scopes": ["task:write"],+ "annotations": {+ "destructiveHint": true,+ "idempotentHint": false,+ "openWorldHint": true,+ "readOnlyHint": false+ }+ },"inbox-source-configs-list": {"description": "List the configured signal sources for the current project. A signal source ties a product (e.g. error_tracking, session_replay, github, linear, zendesk) and a source_type to an enabled flag and configuration. The 'status' field reflects the current state of the underlying data import or workflow (running, completed, failed) when applicable.","category": "Signals",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 53de05f6f78b..1977b8b47890 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -37365,6 +37365,39 @@ export namespace Schemas {release_to_everyone?: boolean;}+ /**+ * * `suppressed` - suppressed+ * `potential` - potential+ */+ export type SignalReportStateRequestStateEnum = typeof SignalReportStateRequestStateEnum[keyof typeof SignalReportStateRequestStateEnum];+++ export const SignalReportStateRequestStateEnum = {+ Suppressed: 'suppressed',+ Potential: 'potential',+ } as const;++ export interface SignalReportStateRequest {+ /** Target state for the report. Use 'suppressed' to dismiss the report from the inbox, or 'potential' to snooze/reopen it for later review.++ * `suppressed` - suppressed+ * `potential` - potential */+ state: SignalReportStateRequestStateEnum;+ /** Optional short reason code for the dismissal (e.g. 'not_a_bug', 'wont_fix', 'duplicate'). The set of reason codes is owned by the caller and is not validated server-side. */+ dismissal_reason?: string;+ /**+ * Optional free-form note explaining the dismissal. Capped at 4000 characters.+ * @maxLength 4000+ */+ dismissal_note?: string;+ /**+ * Optional, only honored when state is 'potential'. Number of additional signals the report must accumulate before it is re-promoted into the pipeline — effectively snoozing it until then. Omit to let the report re-enter the pipeline on the next matching signal.+ * @minimum 1+ * @maximum 100000+ */+ snooze_for?: number;+ }+/*** Full `SignalScoutRun` projection used by `get-run`. Same shape as the summarytoday; kept distinct so future detail-only extensions (linked Signal rows,diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.tsindex d6fe3edbc58b..098592267b9e 100644--- a/services/mcp/src/generated/signals/api.ts+++ b/services/mcp/src/generated/signals/api.ts@@ -3,7 +3,7 @@* MCP service uses these Zod schemas for generated tool handlers.* To regenerate: hogli build:openapi*- * PostHog API - MCP 11 enabled ops+ * PostHog API - MCP 12 enabled ops* OpenAPI spec version: 1.0.0*/import * as zod from 'zod'@@ -55,6 +55,64 @@ export const SignalsReportsRetrieveParams = /* @__PURE__ */ zod.object({),})+/**+ * Transition a report to a new state. The model validates allowed transitions.++The request body is validated by SignalReportStateRequestSerializer — only the+fields it declares (state, dismissal_reason, dismissal_note, snooze_for) are read,+and only snooze_for is ever forwarded to transition_to. Any other key is ignored,+so internal transition_to kwargs (reset_weight, error, ...) can't be injected.++Body: {+ "state": "suppressed" | "potential",+ # Optional dismissal feedback (honored when state == "suppressed" or "potential"):+ "dismissal_reason": "<any string code, owned by the caller>",+ "dismissal_note": "free-form text",+ # Optional, only honored for state == "potential":+ "snooze_for": <number of additional signals before re-promotion>,+}+ */+export const SignalsReportsStateCreateParams = /* @__PURE__ */ zod.object({+ id: zod.string().describe('A UUID string identifying this signal report.'),+ 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 signalsReportsStateCreateBodyDismissalNoteMax = 4000++export const signalsReportsStateCreateBodySnoozeForMax = 100000++export const SignalsReportsStateCreateBody = /* @__PURE__ */ zod.object({+ state: zod+ .enum(['suppressed', 'potential'])+ .describe('* `suppressed` - suppressed\n* `potential` - potential')+ .describe(+ "Target state for the report. Use 'suppressed' to dismiss the report from the inbox, or 'potential' to snooze/reopen it for later review.\n\n* `suppressed` - suppressed\n* `potential` - potential"+ ),+ dismissal_reason: zod+ .string()+ .optional()+ .describe(+ "Optional short reason code for the dismissal (e.g. 'not_a_bug', 'wont_fix', 'duplicate'). The set of reason codes is owned by the caller and is not validated server-side."+ ),+ dismissal_note: zod+ .string()+ .max(signalsReportsStateCreateBodyDismissalNoteMax)+ .optional()+ .describe('Optional free-form note explaining the dismissal. Capped at 4000 characters.'),+ snooze_for: zod+ .number()+ .min(1)+ .max(signalsReportsStateCreateBodySnoozeForMax)+ .optional()+ .describe(+ "Optional, only honored when state is 'potential'. Number of additional signals the report must accumulate before it is re-promoted into the pipeline — effectively snoozing it until then. Omit to let the report re-enter the pipeline on the next matching signal."+ ),+})+/*** Return the team's deterministic project profile. For the internal scout token the response reflects the newest non-expired cached row or a freshly-built one (lazy compute on cache miss); `force_refresh=true` skips the cache and rebuilds from authoritative sources. Public read callers (session auth or a `signal_scout:read` PAK) get the newest cached profile, or 404 if none has been built yet — they never trigger a rebuild. Read this at the start of a run to orient on the team's product mix, integrations, warehouse sources, signal coverage, and existing inbox surface.* @summary Get the current project profilediff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.tsindex 7c57abc72643..aaf7a035078d 100644--- a/services/mcp/src/tools/generated/signals.ts+++ b/services/mcp/src/tools/generated/signals.ts@@ -5,6 +5,8 @@ import type { Schemas } from '@/api/generated'import {SignalsReportsListQueryParams,SignalsReportsRetrieveParams,+ SignalsReportsStateCreateBody,+ SignalsReportsStateCreateParams,SignalsScoutEmitSignalBody,SignalsScoutEmitSignalParams,SignalsScoutProjectProfileGetQueryParams,@@ -91,6 +93,37 @@ const inboxReportsRetrieve = (): ToolBase<typeof InboxReportsRetrieveSchema, Wit},})+const InboxReportsSetStateSchema = SignalsReportsStateCreateParams.omit({ project_id: true }).extend(+ SignalsReportsStateCreateBody.shape+)++const inboxReportsSetState = (): ToolBase<typeof InboxReportsSetStateSchema, WithPostHogUrl<Schemas.SignalReport>> => ({+ name: 'inbox-reports-set-state',+ schema: InboxReportsSetStateSchema,+ handler: async (context: Context, params: z.infer<typeof InboxReportsSetStateSchema>) => {+ const projectId = await context.stateManager.getProjectId()+ const body: Record<string, unknown> = {}+ if (params.state !== undefined) {+ body['state'] = params.state+ }+ if (params.dismissal_reason !== undefined) {+ body['dismissal_reason'] = params.dismissal_reason+ }+ if (params.dismissal_note !== undefined) {+ body['dismissal_note'] = params.dismissal_note+ }+ if (params.snooze_for !== undefined) {+ body['snooze_for'] = params.snooze_for+ }+ const result = await context.api.request<Schemas.SignalReport>({+ method: 'POST',+ path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/reports/${encodeURIComponent(String(params.id))}/state/`,+ body,+ })+ return await withPostHogUrl(context, result, `/inbox/${result.id}`)+ },+})+const InboxSourceConfigsListSchema = SignalsSourceConfigsListQueryParamsconst inboxSourceConfigsList = (): ToolBase<@@ -331,6 +364,7 @@ const signalsScoutScratchpadSearch = (): ToolBase<export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {'inbox-reports-list': inboxReportsList,'inbox-reports-retrieve': inboxReportsRetrieve,+ 'inbox-reports-set-state': inboxReportsSetState,'inbox-source-configs-list': inboxSourceConfigsList,'inbox-source-configs-retrieve': inboxSourceConfigsRetrieve,'signals-scout-emit-signal': signalsScoutEmitSignal,diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-set-state.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-set-state.jsonnew file mode 100644index 000000000000..27326899d739--- /dev/null+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-set-state.json@@ -0,0 +1,31 @@+{+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "properties": {+ "dismissal_note": {+ "description": "Optional free-form note explaining the dismissal. Capped at 4000 characters.",+ "maxLength": 4000,+ "type": "string"+ },+ "dismissal_reason": {+ "description": "Optional short reason code for the dismissal (e.g. 'not_a_bug', 'wont_fix', 'duplicate'). The set of reason codes is owned by the caller and is not validated server-side.",+ "type": "string"+ },+ "id": {+ "description": "A UUID string identifying this signal report.",+ "type": "string"+ },+ "snooze_for": {+ "description": "Optional, only honored when state is 'potential'. Number of additional signals the report must accumulate before it is re-promoted into the pipeline — effectively snoozing it until then. Omit to let the report re-enter the pipeline on the next matching signal.",+ "maximum": 100000,+ "minimum": 1,+ "type": "number"+ },+ "state": {+ "description": "Target state for the report. Use 'suppressed' to dismiss the report from the inbox, or 'potential' to snooze/reopen it for later review.\n\n* `suppressed` - suppressed\n* `potential` - potential",+ "enum": ["suppressed", "potential"],+ "type": "string"+ }+ },+ "required": ["id", "state"],+ "type": "object"+}