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(signals): add self-driving inbox to MCP (#92769)

Mikayla Thompson6a9e3c49a110
diff --git a/products/signals/backend/test/test_signal_report_api.py b/products/signals/backend/test/test_signal_report_api.py
index 479645bffa1f..9eea2a490619 100644
--- a/products/signals/backend/test/test_signal_report_api.py
+++ b/products/signals/backend/test/test_signal_report_api.py
@@ -36,7 +36,14 @@ from products.signals.backend.implementation_pr import (
fetch_implementation_pr_state_for_reports,
fetch_implementation_pr_urls_for_reports,
)
-from products.signals.backend.models import ArtefactAttribution, SignalReport, SignalReportArtefact, SignalReportTask
+from products.signals.backend.models import (
+ ArtefactAttribution,
+ SignalReport,
+ SignalReportArtefact,
+ SignalReportTask,
+ SignalTeamConfig,
+ SignalUserAutonomyConfig,
+)
from products.signals.backend.signal_metadata import ReportSignalMeta
from products.signals.backend.task_run_artefacts import (
TASK_RUN_TYPE_DISCUSSION,
@@ -201,8 +208,14 @@ class TestSignalReportListAPI(APIBaseTest):
attribution=ArtefactAttribution.system(),
)
- def _actionability_artefact(self, report: SignalReport, *, actionability: str) -> SignalReportArtefact:
- payload = {"explanation": "x", "actionability": actionability, "already_addressed": False}
+ def _actionability_artefact(
+ self, report: SignalReport, *, actionability: str, already_addressed: bool = False
+ ) -> SignalReportArtefact:
+ payload = {
+ "explanation": "x",
+ "actionability": actionability,
+ "already_addressed": already_addressed,
+ }
art = SignalReportArtefact(
team=self.team,
report=report,
@@ -1100,6 +1113,55 @@ class TestSignalReportListAPI(APIBaseTest):
assert body["attr"] == "actionability"
assert body["code"] == "invalid_input"
+ def test_inbox_view_returns_prioritized_actionable_reports_and_can_show_dismissed(self):
+ p1 = self._create_report(title="P1 actionable")
+ self._actionability_artefact(p1, actionability="immediately_actionable")
+ self._priority_artefact(p1, priority="P1")
+ p0 = self._create_report(title="P0 actionable")
+ self._actionability_artefact(p0, actionability="immediately_actionable")
+ self._priority_artefact(p0, priority="P0")
+ addressed = self._create_report(title="Already addressed")
+ self._actionability_artefact(addressed, actionability="immediately_actionable", already_addressed=True)
+ dismissed = self._create_report(title="Dismissed", status=SignalReport.Status.SUPPRESSED)
+
+ response = self.client.get(self._list_url(view="actionable", scope="entire_project", sort="priority"))
+
+ assert response.status_code == status.HTTP_200_OK
+ assert [row["id"] for row in response.json()["results"]] == [str(p0.id), str(p1.id)]
+
+ response = self.client.get(self._list_url(view="dismissed", scope="entire_project", sort="priority"))
+
+ assert response.status_code == status.HTTP_200_OK
+ assert [row["id"] for row in response.json()["results"]] == [str(dismissed.id)]
+
+ def test_priority_preference_uses_personal_threshold_then_project_threshold(self):
+ reports_by_priority: dict[str, SignalReport] = {}
+ for priority in ("P0", "P1", "P2"):
+ report = self._create_report(title=f"{priority} report")
+ self._priority_artefact(report, priority=priority)
+ reports_by_priority[priority] = report
+
+ team_config, _ = SignalTeamConfig.objects.get_or_create(team=self.team)
+ team_config.default_autostart_priority = "P2"
+ team_config.save(update_fields=["default_autostart_priority"])
+
+ response = self.client.get(self._list_url(use_priority_preference="true", sort="priority"))
+ assert response.status_code == status.HTTP_200_OK
+ assert [row["id"] for row in response.json()["results"]] == [
+ str(reports_by_priority["P0"].id),
+ str(reports_by_priority["P1"].id),
+ str(reports_by_priority["P2"].id),
+ ]
+
+ SignalUserAutonomyConfig.objects.create(user=self.user, autostart_priority="P1")
+
+ response = self.client.get(self._list_url(use_priority_preference="true", sort="priority"))
+ assert response.status_code == status.HTTP_200_OK
+ assert [row["id"] for row in response.json()["results"]] == [
+ str(reports_by_priority["P0"].id),
+ str(reports_by_priority["P1"].id),
+ ]
+
# --- source_products ---
def test_source_products_defaults_to_empty_list(self):
diff --git a/products/signals/backend/views.py b/products/signals/backend/views.py
index 40518a2322cb..e0a3e865f3fb 100644
--- a/products/signals/backend/views.py
+++ b/products/signals/backend/views.py
@@ -828,12 +828,21 @@ class SignalReportViewSet(
# Requires `latest_actionability_value` annotation to be applied first.
_Q_READY_NOT_ACTIONABLE = Q(status=SignalReport.Status.READY) & Q(latest_actionability_value="not_actionable")
_DEFAULT_SIGNAL_REPORT_ORDERING = "-is_suggested_reviewer,status,-updated_at"
+ _INBOX_SORT_ORDERINGS = {
+ "priority": "priority,status,-updated_at",
+ "last_updated": "-updated_at,status",
+ "newest": "-created_at,status,-updated_at",
+ "oldest": "created_at,status,-updated_at",
+ }
+ _INBOX_VIEWS = frozenset(
+ {"actionable", "needs_input", "monitoring", "resolved", "dismissed", "not_actionable", "all"}
+ )
_SIGNAL_REPORT_ORDERING_FIELDS: dict[str, str] = {
"status": "pipeline_status_rank",
"is_suggested_reviewer": "is_suggested_reviewer",
"signal_count": "signal_count",
"total_weight": "total_weight",
- "priority": "priority_rank",
+ "priority": "priority_sort_rank",
"created_at": "created_at",
"updated_at": "updated_at",
"id": "id",
@@ -851,7 +860,7 @@ class SignalReportViewSet(
qs = self._scope_signal_report_queryset(queryset)
qs = self._exclude_deleted_signal_reports(qs)
qs = self._apply_signal_report_status_filter(qs)
- qs = self._annotate_latest_actionability_value(qs)
+ qs = self._annotate_latest_actionability(qs)
qs = self._prefetch_signal_report_priority_artefacts(qs)
qs = self._annotate_is_suggested_reviewer(qs)
return annotate_first_billable_pr_run_at(qs)
@@ -867,9 +876,12 @@ class SignalReportViewSet(
qs = self._apply_signal_report_implementation_pr_filter(qs)
qs = self._apply_signal_report_channel_filter(qs)
qs = self._apply_signal_report_suggested_reviewer_filter(qs)
+ qs = self._apply_signal_report_inbox_scope_filter(qs)
qs = self._apply_signal_report_task_filter(qs)
- qs = self._annotate_latest_actionability_value(qs)
+ qs = self._annotate_latest_actionability(qs)
qs = self._apply_signal_report_actionability_filter(qs)
+ qs = self._apply_signal_report_already_addressed_filter(qs)
+ qs = self._apply_signal_report_inbox_view_filter(qs)
qs = self._annotate_signal_report_status_rank(qs)
qs = self._annotate_signal_report_priority(qs)
qs = self._apply_signal_report_priority_filter(qs)
@@ -974,6 +986,8 @@ class SignalReportViewSet(
return queryset
if self._include_all_statuses_requested():
return queryset
+ if self.request.query_params.get("view") in {"dismissed", "all"}:
+ return queryset
return queryset.exclude(status=SignalReport.Status.SUPPRESSED)
def _include_all_statuses_requested(self) -> bool:
@@ -1145,6 +1159,9 @@ class SignalReportViewSet(
return queryset
reviewer_user_uuids = [s.strip() for s in suggested_reviewer_filter.split(",") if s.strip()]
+ return self._filter_signal_reports_by_suggested_reviewers(queryset, reviewer_user_uuids)
+
+ def _filter_signal_reports_by_suggested_reviewers(self, queryset, reviewer_user_uuids: list[str]):
try:
reviewer_user_uuids = [str(uuid.UUID(user_uuid)) for user_uuid in reviewer_user_uuids]
except (ValueError, AttributeError) as e:
@@ -1170,6 +1187,22 @@ class SignalReportViewSet(
)
)
+ def _apply_signal_report_inbox_scope_filter(self, queryset):
+ scope = self.request.query_params.get("scope")
+ if not scope or scope == "entire_project":
+ return queryset
+ if scope == "for_me":
+ user = cast(User, self.request.user)
+ return self._filter_signal_reports_by_suggested_reviewers(queryset, [str(user.uuid)])
+ if scope == "teammate":
+ teammate_uuid = (self.request.query_params.get("teammate_uuid") or "").strip()
+ if not teammate_uuid:
+ raise serializers.ValidationError({"teammate_uuid": "This field is required when scope is teammate."})
+ return self._filter_signal_reports_by_suggested_reviewers(queryset, [teammate_uuid])
+ raise serializers.ValidationError(
+ {"scope": f"Invalid value: {scope!r}. Allowed: for_me, entire_project, teammate."}
+ )
+
def _apply_signal_report_task_filter(self, queryset):
# Reports a given task is associated with — used by running agents ("which reports am I
# working against?") and by the agent harness to fan commit artefacts out to them. Uses the
@@ -1188,6 +1221,20 @@ class SignalReportViewSet(
# Filters on the `priority_rank` annotation, which must be applied first.
# Reports without a priority artefact (coalesced to "~") are excluded when this filter is set.
priority_filter = self.request.query_params.get("priority")
+ if not priority_filter and self.request.query_params.get("use_priority_preference", "false").lower() == "true":
+ user = cast(User, self.request.user)
+ personal_threshold = (
+ SignalUserAutonomyConfig.objects.filter(user=user).values_list("autostart_priority", flat=True).first()
+ )
+ project_threshold = (
+ SignalTeamConfig.objects.filter(team=self.team)
+ .values_list("default_autostart_priority", flat=True)
+ .first()
+ or AutonomyPriority.P4
+ )
+ threshold = personal_threshold or project_threshold
+ values = AutonomyPriority.values[: AutonomyPriority.values.index(threshold) + 1]
+ return queryset.filter(priority_rank__in=values)
if not priority_filter:
return queryset
@@ -1234,6 +1281,44 @@ class SignalReportViewSet(
return queryset.filter(latest_actionability_value__in=values)
+ def _apply_signal_report_already_addressed_filter(self, queryset):
+ raw = self.request.query_params.get("already_addressed")
+ if raw is None or not raw.strip():
+ return queryset
+ value = raw.strip().lower()
+ if value in ("1", "true", "yes"):
+ return queryset.filter(latest_already_addressed_value="true")
+ if value in ("0", "false", "no"):
+ return queryset.exclude(latest_already_addressed_value="true")
+ raise serializers.ValidationError({"already_addressed": f"Invalid value: {raw!r}. Allowed: true, false."})
+
+ def _apply_signal_report_inbox_view_filter(self, queryset):
+ inbox_view = self.request.query_params.get("view")
+ if not inbox_view:
+ return queryset
+ if inbox_view not in self._INBOX_VIEWS:
+ allowed = ", ".join(sorted(self._INBOX_VIEWS))
+ raise serializers.ValidationError({"view": f"Invalid value: {inbox_view!r}. Allowed: {allowed}."})
+ if inbox_view == "actionable":
+ return queryset.filter(
+ status=SignalReport.Status.READY,
+ latest_actionability_value=ActionabilityChoice.IMMEDIATELY_ACTIONABLE.value,
+ ).exclude(self._implementation_pr_report_filter() | Q(latest_already_addressed_value="true"))
+ if inbox_view == "needs_input":
+ return queryset.filter(
+ status=SignalReport.Status.PENDING_INPUT,
+ latest_actionability_value=ActionabilityChoice.REQUIRES_HUMAN_INPUT.value,
+ )
+ if inbox_view == "monitoring":
+ return queryset.filter(status=SignalReport.Status.READY).filter(self._implementation_pr_report_filter())
+ if inbox_view == "resolved":
+ return queryset.filter(status=SignalReport.Status.RESOLVED)
+ if inbox_view == "dismissed":
+ return queryset.filter(status=SignalReport.Status.SUPPRESSED)
+ if inbox_view == "not_actionable":
+ return queryset.filter(latest_actionability_value=ActionabilityChoice.NOT_ACTIONABLE.value)
+ return queryset
+
def _annotate_signal_report_status_rank(self, queryset):
# `ordering=status` uses semantic stage rank (annotation), not lexicographic `status` column order.
# `status=ready` splits into two virtual stages (requires `latest_actionability_value`):
@@ -1277,13 +1362,19 @@ class SignalReportViewSet(
.values("_priority_val")[:1],
output_field=CharField(),
)
- return queryset.annotate(
- priority_rank=Coalesce(latest_priority, Value("~"), output_field=CharField()),
+ return queryset.annotate(priority_rank=latest_priority).annotate(
+ priority_sort_rank=Case(
+ *(
+ When(priority_rank=priority, then=Value(index))
+ for index, priority in enumerate(AutonomyPriority.values)
+ ),
+ default=Value(len(AutonomyPriority.values)),
+ output_field=IntegerField(),
+ )
)
- def _annotate_latest_actionability_value(self, queryset):
- # Extract the "actionability" value from the latest actionability_judgment artefact.
- latest_actionability = Subquery(
+ def _latest_actionability_field(self, field: str):
+ return Subquery(
SignalReportArtefact.objects.filter(
report_id=OuterRef("id"),
type=SignalReportArtefact.ArtefactType.ACTIONABILITY_JUDGMENT,
@@ -1293,7 +1384,7 @@ class SignalReportViewSet(
.annotate(
_actionability_val=Func(
Cast(F("content"), output_field=JSONField()),
- Value("actionability"),
+ Value(field),
function="jsonb_extract_path_text",
output_field=CharField(),
),
@@ -1301,7 +1392,12 @@ class SignalReportViewSet(
.values("_actionability_val")[:1],
output_field=CharField(),
)
- return queryset.annotate(latest_actionability_value=latest_actionability)
+
+ def _annotate_latest_actionability(self, queryset):
+ return queryset.annotate(
+ latest_actionability_value=self._latest_actionability_field("actionability"),
+ latest_already_addressed_value=self._latest_actionability_field("already_addressed"),
+ )
def _prefetch_signal_report_priority_artefacts(self, queryset):
return queryset.prefetch_related(
@@ -1401,7 +1497,16 @@ class SignalReportViewSet(
return self._parse_ordering_string(self._DEFAULT_SIGNAL_REPORT_ORDERING)
def _parse_signal_report_ordering(self) -> list[str]:
- raw = self.request.query_params.get("ordering", self._DEFAULT_SIGNAL_REPORT_ORDERING)
+ raw = self.request.query_params.get("ordering")
+ if raw is None:
+ inbox_sort = self.request.query_params.get("sort")
+ if inbox_sort:
+ raw = self._INBOX_SORT_ORDERINGS.get(inbox_sort)
+ if raw is None:
+ allowed = ", ".join(sorted(self._INBOX_SORT_ORDERINGS))
+ raise serializers.ValidationError({"sort": f"Invalid value: {inbox_sort!r}. Allowed: {allowed}."})
+ else:
+ raw = self._DEFAULT_SIGNAL_REPORT_ORDERING
if not raw or not str(raw).strip():
return self._default_signal_report_ordering_clauses
clauses = self._parse_ordering_string(str(raw).strip())
@@ -1620,6 +1725,51 @@ class SignalReportViewSet(
"include any of the given users."
),
),
+ OpenApiParameter(
+ name="actionability",
+ type=OpenApiTypes.STR,
+ location=OpenApiParameter.QUERY,
+ required=False,
+ description=(
+ "Comma-separated actionability judgments to include. Valid values: immediately_actionable, "
+ "requires_human_input, not_actionable. Reports without a judgment are excluded."
+ ),
+ ),
+ OpenApiParameter(
+ name="already_addressed",
+ type=OpenApiTypes.BOOL,
+ location=OpenApiParameter.QUERY,
+ required=False,
+ description=(
+ "Filter by whether the latest actionability judgment says the issue is already being handled. "
+ "False also includes older reports where that judgment did not record a value."
+ ),
+ ),
+ OpenApiParameter(
+ name="view",
+ type=OpenApiTypes.STR,
+ location=OpenApiParameter.QUERY,
+ required=False,
+ description=(
+ "Apply an inbox view: actionable, needs_input, monitoring, resolved, dismissed, "
+ "not_actionable, or all. Each view applies the corresponding status, actionability, and "
+ "implementation-PR filters."
+ ),
+ ),
+ OpenApiParameter(
+ name="scope",
+ type=OpenApiTypes.STR,
+ location=OpenApiParameter.QUERY,
+ required=False,
+ description=("Reviewer scope: for_me, entire_project, or teammate. Pass teammate_uuid with teammate."),
+ ),
+ OpenApiParameter(
+ name="teammate_uuid",
+ type=OpenApiTypes.UUID,
+ location=OpenApiParameter.QUERY,
+ required=False,
+ description="PostHog user UUID used when scope=teammate.",
+ ),
OpenApiParameter(
name="priority",
type=OpenApiTypes.STR,
@@ -1630,6 +1780,25 @@ class SignalReportViewSet(
"Reports without a priority assignment are excluded when this filter is set."
),
),
+ OpenApiParameter(
+ name="use_priority_preference",
+ type=OpenApiTypes.BOOL,
+ location=OpenApiParameter.QUERY,
+ required=False,
+ description=(
+ "When true and priority is omitted, include priorities at or above the requesting user's "
+ "personal PR-generation threshold, falling back to the project threshold."
+ ),
+ ),
+ OpenApiParameter(
+ name="sort",
+ type=OpenApiTypes.STR,
+ location=OpenApiParameter.QUERY,
+ required=False,
+ description=(
+ "Inbox sort preset: priority, last_updated, newest, or oldest. Ignored when ordering is supplied."
+ ),
+ ),
OpenApiParameter(
name="ordering",
type=OpenApiTypes.STR,
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index 7804d6a2ae5f..db7330d42657 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -4245,6 +4245,14 @@ export type SignalsProcessingListParams = {
}
export type SignalsReportsListParams = {
+ /**
+ * Comma-separated actionability judgments to include. Valid values: immediately_actionable, requires_human_input, not_actionable. Reports without a judgment are excluded.
+ */
+ actionability?: string
+ /**
+ * Filter by whether the latest actionability judgment says the issue is already being handled. False also includes older reports where that judgment did not record a value.
+ */
+ already_addressed?: boolean
/**
* Narrow to reports assigned to one space (channel). Absent or empty means all reports regardless of assignment.
*/
@@ -4277,6 +4285,10 @@ export type SignalsReportsListParams = {
* Comma-separated list of priorities to include. Valid values: P0, P1, P2, P3, P4. Reports without a priority assignment are excluded when this filter is set.
*/
priority?: string
+ /**
+ * Reviewer scope: for_me, entire_project, or teammate. Pass teammate_uuid with teammate.
+ */
+ scope?: string
/**
* Comma-separated list of scout skill_name slugs (e.g. signals-scout-error-tracking). Reports are kept if at least one of their contributing signals was authored by one of these scouts. Combines with source_product as an AND.
*/
@@ -4289,6 +4301,10 @@ export type SignalsReportsListParams = {
* Case-insensitive substring match against report title and summary.
*/
search?: string
+ /**
+ * Inbox sort preset: priority, last_updated, newest, or oldest. Ignored when ordering is supplied.
+ */
+ sort?: string
/**
* Comma-separated list of source record ids. Reports are kept if at least one of their contributing signals came from one of these records — e.g. pass a support ticket's UUID to see what the inbox already found for that ticket. Requires exactly one source_product, since a source id is only unique within its product.
*/
@@ -4309,6 +4325,18 @@ export type SignalsReportsListParams = {
* Only reports associated with this task (via the report's task associations).
*/
task_id?: string
+ /**
+ * PostHog user UUID used when scope=teammate.
+ */
+ teammate_uuid?: string
+ /**
+ * When true and priority is omitted, include priorities at or above the requesting user's personal PR-generation threshold, falling back to the project threshold.
+ */
+ use_priority_preference?: boolean
+ /**
+ * Apply an inbox view: actionable, needs_input, monitoring, resolved, dismissed, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters.
+ */
+ view?: string
}
export type SignalsReportArtefactsListParams = {
diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yaml
index eca3fef419f2..81b225670aeb 100644
--- a/products/signals/mcp/tools.yaml
+++ b/products/signals/mcp/tools.yaml
@@ -863,6 +863,46 @@ tools:
Pass `keys_only=true` to scan which memories exist without pulling their (potentially large) bodies, or
`content_max_chars` to cap each `content` to a preview — both keep a wide orientation/dedupe scan from
returning every entry's full prose. Results capped at 1000.
+ self-driving-inbox-get:
+ operation: signals_reports_list
+ enabled: true
+ scopes:
+ - task:read
+ annotations:
+ readOnly: true
+ destructive: false
+ idempotent: true
+ input_schema: ReportInboxInputSchema
+ enrich_url: '{id}'
+ list: true
+ title: Get self-driving inbox
+ description: >
+ Get the top 10 prioritized, actionable self-driving reports for the current project, including their
+ summaries. By default this uses the requesting user's personal PR-generation threshold, falling back to the
+ project threshold. Choose another view for reports needing human input, implementation PRs being monitored,
+ resolved or dismissed reports, or reports judged not actionable. Filter by reviewer scope, priority, source
+ product, scout, or text search, and use offset to page through further results. Use
+ inbox-report-artefacts-list to read a report's evidence and work log before acting on it.
+ response:
+ include:
+ - id
+ - title
+ - summary
+ - status
+ - priority
+ - actionability
+ - already_addressed
+ - dismissal_reason
+ - dismissal_note
+ - signal_count
+ - total_weight
+ - source_products
+ - scout_name
+ - is_suggested_reviewer
+ - implementation_pr_url
+ - implementation_pr_merged
+ - created_at
+ - updated_at
signals-report-artefacts-diff:
operation: signals_report_artefacts_diff
enabled: false
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index f1f193bc1f39..418c2878b8c2 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -9553,6 +9553,20 @@
"readOnlyHint": true
}
},
+ "self-driving-inbox-get": {
+ "description": "Get the top 10 prioritized, actionable self-driving reports for the current project, including their summaries. By default this uses the requesting user's personal PR-generation threshold, falling back to the project threshold. Choose another view for reports needing human input, implementation PRs being monitored, resolved or dismissed reports, or reports judged not actionable. Filter by reviewer scope, priority, source product, scout, or text search, and use offset to page through further results. Use inbox-report-artefacts-list to read a report's evidence and work log before acting on it.",
+ "category": "Signals",
+ "feature": "signals",
+ "summary": "Get self-driving inbox",
+ "title": "Get self-driving inbox",
+ "required_scopes": ["task:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ }
+ },
"session-recording-bulk-delete": {
"description": "Delete a batch of session recordings by session ID, up to 100 per call. Deletion is permanent and cannot be undone — confirm with the user before deleting. Prefer this over `session-recording-delete` whenever more than one recording needs deleting: find the target IDs with `query-session-recordings-list`, then delete in batches. Pass `date_from` (e.g. '-30d') when the recordings' age is known — it makes the lookup much faster. IDs with no matching recording are skipped, so a `deleted_count` below `total_requested` is normal when some recordings were already deleted or never existed.",
"category": "Session replays",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 7ab4b0bc583a..7d82b790509e 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -10108,6 +10108,20 @@
"readOnlyHint": true
}
},
+ "self-driving-inbox-get": {
+ "description": "Get the top 10 prioritized, actionable self-driving reports for the current project, including their summaries. By default this uses the requesting user's personal PR-generation threshold, falling back to the project threshold. Choose another view for reports needing human input, implementation PRs being monitored, resolved or dismissed reports, or reports judged not actionable. Filter by reviewer scope, priority, source product, scout, or text search, and use offset to page through further results. Use inbox-report-artefacts-list to read a report's evidence and work log before acting on it.",
+ "category": "Signals",
+ "feature": "signals",
+ "summary": "Get self-driving inbox",
+ "title": "Get self-driving inbox",
+ "required_scopes": ["task:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ }
+ },
"session-recording-bulk-delete": {
"description": "Delete a batch of session recordings by session ID, up to 100 per call. Deletion is permanent and cannot be undone — confirm with the user before deleting. Prefer this over `session-recording-delete` whenever more than one recording needs deleting: find the target IDs with `query-session-recordings-list`, then delete in batches. Pass `date_from` (e.g. '-30d') when the recordings' age is known — it makes the lookup much faster. IDs with no matching recording are skipped, so a `deleted_count` below `total_requested` is normal when some recordings were already deleted or never existed.",
"category": "Session replays",
diff --git a/services/mcp/schema/tool-inputs.json b/services/mcp/schema/tool-inputs.json
index 7e6a693f306f..9f5c7f1ec3a6 100644
--- a/services/mcp/schema/tool-inputs.json
+++ b/services/mcp/schema/tool-inputs.json
@@ -1014,6 +1014,78 @@
},
"required": ["query"]
},
+ "ReportInboxInputSchema": {
+ "type": "object",
+ "properties": {
+ "view": {
+ "default": "actionable",
+ "description": "Inbox section to return. Defaults to actionable reports that are ready to pick up.",
+ "type": "string",
+ "enum": [
+ "actionable",
+ "needs_input",
+ "monitoring",
+ "resolved",
+ "dismissed",
+ "not_actionable",
+ "all"
+ ]
+ },
+ "scope": {
+ "default": "entire_project",
+ "description": "Limit results by suggested reviewer, or search the entire project.",
+ "type": "string",
+ "enum": ["for_me", "entire_project", "teammate"]
+ },
+ "teammate_uuid": {
+ "description": "PostHog user UUID required when scope is teammate.",
+ "type": "string",
+ "format": "uuid",
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
+ },
+ "priorities": {
+ "description": "Priorities to include. When omitted, uses the requesting user's personal PR-generation threshold, falling back to the project threshold.",
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["P0", "P1", "P2", "P3", "P4"]
+ }
+ },
+ "source_products": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "scouts": {
+ "description": "Scout skill_name slugs to include.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "search": {
+ "description": "Case-insensitive substring match against report title and summary.",
+ "type": "string"
+ },
+ "sort": {
+ "default": "priority",
+ "type": "string",
+ "enum": ["priority", "last_updated", "newest", "oldest"]
+ },
+ "limit": {
+ "default": 10,
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 10
+ },
+ "offset": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 9007199254740991
+ }
+ }
+ },
"SavedMetricsAttachSchema": {
"type": "array",
"items": {
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 4fa94a006ba9..198366fe3da1 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -98788,6 +98788,14 @@ export namespace Schemas {
};
export type SignalsReportsListParams = {
+ /**
+ * Comma-separated actionability judgments to include. Valid values: immediately_actionable, requires_human_input, not_actionable. Reports without a judgment are excluded.
+ */
+ actionability?: string;
+ /**
+ * Filter by whether the latest actionability judgment says the issue is already being handled. False also includes older reports where that judgment did not record a value.
+ */
+ already_addressed?: boolean;
/**
* Narrow to reports assigned to one space (channel). Absent or empty means all reports regardless of assignment.
*/
@@ -98820,6 +98828,10 @@ export namespace Schemas {
* Comma-separated list of priorities to include. Valid values: P0, P1, P2, P3, P4. Reports without a priority assignment are excluded when this filter is set.
*/
priority?: string;
+ /**
+ * Reviewer scope: for_me, entire_project, or teammate. Pass teammate_uuid with teammate.
+ */
+ scope?: string;
/**
* Comma-separated list of scout skill_name slugs (e.g. signals-scout-error-tracking). Reports are kept if at least one of their contributing signals was authored by one of these scouts. Combines with source_product as an AND.
*/
@@ -98832,6 +98844,10 @@ export namespace Schemas {
* Case-insensitive substring match against report title and summary.
*/
search?: string;
+ /**
+ * Inbox sort preset: priority, last_updated, newest, or oldest. Ignored when ordering is supplied.
+ */
+ sort?: string;
/**
* Comma-separated list of source record ids. Reports are kept if at least one of their contributing signals came from one of these records — e.g. pass a support ticket's UUID to see what the inbox already found for that ticket. Requires exactly one source_product, since a source id is only unique within its product.
*/
@@ -98852,6 +98868,18 @@ export namespace Schemas {
* Only reports associated with this task (via the report's task associations).
*/
task_id?: string;
+ /**
+ * PostHog user UUID used when scope=teammate.
+ */
+ teammate_uuid?: string;
+ /**
+ * When true and priority is omitted, include priorities at or above the requesting user's personal PR-generation threshold, falling back to the project threshold.
+ */
+ use_priority_preference?: boolean;
+ /**
+ * Apply an inbox view: actionable, needs_input, monitoring, resolved, dismissed, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters.
+ */
+ view?: string;
};
export type SignalsReportArtefactsListParams = {
diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.ts
index b9d0faac9025..649fcbf474ca 100644
--- a/services/mcp/src/generated/signals/api.ts
+++ b/services/mcp/src/generated/signals/api.ts
@@ -17,6 +17,18 @@ export const SignalsReportsListParams = () => zod.object({
})
export const SignalsReportsListQueryParams = () => zod.object({
+ actionability: zod
+ .string()
+ .optional()
+ .describe(
+ 'Comma-separated actionability judgments to include. Valid values: immediately_actionable, requires_human_input, not_actionable. Reports without a judgment are excluded.'
+ ),
+ already_addressed: zod
+ .boolean()
+ .optional()
+ .describe(
+ 'Filter by whether the latest actionability judgment says the issue is already being handled. False also includes older reports where that judgment did not record a value.'
+ ),
channel_id: zod
.string()
.optional()
@@ -55,6 +67,10 @@ export const SignalsReportsListQueryParams = () => zod.object({
.describe(
'Comma-separated list of priorities to include. Valid values: P0, P1, P2, P3, P4. Reports without a priority assignment are excluded when this filter is set.'
),
+ scope: zod
+ .string()
+ .optional()
+ .describe('Reviewer scope: for_me, entire_project, or teammate. Pass teammate_uuid with teammate.'),
scout: zod
.string()
.optional()
@@ -68,6 +84,10 @@ export const SignalsReportsListQueryParams = () => zod.object({
'Scout skill_name prefix (e.g. signals-scout-customer-analytics). Reports are kept if at least one of their contributing signals was authored by a scout whose skill_name starts with this prefix — new scouts in the family match without callers listing every name. Combines with the other filters as an AND.'
),
search: zod.string().optional().describe('Case-insensitive substring match against report title and summary.'),
+ sort: zod
+ .string()
+ .optional()
+ .describe('Inbox sort preset: priority, last_updated, newest, or oldest. Ignored when ordering is supplied.'),
source_id: zod
.string()
.optional()
@@ -96,6 +116,19 @@ export const SignalsReportsListQueryParams = () => zod.object({
.string()
.optional()
.describe("Only reports associated with this task (via the report's task associations)."),
+ teammate_uuid: zod.string().optional().describe('PostHog user UUID used when scope=teammate.'),
+ use_priority_preference: zod
+ .boolean()
+ .optional()
+ .describe(
+ "When true and priority is omitted, include priorities at or above the requesting user's personal PR-generation threshold, falling back to the project threshold."
+ ),
+ view: zod
+ .string()
+ .optional()
+ .describe(
+ 'Apply an inbox view: actionable, needs_input, monitoring, resolved, dismissed, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters.'
+ ),
})
export const SignalsReportsRetrieveParams = () => zod.object({
diff --git a/services/mcp/src/schema/tool-inputs.ts b/services/mcp/src/schema/tool-inputs.ts
index c3124e237437..edb724346fd5 100644
--- a/services/mcp/src/schema/tool-inputs.ts
+++ b/services/mcp/src/schema/tool-inputs.ts
@@ -178,6 +178,43 @@ export const PromptListInputSchema = z.object({
),
})
+export const ReportInboxInputSchema = z
+ .object({
+ view: z
+ .enum(['actionable', 'needs_input', 'monitoring', 'resolved', 'dismissed', 'not_actionable', 'all'])
+ .default('actionable')
+ .describe('Inbox section to return. Defaults to actionable reports that are ready to pick up.'),
+ scope: z
+ .enum(['for_me', 'entire_project', 'teammate'])
+ .default('entire_project')
+ .describe('Limit results by suggested reviewer, or search the entire project.'),
+ teammate_uuid: z.string().uuid().optional().describe('PostHog user UUID required when scope is teammate.'),
+ priorities: z
+ .array(z.enum(['P0', 'P1', 'P2', 'P3', 'P4']))
+ .optional()
+ .describe(
+ "Priorities to include. When omitted, uses the requesting user's personal PR-generation threshold, falling back to the project threshold."
+ ),
+ source_products: z.array(z.string()).optional(),
+ scouts: z.array(z.string()).optional().describe('Scout skill_name slugs to include.'),
+ search: z.string().optional().describe('Case-insensitive substring match against report title and summary.'),
+ sort: z.enum(['priority', 'last_updated', 'newest', 'oldest']).default('priority'),
+ limit: z.number().int().min(1).max(10).default(10),
+ offset: z.number().int().min(0).optional(),
+ })
+ .superRefine((data, context) => {
+ if (data.scope === 'teammate' && !data.teammate_uuid) {
+ context.addIssue({ code: 'custom', path: ['teammate_uuid'], message: 'Required when scope is teammate.' })
+ }
+ })
+ .transform(({ priorities, source_products, scouts, ...query }) => ({
+ ...query,
+ priority: priorities?.join(','),
+ use_priority_preference: priorities === undefined ? true : undefined,
+ source_product: source_products?.join(','),
+ scout: scouts?.join(','),
+ }))
+
export const FeedbackSubmitSchema = z
.object({
summary: z
diff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.ts
index 34e60da6bae7..2e73a8073d8f 100644
--- a/services/mcp/src/tools/generated/signals.ts
+++ b/services/mcp/src/tools/generated/signals.ts
@@ -3,6 +3,7 @@ import { z } from 'zod'
import type { Schemas } from '@/api/generated'
import * as orvalSchemas from '@/generated/signals/api'
+import { ReportInboxInputSchema } from '@/schema/tool-inputs'
import { normalizeParamAliases } from '@/tools/cast-helpers'
import { getConfirmedActionRuntime } from '@/tools/confirmed-action-registry'
import {
@@ -205,6 +206,8 @@ const inboxReportsList = (): ToolBase<
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/reports/`,
query: {
+ actionability: params.actionability,
+ already_addressed: params.already_addressed,
channel_id: params.channel_id,
count_only: params.count_only,
has_implementation_pr: params.has_implementation_pr,
@@ -213,14 +216,19 @@ const inboxReportsList = (): ToolBase<
offset: params.offset,
ordering: params.ordering,
priority: params.priority,
+ scope: params.scope,
scout: params.scout,
scout_prefix: params.scout_prefix,
search: params.search,
+ sort: params.sort,
source_id: params.source_id,
source_product: params.source_product,
status: params.status,
suggested_reviewers: params.suggested_reviewers,
task_id: params.task_id,
+ teammate_uuid: params.teammate_uuid,
+ use_priority_preference: params.use_priority_preference,
+ view: params.view,
},
})
const filtered = {
@@ -1326,6 +1334,60 @@ const scoutScratchpadSearch = (): ToolBase<
},
})
+const SelfDrivingInboxGetSchema = () => ReportInboxInputSchema
+
+const selfDrivingInboxGet = (): ToolBase<
+ ReturnType<typeof SelfDrivingInboxGetSchema>,
+ Schemas.PaginatedSignalReportList
+> => ({
+ name: 'self-driving-inbox-get',
+ schema: SelfDrivingInboxGetSchema(),
+ handler: async (context: Context, params: z.infer<ReturnType<typeof SelfDrivingInboxGetSchema>>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const parsedParams = SelfDrivingInboxGetSchema().parse(params)
+ const result = await context.api.request<Schemas.PaginatedSignalReportList>({
+ method: 'GET',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/reports/`,
+ query: parsedParams,
+ })
+ const filtered = {
+ ...result,
+ results: (result.results ?? []).map((item: any) =>
+ pickResponseFields(item, [
+ 'id',
+ 'title',
+ 'summary',
+ 'status',
+ 'priority',
+ 'actionability',
+ 'already_addressed',
+ 'dismissal_reason',
+ 'dismissal_note',
+ 'signal_count',
+ 'total_weight',
+ 'source_products',
+ 'scout_name',
+ 'is_suggested_reviewer',
+ 'implementation_pr_url',
+ 'implementation_pr_merged',
+ 'created_at',
+ 'updated_at',
+ ])
+ ),
+ } as typeof result
+ return await withPostHogUrl(
+ context,
+ {
+ ...filtered,
+ results: await Promise.all(
+ (filtered.results ?? []).map((item) => withPostHogUrl(context, item, `/inbox/${item.id}`))
+ ),
+ },
+ '/inbox'
+ )
+ },
+})
+
const SignalsScoutConfigCreateSchema = () => {
const SignalsScoutConfigCreateBody = orvalSchemas.SignalsScoutConfigCreateBody()
return SignalsScoutConfigCreateBody
@@ -1987,6 +2049,7 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'scout-scratchpad-forget': scoutScratchpadForget,
'scout-scratchpad-remember': scoutScratchpadRemember,
'scout-scratchpad-search': scoutScratchpadSearch,
+ 'self-driving-inbox-get': selfDrivingInboxGet,
'signals-scout-config-create': signalsScoutConfigCreate,
'signals-scout-config-delete': signalsScoutConfigDelete,
'signals-scout-config-list': signalsScoutConfigList,
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json
index d6ba9dfc75bf..fbf6e81d5191 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-reports-list.json
@@ -1,6 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
+ "actionability": {
+ "description": "Comma-separated actionability judgments to include. Valid values: immediately_actionable, requires_human_input, not_actionable. Reports without a judgment are excluded.",
+ "type": "string"
+ },
+ "already_addressed": {
+ "description": "Filter by whether the latest actionability judgment says the issue is already being handled. False also includes older reports where that judgment did not record a value.",
+ "type": "boolean"
+ },
"channel_id": {
"description": "Narrow to reports assigned to one space (channel). Absent or empty means all reports regardless of assignment.",
"type": "string"
@@ -33,6 +41,10 @@
"description": "Comma-separated list of priorities to include. Valid values: P0, P1, P2, P3, P4. Reports without a priority assignment are excluded when this filter is set.",
"type": "string"
},
+ "scope": {
+ "description": "Reviewer scope: for_me, entire_project, or teammate. Pass teammate_uuid with teammate.",
+ "type": "string"
+ },
"scout": {
"description": "Comma-separated list of scout skill_name slugs (e.g. signals-scout-error-tracking). Reports are kept if at least one of their contributing signals was authored by one of these scouts. Combines with source_product as an AND.",
"type": "string"
@@ -45,6 +57,10 @@
"description": "Case-insensitive substring match against report title and summary.",
"type": "string"
},
+ "sort": {
+ "description": "Inbox sort preset: priority, last_updated, newest, or oldest. Ignored when ordering is supplied.",
+ "type": "string"
+ },
"source_id": {
"description": "Comma-separated list of source record ids. Reports are kept if at least one of their contributing signals came from one of these records — e.g. pass a support ticket's UUID to see what the inbox already found for that ticket. Requires exactly one source_product, since a source id is only unique within its product.",
"type": "string"
@@ -64,6 +80,18 @@
"task_id": {
"description": "Only reports associated with this task (via the report's task associations).",
"type": "string"
+ },
+ "teammate_uuid": {
+ "description": "PostHog user UUID used when scope=teammate.",
+ "type": "string"
+ },
+ "use_priority_preference": {
+ "description": "When true and priority is omitted, include priorities at or above the requesting user's personal PR-generation threshold, falling back to the project threshold.",
+ "type": "boolean"
+ },
+ "view": {
+ "description": "Apply an inbox view: actionable, needs_input, monitoring, resolved, dismissed, not_actionable, or all. Each view applies the corresponding status, actionability, and implementation-PR filters.",
+ "type": "string"
}
},
"type": "object"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/self-driving-inbox-get.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/self-driving-inbox-get.json
new file mode 100644
index 000000000000..8df63e7d058e
--- /dev/null
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/self-driving-inbox-get.json
@@ -0,0 +1,65 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {
+ "limit": {
+ "default": 10,
+ "maximum": 10,
+ "minimum": 1,
+ "type": "integer"
+ },
+ "offset": {
+ "maximum": 9007199254740991,
+ "minimum": 0,
+ "type": "integer"
+ },
+ "priorities": {
+ "description": "Priorities to include. When omitted, uses the requesting user's personal PR-generation threshold, falling back to the project threshold.",
+ "items": {
+ "enum": ["P0", "P1", "P2", "P3", "P4"],
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "scope": {
+ "default": "entire_project",
+ "description": "Limit results by suggested reviewer, or search the entire project.",
+ "enum": ["for_me", "entire_project", "teammate"],
+ "type": "string"
+ },
+ "scouts": {
+ "description": "Scout skill_name slugs to include.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "search": {
+ "description": "Case-insensitive substring match against report title and summary.",
+ "type": "string"
+ },
+ "sort": {
+ "default": "priority",
+ "enum": ["priority", "last_updated", "newest", "oldest"],
+ "type": "string"
+ },
+ "source_products": {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ "teammate_uuid": {
+ "description": "PostHog user UUID required when scope is teammate.",
+ "format": "uuid",
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
+ "type": "string"
+ },
+ "view": {
+ "default": "actionable",
+ "description": "Inbox section to return. Defaults to actionable reports that are ready to pick up.",
+ "enum": ["actionable", "needs_input", "monitoring", "resolved", "dismissed", "not_actionable", "all"],
+ "type": "string"
+ }
+ },
+ "type": "object"
+}