: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(dashboards): discriminate widget batch-add openapi schema (4/4) (#61457)
Matt Puaa97b34650bc1
diff --git a/products/dashboards/backend/api/dashboard.py b/products/dashboards/backend/api/dashboard.pyindex 1c025e3a92c5..70b64b170df4 100644--- a/products/dashboards/backend/api/dashboard.py+++ b/products/dashboards/backend/api/dashboard.py@@ -84,7 +84,11 @@ from products.dashboards.backend.api.dashboard_ai import generate_refresh_analysfrom products.dashboards.backend.api.dashboard_template_json_schema_parser import (DashboardTemplateCreationJSONSchemaParser,)-from products.dashboards.backend.api.widget_openapi_serializers import DashboardWidgetConfigField+from products.dashboards.backend.api.widget_openapi_serializers import (+ WIDGET_BATCH_ADD_OPENAPI_HELP,+ AddDashboardWidgetRequestOpenApi,+ DashboardWidgetConfigField,+)from products.dashboards.backend.constants import DASHBOARD_GRID_COLUMN_COUNT, MAX_WIDGETS_BATCH_SIZEfrom products.dashboards.backend.feature_flags import dashboard_widgets_enabledfrom products.dashboards.backend.models.dashboard import Dashboard@@ -498,8 +502,8 @@ class MoveTileRequestSerializer(serializers.Serializer):class DashboardWidgetCoreRequestSerializer(serializers.Serializer):- widget_type = serializers.CharField(- max_length=64,+ widget_type = serializers.ChoiceField(+ choices=sorted(EXPECTED_WIDGET_TYPES),help_text=WIDGET_TYPE_API_HELP,)config = DashboardWidgetConfigField(@@ -543,8 +547,8 @@ class AddDashboardWidgetRequestSerializer(DashboardWidgetCoreRequestSerializer):class DashboardPatchWidgetSerializer(DashboardWidgetCoreRequestSerializer):- widget_type = serializers.CharField(- max_length=64,+ widget_type = serializers.ChoiceField(+ choices=sorted(EXPECTED_WIDGET_TYPES),required=False,help_text=WIDGET_TYPE_API_HELP,)@@ -565,6 +569,17 @@ class AddDashboardWidgetsBatchRequestSerializer(serializers.Serializer):)+class AddDashboardWidgetsBatchRequestOpenApiSerializer(serializers.Serializer):+ """OpenAPI-only batch-add schema with widget_type-discriminated config shapes for agents."""++ widgets = serializers.ListField(+ child=AddDashboardWidgetRequestOpenApi,+ min_length=1,+ max_length=MAX_WIDGETS_BATCH_SIZE,+ help_text=f"{WIDGET_BATCH_ADD_OPENAPI_HELP} (1–{MAX_WIDGETS_BATCH_SIZE} per request).",+ )++class WidgetCatalogEntrySerializer(serializers.Serializer):widget_type = serializers.CharField(help_text="Stable widget type identifier used in API requests.")group_id = serializers.CharField(help_text="Product area key for grouping related widget variants.")@@ -2746,7 +2761,7 @@ class DashboardsViewSet(return Response({"results": get_widget_catalog_entries()})@extend_schema(- request=AddDashboardWidgetsBatchRequestSerializer,+ request=AddDashboardWidgetsBatchRequestOpenApiSerializer,responses={201: AddDashboardWidgetsBatchResponseSerializer},)@action(methods=["POST"], detail=True, url_path="widgets/batch", required_scopes=["dashboard:write"])diff --git a/products/dashboards/backend/api/test/test_dashboard_widgets.py b/products/dashboards/backend/api/test/test_dashboard_widgets.pyindex 9f5bd51f4254..aa32cdd24058 100644--- a/products/dashboards/backend/api/test/test_dashboard_widgets.py+++ b/products/dashboards/backend/api/test/test_dashboard_widgets.py@@ -6,6 +6,7 @@ from unittest.mock import ANY, patchfrom django.test import override_settings+from drf_spectacular.generators import SchemaGeneratorfrom rest_framework import statusfrom posthog.api.test.dashboards import DashboardAPI@@ -19,6 +20,7 @@ from products.dashboards.backend.models.dashboard import Dashboardfrom products.dashboards.backend.models.dashboard_templates import DashboardTemplatefrom products.dashboards.backend.models.dashboard_tile import DashboardTilefrom products.dashboards.backend.models.dashboard_widget import DashboardWidget+from products.dashboards.backend.widget_registry import EXPECTED_WIDGET_TYPESclass TestDashboardWidgets(APIBaseTest):@@ -224,7 +226,7 @@ class TestDashboardWidgets(APIBaseTest):dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard"})_, dashboard_json = self.dashboard_api.create_widget_tile(dashboard_id, config={"limit": 10})tile = dashboard_json["tiles"][0]- tile["widget"]["widget_type"] = "not_a_real_widget_type"+ tile["widget"]["widget_type"] = "session_replay_list"response = self.client.patch(f"/api/projects/{self.team.id}/dashboards/{dashboard_id}",@@ -874,3 +876,34 @@ class TestDashboardWidgets(APIBaseTest):assert set(shared_widget.keys()) == {"id", "widget_type", "name", "description", "config"}assert shared_widget["widget_type"] == "error_tracking_list"assert shared_widget["config"]["limit"] == 10+++class TestDashboardWidgetOpenApiSchema(APIBaseTest):+ def setUp(self) -> None:+ super().setUp()+ self.dashboard_api = DashboardAPI(self.client, self.team, self.assertEqual)+ self._widgets_flag_patchers = [+ patch(target, return_value=True) for target in TestDashboardWidgets._WIDGETS_FLAG_PATCH_TARGETS+ ]+ for patcher in self._widgets_flag_patchers:+ patcher.start()++ def tearDown(self) -> None:+ for patcher in self._widgets_flag_patchers:+ patcher.stop()+ super().tearDown()++ def test_add_dashboard_widget_openapi_schema_uses_widget_type_discriminator(self) -> None:+ schema = SchemaGenerator().get_schema(request=None, public=True)+ component = schema["components"]["schemas"]["AddDashboardWidgetRequest"]++ assert component["discriminator"]["propertyName"] == "widget_type"+ assert set(component["discriminator"]["mapping"].keys()) == set(EXPECTED_WIDGET_TYPES)++ def test_batch_add_rejects_unknown_widget_type(self) -> None:+ dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "dash"})+ response = self.client.post(+ f"/api/projects/{self.team.id}/dashboards/{dashboard_id}/widgets/batch/",+ {"widgets": [{"widget_type": "not_a_real_widget", "config": {"limit": 5}}]},+ )+ assert response.status_code == status.HTTP_400_BAD_REQUESTdiff --git a/products/dashboards/backend/api/widget_openapi_serializers.py b/products/dashboards/backend/api/widget_openapi_serializers.pyindex 3bd8440e0e83..da4ef02c3232 100644--- a/products/dashboards/backend/api/widget_openapi_serializers.py+++ b/products/dashboards/backend/api/widget_openapi_serializers.py@@ -8,6 +8,11 @@ from products.dashboards.backend.constants import (MAX_WIDGET_RESULT_LIMIT,WIDGET_DATE_FROM_VALUES,)+from products.dashboards.backend.widget_registry import (+ ERROR_TRACKING_LIST_WIDGET_TYPE,+ EXPECTED_WIDGET_TYPES,+ SESSION_REPLAY_LIST_WIDGET_TYPE,+)from products.dashboards.backend.widgets.error_tracking_list import ERROR_TRACKING_ORDER_BYfrom products.dashboards.backend.widgets.session_replay_list import SESSION_REPLAY_ORDER_BY@@ -20,6 +25,12 @@ _ERROR_TRACKING_WIDGET_STATUS_CHOICES = ["all",]+WIDGET_BATCH_ADD_OPENAPI_HELP = (+ "Widget tiles to add atomically. Supported widget_type values: "+ + ", ".join(sorted(EXPECTED_WIDGET_TYPES))+ + ". Use dashboard-widget-catalog-list for config_schema_hints per type."+)+class WidgetDateRangeSerializer(serializers.Serializer):date_from = serializers.ChoiceField(@@ -117,3 +128,77 @@ class DashboardWidgetConfigField(serializers.JSONField):"""pass+++class _WidgetTileLayoutBoxOpenApiSerializer(serializers.Serializer):+ x = serializers.IntegerField(+ required=False,+ help_text="Column position in the dashboard grid (0-indexed).",+ )+ y = serializers.IntegerField(+ required=False,+ help_text="Row position in the dashboard grid (0-indexed).",+ )+ w = serializers.IntegerField(+ required=False,+ help_text="Width in grid columns. The desktop grid is 12 columns wide.",+ )+ h = serializers.IntegerField(required=False, help_text="Height in grid rows.")+++class _WidgetTileLayoutsOpenApiSerializer(serializers.Serializer):+ sm = _WidgetTileLayoutBoxOpenApiSerializer(+ required=False,+ help_text="Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.",+ )+ xs = _WidgetTileLayoutBoxOpenApiSerializer(+ required=False,+ help_text="Layout for the small (mobile) breakpoint. The grid is 1 column wide.",+ )+++class _AddDashboardWidgetTileFieldsOpenApiSerializer(serializers.Serializer):+ name = serializers.CharField(+ max_length=400,+ required=False,+ allow_null=True,+ allow_blank=True,+ help_text="Optional custom display name for the widget tile.",+ )+ description = serializers.CharField(+ required=False,+ allow_blank=True,+ help_text="Optional markdown description shown when show_description is enabled.",+ )+ layouts = _WidgetTileLayoutsOpenApiSerializer(+ required=False,+ help_text="Optional react-grid-layout positions keyed by breakpoint (sm, xs).",+ )+ show_description = serializers.BooleanField(+ required=False,+ help_text="Whether to show the description on the dashboard tile.",+ )+++class ErrorTrackingListWidgetAddRequestOpenApiSerializer(_AddDashboardWidgetTileFieldsOpenApiSerializer):+ widget_type = serializers.ChoiceField(choices=[ERROR_TRACKING_LIST_WIDGET_TYPE])+ config = ErrorTrackingListWidgetConfigSerializer(+ help_text="Configuration for the error tracking list widget.",+ )+++class SessionReplayListWidgetAddRequestOpenApiSerializer(_AddDashboardWidgetTileFieldsOpenApiSerializer):+ widget_type = serializers.ChoiceField(choices=[SESSION_REPLAY_LIST_WIDGET_TYPE])+ config = SessionReplayListWidgetConfigSerializer(+ help_text="Configuration for the session replay list widget.",+ )+++AddDashboardWidgetRequestOpenApi = PolymorphicProxySerializer(+ component_name="AddDashboardWidgetRequest",+ serializers={+ ERROR_TRACKING_LIST_WIDGET_TYPE: ErrorTrackingListWidgetAddRequestOpenApiSerializer,+ SESSION_REPLAY_LIST_WIDGET_TYPE: SessionReplayListWidgetAddRequestOpenApiSerializer,+ },+ resource_type_field_name="widget_type",+)diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.tsindex e063453757a6..38e6db070f35 100644--- a/products/dashboards/frontend/generated/api.schemas.ts+++ b/products/dashboards/frontend/generated/api.schemas.ts@@ -7757,14 +7757,57 @@ export interface UpdateTextTileRequestApi {color?: string | null}-export interface AddDashboardWidgetRequestApi {+export interface _WidgetTileLayoutBoxOpenApiApi {+ /** Column position in the dashboard grid (0-indexed). */+ x?: number+ /** Row position in the dashboard grid (0-indexed). */+ y?: number+ /** Width in grid columns. The desktop grid is 12 columns wide. */+ w?: number+ /** Height in grid rows. */+ h?: number+}++export interface _WidgetTileLayoutsOpenApiApi {+ /** Layout for the standard (desktop) breakpoint. The grid is 12 columns wide. */+ sm?: _WidgetTileLayoutBoxOpenApiApi+ /** Layout for the small (mobile) breakpoint. The grid is 1 column wide. */+ xs?: _WidgetTileLayoutBoxOpenApiApi+}++export type ErrorTrackingListWidgetAddRequestOpenApiApiWidgetType =+ (typeof ErrorTrackingListWidgetAddRequestOpenApiApiWidgetType)[keyof typeof ErrorTrackingListWidgetAddRequestOpenApiApiWidgetType]++export const ErrorTrackingListWidgetAddRequestOpenApiApiWidgetType = {+ ErrorTrackingList: 'error_tracking_list',+} as const++export interface ErrorTrackingListWidgetAddRequestOpenApiApi {/**- * Widget type identifier. Supported values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type.- * @maxLength 64+ * Optional custom display name for the widget tile.+ * @maxLength 400+ * @nullable*/- widget_type: string- /** Widget-specific configuration. Shape depends on widget_type; see dashboard-widget-catalog-list for config_schema_hints. Supported types: error_tracking_list, session_replay_list. */- config: DashboardWidgetConfigApi+ name?: string | null+ /** Optional markdown description shown when show_description is enabled. */+ description?: string+ /** Optional react-grid-layout positions keyed by breakpoint (sm, xs). */+ layouts?: _WidgetTileLayoutsOpenApiApi+ /** Whether to show the description on the dashboard tile. */+ show_description?: boolean+ widget_type: ErrorTrackingListWidgetAddRequestOpenApiApiWidgetType+ /** Configuration for the error tracking list widget. */+ config: ErrorTrackingListWidgetConfigApi+}++export type SessionReplayListWidgetAddRequestOpenApiApiWidgetType =+ (typeof SessionReplayListWidgetAddRequestOpenApiApiWidgetType)[keyof typeof SessionReplayListWidgetAddRequestOpenApiApiWidgetType]++export const SessionReplayListWidgetAddRequestOpenApiApiWidgetType = {+ SessionReplayList: 'session_replay_list',+} as const++export interface SessionReplayListWidgetAddRequestOpenApiApi {/*** Optional custom display name for the widget tile.* @maxLength 400@@ -7774,14 +7817,24 @@ export interface AddDashboardWidgetRequestApi {/** Optional markdown description shown when show_description is enabled. */description?: string/** Optional react-grid-layout positions keyed by breakpoint (sm, xs). */- layouts?: TileLayoutsApi+ layouts?: _WidgetTileLayoutsOpenApiApi/** Whether to show the description on the dashboard tile. */show_description?: boolean+ widget_type: SessionReplayListWidgetAddRequestOpenApiApiWidgetType+ /** Configuration for the session replay list widget. */+ config: SessionReplayListWidgetConfigApi}-export interface AddDashboardWidgetsBatchRequestApi {+export type AddDashboardWidgetRequestApi =+ | ErrorTrackingListWidgetAddRequestOpenApiApi+ | SessionReplayListWidgetAddRequestOpenApiApi++/**+ * OpenAPI-only batch-add schema with widget_type-discriminated config shapes for agents.+ */+export interface AddDashboardWidgetsBatchRequestOpenApiApi {/**- * Widget tiles to add atomically (1–10). Use a single-element list to add one widget.+ * Widget tiles to add atomically. Supported widget_type values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type. (1–10 per request).* @minItems 1* @maxItems 10*/@@ -7893,6 +7946,26 @@ export interface PatchedDataColorThemeApi {readonly created_by?: UserBasicApi}+/**+ * * `error_tracking_list` - error_tracking_list+ */+export type ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnumApi =+ (typeof ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnumApi)[keyof typeof ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnumApi]++export const ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnumApi = {+ ErrorTrackingList: 'error_tracking_list',+} as const++/**+ * * `session_replay_list` - session_replay_list+ */+export type SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnumApi =+ (typeof SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnumApi)[keyof typeof SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnumApi]++export const SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnumApi = {+ SessionReplayList: 'session_replay_list',+} as const+export type DashboardTemplatesListParams = {/*** Omit for all templates. When set, filter by featured flag; parsed with str_to_bool (same as other API query booleans).diff --git a/products/dashboards/frontend/generated/api.ts b/products/dashboards/frontend/generated/api.tsindex bbe73c8d5137..4b2503080dd1 100644--- a/products/dashboards/frontend/generated/api.ts+++ b/products/dashboards/frontend/generated/api.ts@@ -9,7 +9,7 @@ import { apiMutator } from '../../../../frontend/src/lib/api-orval-mutator'* OpenAPI spec version: 1.0.0*/import type {- AddDashboardWidgetsBatchRequestApi,+ AddDashboardWidgetsBatchRequestOpenApiApi,AddDashboardWidgetsBatchResponseApi,BulkUpdateTagsRequestApi,BulkUpdateTagsResponseApi,@@ -921,7 +921,7 @@ export const getDashboardsWidgetsBatchCreateUrl = (export const dashboardsWidgetsBatchCreate = async (projectId: string,id: number,- addDashboardWidgetsBatchRequestApi: AddDashboardWidgetsBatchRequestApi,+ addDashboardWidgetsBatchRequestOpenApiApi: AddDashboardWidgetsBatchRequestOpenApiApi,params?: DashboardsWidgetsBatchCreateParams,options?: RequestInit): Promise<AddDashboardWidgetsBatchResponseApi> => {@@ -929,7 +929,7 @@ export const dashboardsWidgetsBatchCreate = async (...options,method: 'POST',headers: { 'Content-Type': 'application/json', ...options?.headers },- body: JSON.stringify(addDashboardWidgetsBatchRequestApi),+ body: JSON.stringify(addDashboardWidgetsBatchRequestOpenApiApi),})}diff --git a/products/dashboards/frontend/generated/api.zod.ts b/products/dashboards/frontend/generated/api.zod.tsindex 8e5ab68df0dc..a3c7c45076d2 100644--- a/products/dashboards/frontend/generated/api.zod.ts+++ b/products/dashboards/frontend/generated/api.zod.ts@@ -482,203 +482,273 @@ export const DashboardsUpdateTextTileCreateBody = /* @__PURE__ */ zod.object({/*** Add multiple widget tiles to a dashboard in one atomic request.*/-export const dashboardsWidgetsBatchCreateBodyWidgetsItemWidgetTypeMax = 64+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneNameMax = 400-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitDefault = 10-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitMax = 25+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitDefault = 10+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitMax = 25-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderByDefault = `occurrences`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderDirectionDefault = `DESC`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneStatusDefault = `active`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitDefault = 10-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitMax = 25+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderByDefault = `occurrences`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderDirectionDefault = `DESC`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneStatusDefault = `active`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoNameMax = 400-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderByDefault = `start_time`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderDirectionDefault = `DESC`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemNameMax = 400+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitDefault = 10+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitMax = 25+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderByDefault = `start_time`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderDirectionDefault = `DESC`export const dashboardsWidgetsBatchCreateBodyWidgetsMax = 10-export const DashboardsWidgetsBatchCreateBody = /* @__PURE__ */ zod.object({- widgets: zod- .array(- zod.object({- widget_type: zod- .string()- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemWidgetTypeMax)- .describe(- 'Widget type identifier. Supported values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type.'- ),- config: zod- .union([- zod.object({- limit: zod- .number()- .min(1)- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitMax)- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitDefault)- .describe('Maximum number of issues to return.'),- orderBy: zod- .enum(['last_seen', 'first_seen', 'occurrences', 'users', 'sessions'])- .describe(- '\* `last_seen` - last_seen\n\* `first_seen` - first_seen\n\* `occurrences` - occurrences\n\* `users` - users\n\* `sessions` - sessions'- )- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderByDefault)- .describe(- 'Issue ranking column.\n\n\* `first_seen` - first_seen\n\* `last_seen` - last_seen\n\* `occurrences` - occurrences\n\* `sessions` - sessions\n\* `users` - users'- ),- orderDirection: zod- .enum(['ASC', 'DESC'])- .describe('\* `ASC` - ASC\n\* `DESC` - DESC')- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderDirectionDefault)- .describe('Sort direction for orderBy.\n\n\* `ASC` - ASC\n\* `DESC` - DESC'),- status: zod- .enum(['archived', 'active', 'resolved', 'pending_release', 'suppressed', 'all'])- .describe(- '\* `archived` - archived\n\* `active` - active\n\* `resolved` - resolved\n\* `pending_release` - pending_release\n\* `suppressed` - suppressed\n\* `all` - all'- )- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneStatusDefault)- .describe(- 'Issue status filter.\n\n\* `archived` - archived\n\* `active` - active\n\* `resolved` - resolved\n\* `pending_release` - pending_release\n\* `suppressed` - suppressed\n\* `all` - all'- ),- dateRange: zod- .union([- zod.object({- date_from: zod- .union([- zod- .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])- .describe(- '\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d'- ),- zod.null(),- ])+export const DashboardsWidgetsBatchCreateBody = /* @__PURE__ */ zod+ .object({+ widgets: zod+ .array(+ zod.union([+ zod.object({+ name: zod+ .string()+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemOneNameMax)+ .nullish()+ .describe('Optional custom display name for the widget tile.'),+ description: zod+ .string()+ .optional()+ .describe('Optional markdown description shown when show_description is enabled.'),+ layouts: zod+ .object({+ sm: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number()+ .optional()+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number()+ .optional()+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ })+ .optional()+ .describe(+ 'Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.'+ ),+ xs: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number().optional()- .describe(- "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d"- ),- }),- zod.null(),- ])- .optional()- .describe('Optional relative date range override.'),- filterTestAccounts: zod- .boolean()- .optional()- .describe('When omitted, follows the project default for filtering test accounts.'),- }),- zod.object({- limit: zod- .number()- .min(1)- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitMax)- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitDefault)- .describe('Maximum number of recordings to return.'),- orderBy: zod- .enum([- 'activity_score',- 'click_count',- 'console_error_count',- 'duration',- 'recording_duration',- 'start_time',- ])- .describe(- '\* `activity_score` - activity_score\n\* `click_count` - click_count\n\* `console_error_count` - console_error_count\n\* `duration` - duration\n\* `recording_duration` - recording_duration\n\* `start_time` - start_time'- )- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderByDefault)- .describe(- 'Recording ranking column.\n\n\* `activity_score` - activity_score\n\* `click_count` - click_count\n\* `console_error_count` - console_error_count\n\* `duration` - duration\n\* `recording_duration` - recording_duration\n\* `start_time` - start_time'- ),- orderDirection: zod- .enum(['ASC', 'DESC'])- .describe('\* `ASC` - ASC\n\* `DESC` - DESC')- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderDirectionDefault)- .describe('Sort direction for orderBy.\n\n\* `ASC` - ASC\n\* `DESC` - DESC'),- dateRange: zod- .union([- zod.object({- date_from: zod- .union([- zod- .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])- .describe(- '\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d'- ),- zod.null(),- ])+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number().optional()- .describe(- "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d"- ),- }),- zod.null(),- ])- .optional()- .describe('Optional relative date range override.'),- filterTestAccounts: zod- .boolean()- .optional()- .describe('When omitted, follows the project default for filtering test accounts.'),- }),- ])- .describe(- 'Widget-specific configuration. Shape depends on widget_type; see dashboard-widget-catalog-list for config_schema_hints. Supported types: error_tracking_list, session_replay_list.'- ),- name: zod- .string()- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemNameMax)- .nullish()- .describe('Optional custom display name for the widget tile.'),- description: zod- .string()- .optional()- .describe('Optional markdown description shown when show_description is enabled.'),- layouts: zod- .object({- sm: zod+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ })+ .optional()+ .describe('Layout for the small (mobile) breakpoint. The grid is 1 column wide.'),+ })+ .optional()+ .describe('Optional react-grid-layout positions keyed by breakpoint (sm, xs).'),+ show_description: zod+ .boolean()+ .optional()+ .describe('Whether to show the description on the dashboard tile.'),+ widget_type: zod.enum(['error_tracking_list']),+ config: zod.object({- x: zod+ limit: zod.number()+ .min(1)+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitMax)+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitDefault)+ .describe('Maximum number of issues to return.'),+ orderBy: zod+ .enum(['last_seen', 'first_seen', 'occurrences', 'users', 'sessions'])+ .describe(+ '\* `last_seen` - last_seen\n\* `first_seen` - first_seen\n\* `occurrences` - occurrences\n\* `users` - users\n\* `sessions` - sessions'+ )+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderByDefault)+ .describe(+ 'Issue ranking column.\n\n\* `first_seen` - first_seen\n\* `last_seen` - last_seen\n\* `occurrences` - occurrences\n\* `sessions` - sessions\n\* `users` - users'+ ),+ orderDirection: zod+ .enum(['ASC', 'DESC'])+ .describe('\* `ASC` - ASC\n\* `DESC` - DESC')+ .default(+ dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderDirectionDefault+ )+ .describe('Sort direction for orderBy.\n\n\* `ASC` - ASC\n\* `DESC` - DESC'),+ status: zod+ .enum(['archived', 'active', 'resolved', 'pending_release', 'suppressed', 'all'])+ .describe(+ '\* `archived` - archived\n\* `active` - active\n\* `resolved` - resolved\n\* `pending_release` - pending_release\n\* `suppressed` - suppressed\n\* `all` - all'+ )+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneStatusDefault)+ .describe(+ 'Issue status filter.\n\n\* `archived` - archived\n\* `active` - active\n\* `resolved` - resolved\n\* `pending_release` - pending_release\n\* `suppressed` - suppressed\n\* `all` - all'+ ),+ dateRange: zod+ .union([+ zod.object({+ date_from: zod+ .union([+ zod+ .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])+ .describe(+ '\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d"+ ),+ }),+ zod.null(),+ ]).optional()- .describe('Column position in the dashboard grid (0-indexed).'),- y: zod.number().optional().describe('Row position in the dashboard grid (0-indexed).'),- w: zod- .number()+ .describe('Optional relative date range override.'),+ filterTestAccounts: zod+ .boolean().optional()- .describe('Width in grid columns. The desktop grid is 12 columns wide.'),- h: zod.number().optional().describe('Height in grid rows.'),+ .describe('When omitted, follows the project default for filtering test accounts.'),})+ .describe('Configuration for the error tracking list widget.'),+ }),+ zod.object({+ name: zod+ .string()+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoNameMax)+ .nullish()+ .describe('Optional custom display name for the widget tile.'),+ description: zod+ .string().optional()- .describe('Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.'),- xs: zod+ .describe('Optional markdown description shown when show_description is enabled.'),+ layouts: zod.object({- x: zod- .number()+ sm: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number()+ .optional()+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number()+ .optional()+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ }).optional()- .describe('Column position in the dashboard grid (0-indexed).'),- y: zod.number().optional().describe('Row position in the dashboard grid (0-indexed).'),- w: zod- .number()+ .describe(+ 'Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.'+ ),+ xs: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number()+ .optional()+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number()+ .optional()+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ }).optional()- .describe('Width in grid columns. The desktop grid is 12 columns wide.'),- h: zod.number().optional().describe('Height in grid rows.'),+ .describe('Layout for the small (mobile) breakpoint. The grid is 1 column wide.'),}).optional()- .describe('Layout for the small (mobile) breakpoint. The grid is 1 column wide.'),- })- .optional()- .describe('Optional react-grid-layout positions keyed by breakpoint (sm, xs).'),- show_description: zod- .boolean()- .optional()- .describe('Whether to show the description on the dashboard tile.'),- })- )- .min(1)- .max(dashboardsWidgetsBatchCreateBodyWidgetsMax)- .describe('Widget tiles to add atomically (1–10). Use a single-element list to add one widget.'),-})+ .describe('Optional react-grid-layout positions keyed by breakpoint (sm, xs).'),+ show_description: zod+ .boolean()+ .optional()+ .describe('Whether to show the description on the dashboard tile.'),+ widget_type: zod.enum(['session_replay_list']),+ config: zod+ .object({+ limit: zod+ .number()+ .min(1)+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitMax)+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitDefault)+ .describe('Maximum number of recordings to return.'),+ orderBy: zod+ .enum([+ 'activity_score',+ 'click_count',+ 'console_error_count',+ 'duration',+ 'recording_duration',+ 'start_time',+ ])+ .describe(+ '\* `activity_score` - activity_score\n\* `click_count` - click_count\n\* `console_error_count` - console_error_count\n\* `duration` - duration\n\* `recording_duration` - recording_duration\n\* `start_time` - start_time'+ )+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderByDefault)+ .describe(+ 'Recording ranking column.\n\n\* `activity_score` - activity_score\n\* `click_count` - click_count\n\* `console_error_count` - console_error_count\n\* `duration` - duration\n\* `recording_duration` - recording_duration\n\* `start_time` - start_time'+ ),+ orderDirection: zod+ .enum(['ASC', 'DESC'])+ .describe('\* `ASC` - ASC\n\* `DESC` - DESC')+ .default(+ dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderDirectionDefault+ )+ .describe('Sort direction for orderBy.\n\n\* `ASC` - ASC\n\* `DESC` - DESC'),+ dateRange: zod+ .union([+ zod.object({+ date_from: zod+ .union([+ zod+ .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])+ .describe(+ '\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n\* `-14d` - -14d\n\* `-1h` - -1h\n\* `-24h` - -24h\n\* `-30d` - -30d\n\* `-3h` - -3h\n\* `-7d` - -7d\n\* `-90d` - -90d"+ ),+ }),+ zod.null(),+ ])+ .optional()+ .describe('Optional relative date range override.'),+ filterTestAccounts: zod+ .boolean()+ .optional()+ .describe('When omitted, follows the project default for filtering test accounts.'),+ })+ .describe('Configuration for the session replay list widget.'),+ }),+ ])+ )+ .min(1)+ .max(dashboardsWidgetsBatchCreateBodyWidgetsMax)+ .describe(+ 'Widget tiles to add atomically. Supported widget_type values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type. (1–10 per request).'+ ),+ })+ .describe('OpenAPI-only batch-add schema with widget_type-discriminated config shapes for agents.')/*** Bulk update tags on multiple objects.diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 0d6abfa62a35..0e6ae2c98469 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -3770,6 +3770,31 @@ export namespace Schemas {version?: number | null;}+ export interface _WidgetTileLayoutBoxOpenApi {+ /** Column position in the dashboard grid (0-indexed). */+ x?: number;+ /** Row position in the dashboard grid (0-indexed). */+ y?: number;+ /** Width in grid columns. The desktop grid is 12 columns wide. */+ w?: number;+ /** Height in grid rows. */+ h?: number;+ }++ export interface _WidgetTileLayoutsOpenApi {+ /** Layout for the standard (desktop) breakpoint. The grid is 12 columns wide. */+ sm?: _WidgetTileLayoutBoxOpenApi;+ /** Layout for the small (mobile) breakpoint. The grid is 1 column wide. */+ xs?: _WidgetTileLayoutBoxOpenApi;+ }++ export type ErrorTrackingListWidgetAddRequestOpenApiWidgetType = typeof ErrorTrackingListWidgetAddRequestOpenApiWidgetType[keyof typeof ErrorTrackingListWidgetAddRequestOpenApiWidgetType];+++ export const ErrorTrackingListWidgetAddRequestOpenApiWidgetType = {+ ErrorTrackingList: 'error_tracking_list',+ } as const;+/*** * `last_seen` - last_seen* `first_seen` - first_seen@@ -3890,6 +3915,31 @@ export namespace Schemas {filterTestAccounts?: boolean;}+ export interface ErrorTrackingListWidgetAddRequestOpenApi {+ /**+ * Optional custom display name for the widget tile.+ * @maxLength 400+ * @nullable+ */+ name?: string | null;+ /** Optional markdown description shown when show_description is enabled. */+ description?: string;+ /** Optional react-grid-layout positions keyed by breakpoint (sm, xs). */+ layouts?: _WidgetTileLayoutsOpenApi;+ /** Whether to show the description on the dashboard tile. */+ show_description?: boolean;+ widget_type: ErrorTrackingListWidgetAddRequestOpenApiWidgetType;+ /** Configuration for the error tracking list widget. */+ config: ErrorTrackingListWidgetConfig;+ }++ export type SessionReplayListWidgetAddRequestOpenApiWidgetType = typeof SessionReplayListWidgetAddRequestOpenApiWidgetType[keyof typeof SessionReplayListWidgetAddRequestOpenApiWidgetType];+++ export const SessionReplayListWidgetAddRequestOpenApiWidgetType = {+ SessionReplayList: 'session_replay_list',+ } as const;+/*** * `activity_score` - activity_score* `click_count` - click_count@@ -3937,34 +3987,7 @@ export namespace Schemas {filterTestAccounts?: boolean;}- export type DashboardWidgetConfig = ErrorTrackingListWidgetConfig | SessionReplayListWidgetConfig;-- export interface TileLayoutBox {- /** Column position in the dashboard grid (0-indexed). */- x?: number;- /** Row position in the dashboard grid (0-indexed). */- y?: number;- /** Width in grid columns. The desktop grid is 12 columns wide. */- w?: number;- /** Height in grid rows. */- h?: number;- }-- export interface TileLayouts {- /** Layout for the standard (desktop) breakpoint. The grid is 12 columns wide. */- sm?: TileLayoutBox;- /** Layout for the small (mobile) breakpoint. The grid is 1 column wide. */- xs?: TileLayoutBox;- }-- export interface AddDashboardWidgetRequest {- /**- * Widget type identifier. Supported values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type.- * @maxLength 64- */- widget_type: string;- /** Widget-specific configuration. Shape depends on widget_type; see dashboard-widget-catalog-list for config_schema_hints. Supported types: error_tracking_list, session_replay_list. */- config: DashboardWidgetConfig;+ export interface SessionReplayListWidgetAddRequestOpenApi {/*** Optional custom display name for the widget tile.* @maxLength 400@@ -3974,14 +3997,22 @@ export namespace Schemas {/** Optional markdown description shown when show_description is enabled. */description?: string;/** Optional react-grid-layout positions keyed by breakpoint (sm, xs). */- layouts?: TileLayouts;+ layouts?: _WidgetTileLayoutsOpenApi;/** Whether to show the description on the dashboard tile. */show_description?: boolean;+ widget_type: SessionReplayListWidgetAddRequestOpenApiWidgetType;+ /** Configuration for the session replay list widget. */+ config: SessionReplayListWidgetConfig;}- export interface AddDashboardWidgetsBatchRequest {+ export type AddDashboardWidgetRequest = ErrorTrackingListWidgetAddRequestOpenApi | SessionReplayListWidgetAddRequestOpenApi;++ /**+ * OpenAPI-only batch-add schema with widget_type-discriminated config shapes for agents.+ */+ export interface AddDashboardWidgetsBatchRequestOpenApi {/**- * Widget tiles to add atomically (1–10). Use a single-element list to add one widget.+ * Widget tiles to add atomically. Supported widget_type values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type. (1–10 per request).* @minItems 1* @maxItems 10*/@@ -6860,6 +6891,8 @@ export namespace Schemas {team: number;}+ export type DashboardWidgetConfig = ErrorTrackingListWidgetConfig | SessionReplayListWidgetConfig;+export interface DashboardWidget {readonly id: string;readonly created_by: UserBasic;@@ -11805,6 +11838,24 @@ export namespace Schemas {text: string;}+ export interface TileLayoutBox {+ /** Column position in the dashboard grid (0-indexed). */+ x?: number;+ /** Row position in the dashboard grid (0-indexed). */+ y?: number;+ /** Width in grid columns. The desktop grid is 12 columns wide. */+ w?: number;+ /** Height in grid rows. */+ h?: number;+ }++ export interface TileLayouts {+ /** Layout for the standard (desktop) breakpoint. The grid is 12 columns wide. */+ sm?: TileLayoutBox;+ /** Layout for the small (mobile) breakpoint. The grid is 1 column wide. */+ xs?: TileLayoutBox;+ }+export interface CreateTextTileRequest {/*** Markdown body for the text tile. Supports headings, lists, and inline formatting. Useful as a dashboard section heading, divider, or annotation between insights. Max 4000 characters.@@ -15193,6 +15244,16 @@ export namespace Schemas {nextOffset?: number;}+ /**+ * * `error_tracking_list` - error_tracking_list+ */+ export type ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnum = typeof ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnum[keyof typeof ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnum];+++ export const ErrorTrackingListWidgetAddRequestOpenApiWidgetTypeEnum = {+ ErrorTrackingList: 'error_tracking_list',+ } as const;+/*** Recommendation payload, shape depends on type.*/@@ -37157,6 +37218,16 @@ export namespace Schemas {readonly team: number;}+ /**+ * * `session_replay_list` - session_replay_list+ */+ export type SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnum = typeof SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnum[keyof typeof SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnum];+++ export const SessionReplayListWidgetAddRequestOpenApiWidgetTypeEnum = {+ SessionReplayList: 'session_replay_list',+ } as const;+export interface SessionSummaries {/*** List of session IDs to summarize (max 300)diff --git a/services/mcp/src/generated/dashboards/api.ts b/services/mcp/src/generated/dashboards/api.tsindex 886d93dfe17a..89bc8c6cb9b9 100644--- a/services/mcp/src/generated/dashboards/api.ts+++ b/services/mcp/src/generated/dashboards/api.ts@@ -448,203 +448,273 @@ export const DashboardsWidgetsBatchCreateQueryParams = /* @__PURE__ */ zod.objecformat: zod.enum(['json', 'txt']).optional(),})-export const dashboardsWidgetsBatchCreateBodyWidgetsItemWidgetTypeMax = 64+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneNameMax = 400-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitDefault = 10-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitMax = 25+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitDefault = 10+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitMax = 25-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderByDefault = `occurrences`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderDirectionDefault = `DESC`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneStatusDefault = `active`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitDefault = 10-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitMax = 25+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderByDefault = `occurrences`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderDirectionDefault = `DESC`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneStatusDefault = `active`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoNameMax = 400-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderByDefault = `start_time`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderDirectionDefault = `DESC`-export const dashboardsWidgetsBatchCreateBodyWidgetsItemNameMax = 400+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitDefault = 10+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitMax = 25+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderByDefault = `start_time`+export const dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderDirectionDefault = `DESC`export const dashboardsWidgetsBatchCreateBodyWidgetsMax = 10-export const DashboardsWidgetsBatchCreateBody = /* @__PURE__ */ zod.object({- widgets: zod- .array(- zod.object({- widget_type: zod- .string()- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemWidgetTypeMax)- .describe(- 'Widget type identifier. Supported values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type.'- ),- config: zod- .union([- zod.object({- limit: zod- .number()- .min(1)- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitMax)- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneLimitDefault)- .describe('Maximum number of issues to return.'),- orderBy: zod- .enum(['last_seen', 'first_seen', 'occurrences', 'users', 'sessions'])- .describe(- '* `last_seen` - last_seen\n* `first_seen` - first_seen\n* `occurrences` - occurrences\n* `users` - users\n* `sessions` - sessions'- )- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderByDefault)- .describe(- 'Issue ranking column.\n\n* `first_seen` - first_seen\n* `last_seen` - last_seen\n* `occurrences` - occurrences\n* `sessions` - sessions\n* `users` - users'- ),- orderDirection: zod- .enum(['ASC', 'DESC'])- .describe('* `ASC` - ASC\n* `DESC` - DESC')- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneOrderDirectionDefault)- .describe('Sort direction for orderBy.\n\n* `ASC` - ASC\n* `DESC` - DESC'),- status: zod- .enum(['archived', 'active', 'resolved', 'pending_release', 'suppressed', 'all'])- .describe(- '* `archived` - archived\n* `active` - active\n* `resolved` - resolved\n* `pending_release` - pending_release\n* `suppressed` - suppressed\n* `all` - all'- )- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneOneStatusDefault)- .describe(- 'Issue status filter.\n\n* `archived` - archived\n* `active` - active\n* `resolved` - resolved\n* `pending_release` - pending_release\n* `suppressed` - suppressed\n* `all` - all'- ),- dateRange: zod- .union([- zod.object({- date_from: zod- .union([- zod- .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])- .describe(- '* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d'- ),- zod.null(),- ])+export const DashboardsWidgetsBatchCreateBody = /* @__PURE__ */ zod+ .object({+ widgets: zod+ .array(+ zod.union([+ zod.object({+ name: zod+ .string()+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemOneNameMax)+ .nullish()+ .describe('Optional custom display name for the widget tile.'),+ description: zod+ .string()+ .optional()+ .describe('Optional markdown description shown when show_description is enabled.'),+ layouts: zod+ .object({+ sm: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number()+ .optional()+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number()+ .optional()+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ })+ .optional()+ .describe(+ 'Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.'+ ),+ xs: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number().optional()- .describe(- "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d"- ),- }),- zod.null(),- ])- .optional()- .describe('Optional relative date range override.'),- filterTestAccounts: zod- .boolean()- .optional()- .describe('When omitted, follows the project default for filtering test accounts.'),- }),- zod.object({- limit: zod- .number()- .min(1)- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitMax)- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoLimitDefault)- .describe('Maximum number of recordings to return.'),- orderBy: zod- .enum([- 'activity_score',- 'click_count',- 'console_error_count',- 'duration',- 'recording_duration',- 'start_time',- ])- .describe(- '* `activity_score` - activity_score\n* `click_count` - click_count\n* `console_error_count` - console_error_count\n* `duration` - duration\n* `recording_duration` - recording_duration\n* `start_time` - start_time'- )- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderByDefault)- .describe(- 'Recording ranking column.\n\n* `activity_score` - activity_score\n* `click_count` - click_count\n* `console_error_count` - console_error_count\n* `duration` - duration\n* `recording_duration` - recording_duration\n* `start_time` - start_time'- ),- orderDirection: zod- .enum(['ASC', 'DESC'])- .describe('* `ASC` - ASC\n* `DESC` - DESC')- .default(dashboardsWidgetsBatchCreateBodyWidgetsItemConfigOneTwoOrderDirectionDefault)- .describe('Sort direction for orderBy.\n\n* `ASC` - ASC\n* `DESC` - DESC'),- dateRange: zod- .union([- zod.object({- date_from: zod- .union([- zod- .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])- .describe(- '* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d'- ),- zod.null(),- ])+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number().optional()- .describe(- "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d"- ),- }),- zod.null(),- ])- .optional()- .describe('Optional relative date range override.'),- filterTestAccounts: zod- .boolean()- .optional()- .describe('When omitted, follows the project default for filtering test accounts.'),- }),- ])- .describe(- 'Widget-specific configuration. Shape depends on widget_type; see dashboard-widget-catalog-list for config_schema_hints. Supported types: error_tracking_list, session_replay_list.'- ),- name: zod- .string()- .max(dashboardsWidgetsBatchCreateBodyWidgetsItemNameMax)- .nullish()- .describe('Optional custom display name for the widget tile.'),- description: zod- .string()- .optional()- .describe('Optional markdown description shown when show_description is enabled.'),- layouts: zod- .object({- sm: zod+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ })+ .optional()+ .describe('Layout for the small (mobile) breakpoint. The grid is 1 column wide.'),+ })+ .optional()+ .describe('Optional react-grid-layout positions keyed by breakpoint (sm, xs).'),+ show_description: zod+ .boolean()+ .optional()+ .describe('Whether to show the description on the dashboard tile.'),+ widget_type: zod.enum(['error_tracking_list']),+ config: zod.object({- x: zod+ limit: zod.number()+ .min(1)+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitMax)+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneLimitDefault)+ .describe('Maximum number of issues to return.'),+ orderBy: zod+ .enum(['last_seen', 'first_seen', 'occurrences', 'users', 'sessions'])+ .describe(+ '* `last_seen` - last_seen\n* `first_seen` - first_seen\n* `occurrences` - occurrences\n* `users` - users\n* `sessions` - sessions'+ )+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderByDefault)+ .describe(+ 'Issue ranking column.\n\n* `first_seen` - first_seen\n* `last_seen` - last_seen\n* `occurrences` - occurrences\n* `sessions` - sessions\n* `users` - users'+ ),+ orderDirection: zod+ .enum(['ASC', 'DESC'])+ .describe('* `ASC` - ASC\n* `DESC` - DESC')+ .default(+ dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneOrderDirectionDefault+ )+ .describe('Sort direction for orderBy.\n\n* `ASC` - ASC\n* `DESC` - DESC'),+ status: zod+ .enum(['archived', 'active', 'resolved', 'pending_release', 'suppressed', 'all'])+ .describe(+ '* `archived` - archived\n* `active` - active\n* `resolved` - resolved\n* `pending_release` - pending_release\n* `suppressed` - suppressed\n* `all` - all'+ )+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemOneConfigOneStatusDefault)+ .describe(+ 'Issue status filter.\n\n* `archived` - archived\n* `active` - active\n* `resolved` - resolved\n* `pending_release` - pending_release\n* `suppressed` - suppressed\n* `all` - all'+ ),+ dateRange: zod+ .union([+ zod.object({+ date_from: zod+ .union([+ zod+ .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])+ .describe(+ '* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d"+ ),+ }),+ zod.null(),+ ]).optional()- .describe('Column position in the dashboard grid (0-indexed).'),- y: zod.number().optional().describe('Row position in the dashboard grid (0-indexed).'),- w: zod- .number()+ .describe('Optional relative date range override.'),+ filterTestAccounts: zod+ .boolean().optional()- .describe('Width in grid columns. The desktop grid is 12 columns wide.'),- h: zod.number().optional().describe('Height in grid rows.'),+ .describe('When omitted, follows the project default for filtering test accounts.'),})+ .describe('Configuration for the error tracking list widget.'),+ }),+ zod.object({+ name: zod+ .string()+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoNameMax)+ .nullish()+ .describe('Optional custom display name for the widget tile.'),+ description: zod+ .string().optional()- .describe('Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.'),- xs: zod+ .describe('Optional markdown description shown when show_description is enabled.'),+ layouts: zod.object({- x: zod- .number()+ sm: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number()+ .optional()+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number()+ .optional()+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ }).optional()- .describe('Column position in the dashboard grid (0-indexed).'),- y: zod.number().optional().describe('Row position in the dashboard grid (0-indexed).'),- w: zod- .number()+ .describe(+ 'Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.'+ ),+ xs: zod+ .object({+ x: zod+ .number()+ .optional()+ .describe('Column position in the dashboard grid (0-indexed).'),+ y: zod+ .number()+ .optional()+ .describe('Row position in the dashboard grid (0-indexed).'),+ w: zod+ .number()+ .optional()+ .describe('Width in grid columns. The desktop grid is 12 columns wide.'),+ h: zod.number().optional().describe('Height in grid rows.'),+ }).optional()- .describe('Width in grid columns. The desktop grid is 12 columns wide.'),- h: zod.number().optional().describe('Height in grid rows.'),+ .describe('Layout for the small (mobile) breakpoint. The grid is 1 column wide.'),}).optional()- .describe('Layout for the small (mobile) breakpoint. The grid is 1 column wide.'),- })- .optional()- .describe('Optional react-grid-layout positions keyed by breakpoint (sm, xs).'),- show_description: zod- .boolean()- .optional()- .describe('Whether to show the description on the dashboard tile.'),- })- )- .min(1)- .max(dashboardsWidgetsBatchCreateBodyWidgetsMax)- .describe('Widget tiles to add atomically (1–10). Use a single-element list to add one widget.'),-})+ .describe('Optional react-grid-layout positions keyed by breakpoint (sm, xs).'),+ show_description: zod+ .boolean()+ .optional()+ .describe('Whether to show the description on the dashboard tile.'),+ widget_type: zod.enum(['session_replay_list']),+ config: zod+ .object({+ limit: zod+ .number()+ .min(1)+ .max(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitMax)+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneLimitDefault)+ .describe('Maximum number of recordings to return.'),+ orderBy: zod+ .enum([+ 'activity_score',+ 'click_count',+ 'console_error_count',+ 'duration',+ 'recording_duration',+ 'start_time',+ ])+ .describe(+ '* `activity_score` - activity_score\n* `click_count` - click_count\n* `console_error_count` - console_error_count\n* `duration` - duration\n* `recording_duration` - recording_duration\n* `start_time` - start_time'+ )+ .default(dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderByDefault)+ .describe(+ 'Recording ranking column.\n\n* `activity_score` - activity_score\n* `click_count` - click_count\n* `console_error_count` - console_error_count\n* `duration` - duration\n* `recording_duration` - recording_duration\n* `start_time` - start_time'+ ),+ orderDirection: zod+ .enum(['ASC', 'DESC'])+ .describe('* `ASC` - ASC\n* `DESC` - DESC')+ .default(+ dashboardsWidgetsBatchCreateBodyWidgetsItemTwoConfigOneOrderDirectionDefault+ )+ .describe('Sort direction for orderBy.\n\n* `ASC` - ASC\n* `DESC` - DESC'),+ dateRange: zod+ .union([+ zod.object({+ date_from: zod+ .union([+ zod+ .enum(['-14d', '-1h', '-24h', '-30d', '-3h', '-7d', '-90d'])+ .describe(+ '* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ "Relative lookback window (for example '-7d'). Omit to use the project default range.\n\n* `-14d` - -14d\n* `-1h` - -1h\n* `-24h` - -24h\n* `-30d` - -30d\n* `-3h` - -3h\n* `-7d` - -7d\n* `-90d` - -90d"+ ),+ }),+ zod.null(),+ ])+ .optional()+ .describe('Optional relative date range override.'),+ filterTestAccounts: zod+ .boolean()+ .optional()+ .describe('When omitted, follows the project default for filtering test accounts.'),+ })+ .describe('Configuration for the session replay list widget.'),+ }),+ ])+ )+ .min(1)+ .max(dashboardsWidgetsBatchCreateBodyWidgetsMax)+ .describe(+ 'Widget tiles to add atomically. Supported widget_type values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type. (1–10 per request).'+ ),+ })+ .describe('OpenAPI-only batch-add schema with widget_type-discriminated config shapes for agents.')/*** List registered dashboard widget types and config hints for agents.diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-widgets-batch-add.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-widgets-batch-add.jsonindex af82e485f343..9d9fee70c3f1 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-widgets-batch-add.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-widgets-batch-add.json@@ -6,12 +6,13 @@"type": "number"},"widgets": {- "description": "Widget tiles to add atomically (1–10). Use a single-element list to add one widget.",+ "description": "Widget tiles to add atomically. Supported widget_type values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type. (1–10 per request).","items": {- "properties": {- "config": {- "anyOf": [- {+ "anyOf": [+ {+ "properties": {+ "config": {+ "description": "Configuration for the error tracking list widget.","properties": {"dateRange": {"anyOf": [@@ -86,7 +87,88 @@},"type": "object"},- {+ "description": {+ "description": "Optional markdown description shown when show_description is enabled.",+ "type": "string"+ },+ "layouts": {+ "description": "Optional react-grid-layout positions keyed by breakpoint (sm, xs).",+ "properties": {+ "sm": {+ "description": "Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.",+ "properties": {+ "h": {+ "description": "Height in grid rows.",+ "type": "number"+ },+ "w": {+ "description": "Width in grid columns. The desktop grid is 12 columns wide.",+ "type": "number"+ },+ "x": {+ "description": "Column position in the dashboard grid (0-indexed).",+ "type": "number"+ },+ "y": {+ "description": "Row position in the dashboard grid (0-indexed).",+ "type": "number"+ }+ },+ "type": "object"+ },+ "xs": {+ "description": "Layout for the small (mobile) breakpoint. The grid is 1 column wide.",+ "properties": {+ "h": {+ "description": "Height in grid rows.",+ "type": "number"+ },+ "w": {+ "description": "Width in grid columns. The desktop grid is 12 columns wide.",+ "type": "number"+ },+ "x": {+ "description": "Column position in the dashboard grid (0-indexed).",+ "type": "number"+ },+ "y": {+ "description": "Row position in the dashboard grid (0-indexed).",+ "type": "number"+ }+ },+ "type": "object"+ }+ },+ "type": "object"+ },+ "name": {+ "anyOf": [+ {+ "maxLength": 400,+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional custom display name for the widget tile."+ },+ "show_description": {+ "description": "Whether to show the description on the dashboard tile.",+ "type": "boolean"+ },+ "widget_type": {+ "enum": ["error_tracking_list"],+ "type": "string"+ }+ },+ "required": ["widget_type", "config"],+ "type": "object"+ },+ {+ "properties": {+ "config": {+ "description": "Configuration for the session replay list widget.","properties": {"dateRange": {"anyOf": [@@ -154,88 +236,86 @@}},"type": "object"- }- ],- "description": "Widget-specific configuration. Shape depends on widget_type; see dashboard-widget-catalog-list for config_schema_hints. Supported types: error_tracking_list, session_replay_list."- },- "description": {- "description": "Optional markdown description shown when show_description is enabled.",- "type": "string"- },- "layouts": {- "description": "Optional react-grid-layout positions keyed by breakpoint (sm, xs).",- "properties": {- "sm": {- "description": "Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.",+ },+ "description": {+ "description": "Optional markdown description shown when show_description is enabled.",+ "type": "string"+ },+ "layouts": {+ "description": "Optional react-grid-layout positions keyed by breakpoint (sm, xs).","properties": {- "h": {- "description": "Height in grid rows.",- "type": "number"- },- "w": {- "description": "Width in grid columns. The desktop grid is 12 columns wide.",- "type": "number"- },- "x": {- "description": "Column position in the dashboard grid (0-indexed).",- "type": "number"+ "sm": {+ "description": "Layout for the standard (desktop) breakpoint. The grid is 12 columns wide.",+ "properties": {+ "h": {+ "description": "Height in grid rows.",+ "type": "number"+ },+ "w": {+ "description": "Width in grid columns. The desktop grid is 12 columns wide.",+ "type": "number"+ },+ "x": {+ "description": "Column position in the dashboard grid (0-indexed).",+ "type": "number"+ },+ "y": {+ "description": "Row position in the dashboard grid (0-indexed).",+ "type": "number"+ }+ },+ "type": "object"},- "y": {- "description": "Row position in the dashboard grid (0-indexed).",- "type": "number"+ "xs": {+ "description": "Layout for the small (mobile) breakpoint. The grid is 1 column wide.",+ "properties": {+ "h": {+ "description": "Height in grid rows.",+ "type": "number"+ },+ "w": {+ "description": "Width in grid columns. The desktop grid is 12 columns wide.",+ "type": "number"+ },+ "x": {+ "description": "Column position in the dashboard grid (0-indexed).",+ "type": "number"+ },+ "y": {+ "description": "Row position in the dashboard grid (0-indexed).",+ "type": "number"+ }+ },+ "type": "object"}},"type": "object"},- "xs": {- "description": "Layout for the small (mobile) breakpoint. The grid is 1 column wide.",- "properties": {- "h": {- "description": "Height in grid rows.",- "type": "number"- },- "w": {- "description": "Width in grid columns. The desktop grid is 12 columns wide.",- "type": "number"- },- "x": {- "description": "Column position in the dashboard grid (0-indexed).",- "type": "number"+ "name": {+ "anyOf": [+ {+ "maxLength": 400,+ "type": "string"},- "y": {- "description": "Row position in the dashboard grid (0-indexed).",- "type": "number"+ {+ "type": "null"}- },- "type": "object"+ ],+ "description": "Optional custom display name for the widget tile."+ },+ "show_description": {+ "description": "Whether to show the description on the dashboard tile.",+ "type": "boolean"+ },+ "widget_type": {+ "enum": ["session_replay_list"],+ "type": "string"}},+ "required": ["widget_type", "config"],"type": "object"- },- "name": {- "anyOf": [- {- "maxLength": 400,- "type": "string"- },- {- "type": "null"- }- ],- "description": "Optional custom display name for the widget tile."- },- "show_description": {- "description": "Whether to show the description on the dashboard tile.",- "type": "boolean"- },- "widget_type": {- "description": "Widget type identifier. Supported values: error_tracking_list, session_replay_list. Use dashboard-widget-catalog-list for config_schema_hints per type.",- "maxLength": 64,- "type": "string"}- },- "required": ["widget_type", "config"],- "type": "object"+ ]},"maxItems": 10,"minItems": 1,