From 29586fab7bc95b92786914c5b1413c6edc5b77ae Mon Sep 17 00:00:00 2001 From: Hugues Pouillot Date: Mon, 24 Aug 2026 16:15:12 +0200 Subject: [PATCH 1/4] feat(error-tracking): add severity rule MCP tools Expose list, create, and update operations for error tracking severity rules through the PostHog MCP server. Generated-By: PostHog Desktop Task-Id: 12089906-88c9-4363-aa68-4705d0f4c5f4 --- products/error_tracking/mcp/tools.yaml | 41 +- .../schema/generated-tool-definitions.json | 42 + services/mcp/schema/tool-definitions-all.json | 42 + .../mcp/src/generated/error_tracking/api.ts | 2456 ++++++++++++++++- .../mcp/src/tools/generated/error_tracking.ts | 79 + .../tools/errorTracking.integration.test.ts | 54 + .../error-tracking-severity-rules-create.json | 2162 +++++++++++++++ .../error-tracking-severity-rules-list.json | 5 + .../error-tracking-severity-rules-update.json | 2160 +++++++++++++++ 9 files changed, 7037 insertions(+), 4 deletions(-) create mode 100644 services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json create mode 100644 services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-list.json create mode 100644 services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json diff --git a/products/error_tracking/mcp/tools.yaml b/products/error_tracking/mcp/tools.yaml index 4b37478011b8..4895e06fc448 100644 --- a/products/error_tracking/mcp/tools.yaml +++ b/products/error_tracking/mcp/tools.yaml @@ -412,13 +412,36 @@ tools: the user before reducing it. error-tracking-severity-rules-create: operation: error_tracking_severity_rules_create - enabled: false + enabled: true + scopes: + - error_tracking:write + annotations: + readOnly: false + destructive: false + idempotent: false + title: Create error tracking severity rule + description: > + Create an error tracking severity rule for the current project. Provide `filters` and the `severity` to + assign when a newly created issue first matches this rule. Supported severities are `low`, `medium`, `high`, + and `critical`. Use `order_key` to set the evaluation priority. Lower values run first, and only the first + matching rule applies. Rules do not change existing issues. error-tracking-severity-rules-destroy: operation: error_tracking_severity_rules_destroy enabled: false error-tracking-severity-rules-list: operation: error_tracking_severity_rules_list - enabled: false + enabled: true + scopes: + - error_tracking:read + annotations: + readOnly: true + destructive: false + idempotent: true + title: List error tracking severity rules + description: > + List error tracking severity rules for the current project. Returns rules in evaluation order with their + filters, assigned severity, order key, and disabled state. Read the existing rules before creating or + updating one because only the first matching rule applies. error-tracking-severity-rules-partial-update: operation: error_tracking_severity_rules_partial_update enabled: false @@ -430,7 +453,19 @@ tools: enabled: false error-tracking-severity-rules-update: operation: error_tracking_severity_rules_update - enabled: false + enabled: true + scopes: + - error_tracking:write + annotations: + readOnly: false + destructive: false + idempotent: true + title: Update error tracking severity rule + description: > + Update an error tracking severity rule by ID. Include `filters`, `severity`, or both. Omitted fields keep + their existing values. Supported severities are `low`, `medium`, `high`, and `critical`. Updating filters + recompiles the rule and clears any auto-disable state. Changes apply only to issues created after the + update. error-tracking-spike-detection-config-list: operation: error_tracking_spike_detection_config_list enabled: false diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json index 479c1d0081fa..b7713d2920c6 100644 --- a/services/mcp/schema/generated-tool-definitions.json +++ b/services/mcp/schema/generated-tool-definitions.json @@ -3633,6 +3633,48 @@ "readOnlyHint": false } }, + "error-tracking-severity-rules-create": { + "description": "Create an error tracking severity rule for the current project. Provide `filters` and the `severity` to assign when a newly created issue first matches this rule. Supported severities are `low`, `medium`, `high`, and `critical`. Use `order_key` to set the evaluation priority. Lower values run first, and only the first matching rule applies. Rules do not change existing issues.", + "category": "Error tracking", + "feature": "error_tracking", + "summary": "Create error tracking severity rule", + "title": "Create error tracking severity rule", + "required_scopes": ["error_tracking:write"], + "annotations": { + "destructiveHint": false, + "idempotentHint": false, + "openWorldHint": true, + "readOnlyHint": false + } + }, + "error-tracking-severity-rules-list": { + "description": "List error tracking severity rules for the current project. Returns rules in evaluation order with their filters, assigned severity, order key, and disabled state. Read the existing rules before creating or updating one because only the first matching rule applies.", + "category": "Error tracking", + "feature": "error_tracking", + "summary": "List error tracking severity rules", + "title": "List error tracking severity rules", + "required_scopes": ["error_tracking:read"], + "annotations": { + "destructiveHint": false, + "idempotentHint": true, + "openWorldHint": true, + "readOnlyHint": true + } + }, + "error-tracking-severity-rules-update": { + "description": "Update an error tracking severity rule by ID. Include `filters`, `severity`, or both. Omitted fields keep their existing values. Supported severities are `low`, `medium`, `high`, and `critical`. Updating filters recompiles the rule and clears any auto-disable state. Changes apply only to issues created after the update.", + "category": "Error tracking", + "feature": "error_tracking", + "summary": "Update error tracking severity rule", + "title": "Update error tracking severity rule", + "required_scopes": ["error_tracking:write"], + "annotations": { + "destructiveHint": false, + "idempotentHint": true, + "openWorldHint": true, + "readOnlyHint": false + } + }, "error-tracking-suppression-rules-create": { "description": "Create an error tracking suppression rule for the current project. WARNING: matching errors are suppressed indefinitely — dropped at ingestion and will not appear as issues until the rule is disabled or deleted. Scope `filters` tightly to the exact exception type, message, URL, or properties you want gone. Do NOT create match-all rules (omitting `filters`) or broad rules — they silently swallow unrelated errors and cause data loss that is hard to detect after the fact. If unsure, set `sampling_rate` below `1.0` so only a fraction of matches are dropped (e.g. `0.5` drops half) rather than all of them. Confirm with the user before creating any rule that could match more than one distinct error.", "category": "Error tracking", diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json index 95ae01f1fe1d..bee503a86c27 100644 --- a/services/mcp/schema/tool-definitions-all.json +++ b/services/mcp/schema/tool-definitions-all.json @@ -3662,6 +3662,48 @@ "readOnlyHint": false } }, + "error-tracking-severity-rules-create": { + "description": "Create an error tracking severity rule for the current project. Provide `filters` and the `severity` to assign when a newly created issue first matches this rule. Supported severities are `low`, `medium`, `high`, and `critical`. Use `order_key` to set the evaluation priority. Lower values run first, and only the first matching rule applies. Rules do not change existing issues.", + "category": "Error tracking", + "feature": "error_tracking", + "summary": "Create error tracking severity rule", + "title": "Create error tracking severity rule", + "required_scopes": ["error_tracking:write"], + "annotations": { + "destructiveHint": false, + "idempotentHint": false, + "openWorldHint": true, + "readOnlyHint": false + } + }, + "error-tracking-severity-rules-list": { + "description": "List error tracking severity rules for the current project. Returns rules in evaluation order with their filters, assigned severity, order key, and disabled state. Read the existing rules before creating or updating one because only the first matching rule applies.", + "category": "Error tracking", + "feature": "error_tracking", + "summary": "List error tracking severity rules", + "title": "List error tracking severity rules", + "required_scopes": ["error_tracking:read"], + "annotations": { + "destructiveHint": false, + "idempotentHint": true, + "openWorldHint": true, + "readOnlyHint": true + } + }, + "error-tracking-severity-rules-update": { + "description": "Update an error tracking severity rule by ID. Include `filters`, `severity`, or both. Omitted fields keep their existing values. Supported severities are `low`, `medium`, `high`, and `critical`. Updating filters recompiles the rule and clears any auto-disable state. Changes apply only to issues created after the update.", + "category": "Error tracking", + "feature": "error_tracking", + "summary": "Update error tracking severity rule", + "title": "Update error tracking severity rule", + "required_scopes": ["error_tracking:write"], + "annotations": { + "destructiveHint": false, + "idempotentHint": true, + "openWorldHint": true, + "readOnlyHint": false + } + }, "error-tracking-suppression-rules-create": { "description": "Create an error tracking suppression rule for the current project. WARNING: matching errors are suppressed indefinitely — dropped at ingestion and will not appear as issues until the rule is disabled or deleted. Scope `filters` tightly to the exact exception type, message, URL, or properties you want gone. Do NOT create match-all rules (omitting `filters`) or broad rules — they silently swallow unrelated errors and cause data loss that is hard to detect after the fact. If unsure, set `sampling_rate` below `1.0` so only a fraction of matches are dropped (e.g. `0.5` drops half) rather than all of them. Confirm with the user before creating any rule that could match more than one distinct error.", "category": "Error tracking", diff --git a/services/mcp/src/generated/error_tracking/api.ts b/services/mcp/src/generated/error_tracking/api.ts index 642d2ff003cd..4edb0fbe4e97 100644 --- a/services/mcp/src/generated/error_tracking/api.ts +++ b/services/mcp/src/generated/error_tracking/api.ts @@ -3,7 +3,7 @@ * MCP service uses these Zod schemas for generated tool handlers. * To regenerate: hogli build:openapi * - * PostHog API - MCP 24 enabled ops + * PostHog API - MCP 27 enabled ops * OpenAPI spec version: 1.0.0 */ import * as zod from 'zod' @@ -6792,6 +6792,2460 @@ export const ErrorTrackingSettingsUpdateSettingsPartialUpdateBody = /* @__PURE__ .describe('Bucket window over which the per-issue rate limit applies, in minutes.'), }) +export const ErrorTrackingSeverityRulesListParams = /* @__PURE__ */ zod.object({ + project_id: zod + .string() + .describe( + "Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/." + ), +}) + +export const ErrorTrackingSeverityRulesCreateParams = /* @__PURE__ */ zod.object({ + project_id: zod + .string() + .describe( + "Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/." + ), +}) + +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwoOperatorDefault = `exact` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwoTypeDefault = `event` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemThreeTypeDefault = `person` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemFourTypeDefault = `person_metadata` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemFiveTypeDefault = `element` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemSixTypeDefault = `event_metadata` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemSevenTypeDefault = `session` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemEightKeyDefault = `id` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemEightOperatorDefault = `in` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemEightTypeDefault = `cohort` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemNineTypeDefault = `recording` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnezeroTypeDefault = `log_entry` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOneoneTypeDefault = `group` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnetwoTypeDefault = `feature` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnethreeOperatorDefault = `flag_evaluates_to` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnethreeTypeDefault = `flag` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnefourTypeDefault = `hogql` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnefiveTypeDefault = `empty` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnesixTypeDefault = `data_warehouse` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnesevenTypeDefault = `data_warehouse_person_property` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOneeightTypeDefault = `error_tracking_issue` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwozeroTypeDefault = `metric_attribute` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwotwoTypeDefault = `revenue_analytics` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwothreeTypeDefault = `account_custom_property` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofourTypeDefault = `workflow_variable` +export const errorTrackingSeverityRulesCreateBodyOrderKeyDefault = 0 + +export const ErrorTrackingSeverityRulesCreateBody = /* @__PURE__ */ zod.object({ + filters: zod + .object({ + type: zod.enum(['AND', 'OR']), + values: zod.array( + zod.union([ + zod.unknown(), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .union([ + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + zod.null(), + ]) + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwoOperatorDefault), + type: zod + .literal('event') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwoTypeDefault) + .describe('Event properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('person') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemThreeTypeDefault) + .describe('Person properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('person_metadata') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemFourTypeDefault) + .describe('Top-level columns on the persons table (e.g. created_at), not properties JSON'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.enum(['tag_name', 'text', 'href', 'selector']), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('element') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemFiveTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('event_metadata') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemSixTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('session') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemSevenTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + cohort_name: zod.union([zod.string(), zod.null()]).optional(), + key: zod + .literal('id') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemEightKeyDefault), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .union([ + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + zod.null(), + ]) + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemEightOperatorDefault), + type: zod + .literal('cohort') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemEightTypeDefault), + value: zod.number(), + }), + zod.object({ + key: zod.union([zod.enum(['duration', 'active_seconds', 'inactive_seconds']), zod.string()]), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('recording') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemNineTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('log_entry') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnezeroTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + group_key_names: zod.union([zod.record(zod.string(), zod.string()), zod.null()]).optional(), + group_type_index: zod.union([zod.number(), zod.null()]).optional(), + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('group') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOneoneTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('feature') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnetwoTypeDefault) + .describe('Event property with \"$feature\/\" prepended'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string().describe('The key should be the flag ID'), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .literal('flag_evaluates_to') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnethreeOperatorDefault) + .describe('Only flag_evaluates_to operator is allowed for flag dependencies'), + type: zod + .literal('flag') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnethreeTypeDefault) + .describe('Feature flag dependency'), + value: zod + .union([zod.boolean(), zod.string()]) + .describe('The value can be true, false, or a variant name'), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + type: zod + .literal('hogql') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnefourTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + type: zod + .literal('empty') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnefiveTypeDefault), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('data_warehouse') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnesixTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('data_warehouse_person_property') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOnesevenTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('error_tracking_issue') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemOneeightTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod.enum(['log', 'log_attribute', 'log_resource_attribute']), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('metric_attribute') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwozeroTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod.enum(['span', 'span_attribute', 'span_resource_attribute']), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('revenue_analytics') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwotwoTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('account_custom_property') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwothreeTypeDefault) + .describe( + 'Customer analytics account custom property — the key is the property definition id' + ), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('workflow_variable') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofourTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + ]) + ), + }) + .describe('Property-group filters evaluated against the event that creates an issue.'), + severity: zod + .enum(['low', 'medium', 'high', 'critical']) + .describe('\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `critical` - critical') + .describe( + 'Severity assigned when this rule is the first match.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `critical` - critical' + ), + order_key: zod + .number() + .default(errorTrackingSeverityRulesCreateBodyOrderKeyDefault) + .describe('Evaluation priority. Lower values run first. Defaults to 0.'), +}) + +export const ErrorTrackingSeverityRulesUpdateParams = /* @__PURE__ */ zod.object({ + id: zod.string(), + project_id: zod + .string() + .describe( + "Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/." + ), +}) + +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwoOperatorDefault = `exact` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwoTypeDefault = `event` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemThreeTypeDefault = `person` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemFourTypeDefault = `person_metadata` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemFiveTypeDefault = `element` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemSixTypeDefault = `event_metadata` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemSevenTypeDefault = `session` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemEightKeyDefault = `id` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemEightOperatorDefault = `in` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemEightTypeDefault = `cohort` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemNineTypeDefault = `recording` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnezeroTypeDefault = `log_entry` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOneoneTypeDefault = `group` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnetwoTypeDefault = `feature` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnethreeOperatorDefault = `flag_evaluates_to` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnethreeTypeDefault = `flag` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefourTypeDefault = `hogql` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefiveTypeDefault = `empty` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesixTypeDefault = `data_warehouse` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesevenTypeDefault = `data_warehouse_person_property` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOneeightTypeDefault = `error_tracking_issue` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwozeroTypeDefault = `metric_attribute` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwotwoTypeDefault = `revenue_analytics` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwothreeTypeDefault = `account_custom_property` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofourTypeDefault = `workflow_variable` + +export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ + filters: zod + .object({ + type: zod.enum(['AND', 'OR']), + values: zod.array( + zod.union([ + zod.unknown(), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .union([ + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + zod.null(), + ]) + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwoOperatorDefault), + type: zod + .literal('event') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwoTypeDefault) + .describe('Event properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('person') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemThreeTypeDefault) + .describe('Person properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('person_metadata') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemFourTypeDefault) + .describe('Top-level columns on the persons table (e.g. created_at), not properties JSON'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.enum(['tag_name', 'text', 'href', 'selector']), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('element') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemFiveTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('event_metadata') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemSixTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('session') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemSevenTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + cohort_name: zod.union([zod.string(), zod.null()]).optional(), + key: zod + .literal('id') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemEightKeyDefault), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .union([ + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + zod.null(), + ]) + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemEightOperatorDefault), + type: zod + .literal('cohort') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemEightTypeDefault), + value: zod.number(), + }), + zod.object({ + key: zod.union([zod.enum(['duration', 'active_seconds', 'inactive_seconds']), zod.string()]), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('recording') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemNineTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('log_entry') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnezeroTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + group_key_names: zod.union([zod.record(zod.string(), zod.string()), zod.null()]).optional(), + group_type_index: zod.union([zod.number(), zod.null()]).optional(), + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('group') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOneoneTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('feature') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnetwoTypeDefault) + .describe('Event property with \"$feature\/\" prepended'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string().describe('The key should be the flag ID'), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .literal('flag_evaluates_to') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnethreeOperatorDefault) + .describe('Only flag_evaluates_to operator is allowed for flag dependencies'), + type: zod + .literal('flag') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnethreeTypeDefault) + .describe('Feature flag dependency'), + value: zod + .union([zod.boolean(), zod.string()]) + .describe('The value can be true, false, or a variant name'), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + type: zod + .literal('hogql') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefourTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + type: zod + .literal('empty') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefiveTypeDefault), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('data_warehouse') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesixTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('data_warehouse_person_property') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesevenTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('error_tracking_issue') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOneeightTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod.enum(['log', 'log_attribute', 'log_resource_attribute']), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('metric_attribute') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwozeroTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod.enum(['span', 'span_attribute', 'span_resource_attribute']), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('revenue_analytics') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwotwoTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('account_custom_property') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwothreeTypeDefault) + .describe( + 'Customer analytics account custom property — the key is the property definition id' + ), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('workflow_variable') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofourTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + ]) + ), + }) + .optional() + .describe('Replacement property-group filters. Omit to preserve the existing filters.'), + severity: zod + .enum(['low', 'medium', 'high', 'critical']) + .describe('\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `critical` - critical') + .optional() + .describe( + 'Replacement severity. Omit to preserve the existing severity.\n\n\* `low` - low\n\* `medium` - medium\n\* `high` - high\n\* `critical` - critical' + ), +}) + export const ErrorTrackingSuppressionRulesListParams = /* @__PURE__ */ zod.object({ project_id: zod .string() diff --git a/services/mcp/src/tools/generated/error_tracking.ts b/services/mcp/src/tools/generated/error_tracking.ts index c760270c83bb..cc6ed48f4c88 100644 --- a/services/mcp/src/tools/generated/error_tracking.ts +++ b/services/mcp/src/tools/generated/error_tracking.ts @@ -24,6 +24,9 @@ import { ErrorTrackingQueryIssuesListCreateBody, ErrorTrackingRecommendationsListQueryParams, ErrorTrackingSettingsUpdateSettingsPartialUpdateBody, + ErrorTrackingSeverityRulesCreateBody, + ErrorTrackingSeverityRulesUpdateBody, + ErrorTrackingSeverityRulesUpdateParams, ErrorTrackingSuppressionRulesCreateBody, ErrorTrackingSuppressionRulesListQueryParams, ErrorTrackingSuppressionRulesUpdateBody, @@ -411,6 +414,79 @@ const errorTrackingSettingsUpdate = (): ToolBase< }, }) +const ErrorTrackingSeverityRulesCreateSchema = ErrorTrackingSeverityRulesCreateBody + +const errorTrackingSeverityRulesCreate = (): ToolBase< + typeof ErrorTrackingSeverityRulesCreateSchema, + Schemas.ErrorTrackingSeverityRule +> => ({ + name: 'error-tracking-severity-rules-create', + schema: ErrorTrackingSeverityRulesCreateSchema, + handler: async (context: Context, params: z.infer) => { + const projectId = await context.stateManager.getProjectId() + const body: Record = {} + if (params.filters !== undefined) { + body['filters'] = params.filters + } + if (params.severity !== undefined) { + body['severity'] = params.severity + } + if (params.order_key !== undefined) { + body['order_key'] = params.order_key + } + const result = await context.api.request({ + method: 'POST', + path: `/api/projects/${encodeURIComponent(String(projectId))}/error_tracking/severity_rules/`, + body, + }) + return result + }, +}) + +const ErrorTrackingSeverityRulesListSchema = z.object({}) + +const errorTrackingSeverityRulesList = (): ToolBase< + typeof ErrorTrackingSeverityRulesListSchema, + Schemas.ErrorTrackingSeverityRuleListResponse +> => ({ + name: 'error-tracking-severity-rules-list', + schema: ErrorTrackingSeverityRulesListSchema, + // eslint-disable-next-line no-unused-vars + handler: async (context: Context, params: z.infer) => { + const projectId = await context.stateManager.getProjectId() + const result = await context.api.request({ + method: 'GET', + path: `/api/projects/${encodeURIComponent(String(projectId))}/error_tracking/severity_rules/`, + }) + return result + }, +}) + +const ErrorTrackingSeverityRulesUpdateSchema = ErrorTrackingSeverityRulesUpdateParams.omit({ project_id: true }).extend( + ErrorTrackingSeverityRulesUpdateBody.shape +) + +const errorTrackingSeverityRulesUpdate = (): ToolBase => ({ + name: 'error-tracking-severity-rules-update', + schema: ErrorTrackingSeverityRulesUpdateSchema, + handler: async (context: Context, params: z.infer) => { + const projectId = await context.stateManager.getProjectId() + const body: Record = {} + if (params.filters !== undefined) { + body['filters'] = params.filters + } + if (params.severity !== undefined) { + body['severity'] = params.severity + } + const result = await context.api.request({ + method: 'PUT', + path: `/api/projects/${encodeURIComponent(String(projectId))}/error_tracking/severity_rules/${encodeURIComponent(String(params.id))}/`, + body, + }) + return result + }, +}) + const ErrorTrackingSuppressionRulesCreateSchema = ErrorTrackingSuppressionRulesCreateBody const errorTrackingSuppressionRulesCreate = (): ToolBase< @@ -781,6 +857,9 @@ export const GENERATED_TOOLS: Record ToolBase> = { 'error-tracking-recommendations-list': errorTrackingRecommendationsList, 'error-tracking-settings-get': errorTrackingSettingsGet, 'error-tracking-settings-update': errorTrackingSettingsUpdate, + 'error-tracking-severity-rules-create': errorTrackingSeverityRulesCreate, + 'error-tracking-severity-rules-list': errorTrackingSeverityRulesList, + 'error-tracking-severity-rules-update': errorTrackingSeverityRulesUpdate, 'error-tracking-suppression-rules-create': errorTrackingSuppressionRulesCreate, 'error-tracking-suppression-rules-list': errorTrackingSuppressionRulesList, 'error-tracking-suppression-rules-update': errorTrackingSuppressionRulesUpdate, diff --git a/services/mcp/tests/tools/errorTracking.integration.test.ts b/services/mcp/tests/tools/errorTracking.integration.test.ts index d536d354df5b..b2b0b32770e8 100644 --- a/services/mcp/tests/tools/errorTracking.integration.test.ts +++ b/services/mcp/tests/tools/errorTracking.integration.test.ts @@ -37,6 +37,7 @@ describe('Error Tracking', { concurrent: false }, () => { const createdAssignmentRuleIds: string[] = [] const createdGroupingRuleIds: string[] = [] const createdSuppressionRuleIds: string[] = [] + const createdSeverityRuleIds: string[] = [] const createdResources: CreatedResources = { featureFlags: [], insights: [], @@ -92,6 +93,17 @@ describe('Error Tracking', { concurrent: false }, () => { } } createdSuppressionRuleIds.length = 0 + for (const id of createdSeverityRuleIds) { + try { + await context.api.request({ + method: 'DELETE', + path: `/api/environments/${TEST_PROJECT_ID}/error_tracking/severity_rules/${id}/`, + }) + } catch { + // Cleanup is best effort because another request can delete the rule first. + } + } + createdSeverityRuleIds.length = 0 await cleanupResources(context.api, TEST_PROJECT_ID!, createdResources) }) @@ -384,6 +396,48 @@ describe('Error Tracking', { concurrent: false }, () => { }) }) + describe('severity rule tools', () => { + const severityRulesCreateTool = GENERATED_TOOLS['error-tracking-severity-rules-create']!() + const severityRulesListTool = GENERATED_TOOLS['error-tracking-severity-rules-list']!() + const severityRulesUpdateTool = GENERATED_TOOLS['error-tracking-severity-rules-update']!() + + it('should create and update a severity rule', async () => { + const createdRule = (await severityRulesCreateTool.handler(context, { + filters: { + type: 'AND', + values: [ + { + type: 'AND', + values: [ + { + key: '$exception_type', + type: 'event', + value: ['McpSeverityRuleTestError'], + operator: 'exact', + }, + ], + }, + ], + }, + severity: 'low', + order_key: 100, + })) as { id: string; severity: string } + + createdSeverityRuleIds.push(createdRule.id) + expect(createdRule.severity).toBe('low') + + await severityRulesUpdateTool.handler(context, { + id: createdRule.id, + severity: 'high', + }) + const listedRules = (await severityRulesListTool.handler(context, {})) as { + results: Array<{ id: string; severity: string }> + } + + expect(listedRules.results.find((rule) => rule.id === createdRule.id)?.severity).toBe('high') + }) + }) + describe('settings tools', () => { const settingsGetTool = GENERATED_TOOLS['error-tracking-settings-get']!() const settingsUpdateTool = GENERATED_TOOLS['error-tracking-settings-update']!() diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json new file mode 100644 index 000000000000..c1396c9995ef --- /dev/null +++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json @@ -0,0 +1,2162 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "filters": { + "description": "Property-group filters evaluated against the event that creates an issue.", + "properties": { + "type": { + "enum": ["AND", "OR"], + "type": "string" + }, + "values": { + "items": { + "anyOf": [ + {}, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "exact" + }, + "type": { + "const": "event", + "default": "event", + "description": "Event properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "person", + "default": "person", + "description": "Person properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "person_metadata", + "default": "person_metadata", + "description": "Top-level columns on the persons table (e.g. created_at), not properties JSON", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "enum": ["tag_name", "text", "href", "selector"], + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "element", + "default": "element", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "event_metadata", + "default": "event_metadata", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "session", + "default": "session", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "cohort_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "key": { + "const": "id", + "default": "id", + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "in" + }, + "type": { + "const": "cohort", + "default": "cohort", + "type": "string" + }, + "value": { + "type": "number" + } + }, + "required": ["value"], + "type": "object" + }, + { + "properties": { + "key": { + "anyOf": [ + { + "enum": ["duration", "active_seconds", "inactive_seconds"], + "type": "string" + }, + { + "type": "string" + } + ] + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "recording", + "default": "recording", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "log_entry", + "default": "log_entry", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "group_key_names": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "propertyNames": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "group_type_index": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "group", + "default": "group", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "feature", + "default": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "description": "The key should be the flag ID", + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "const": "flag_evaluates_to", + "default": "flag_evaluates_to", + "description": "Only flag_evaluates_to operator is allowed for flag dependencies", + "type": "string" + }, + "type": { + "const": "flag", + "default": "flag", + "description": "Feature flag dependency", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ], + "description": "The value can be true, false, or a variant name" + } + }, + "required": ["key", "value"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "hogql", + "default": "hogql", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + }, + { + "properties": { + "type": { + "const": "empty", + "default": "empty", + "type": "string" + } + }, + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "data_warehouse", + "default": "data_warehouse", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "data_warehouse_person_property", + "default": "data_warehouse_person_property", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "error_tracking_issue", + "default": "error_tracking_issue", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "enum": ["log", "log_attribute", "log_resource_attribute"], + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "metric_attribute", + "default": "metric_attribute", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "enum": ["span", "span_attribute", "span_resource_attribute"], + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "revenue_analytics", + "default": "revenue_analytics", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "account_custom_property", + "default": "account_custom_property", + "description": "Customer analytics account custom property — the key is the property definition id", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "workflow_variable", + "default": "workflow_variable", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + } + ] + }, + "type": "array" + } + }, + "required": ["type", "values"], + "type": "object" + }, + "order_key": { + "default": 0, + "description": "Evaluation priority. Lower values run first. Defaults to 0.", + "type": "number" + }, + "severity": { + "description": "Severity assigned when this rule is the first match.\n\n* `low` - low\n* `medium` - medium\n* `high` - high\n* `critical` - critical", + "enum": ["low", "medium", "high", "critical"], + "type": "string" + } + }, + "required": ["filters", "severity"], + "type": "object" +} diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-list.json new file mode 100644 index 000000000000..7b7ea9186078 --- /dev/null +++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-list.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": {}, + "type": "object" +} diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json new file mode 100644 index 000000000000..32c7a885512d --- /dev/null +++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json @@ -0,0 +1,2160 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "properties": { + "filters": { + "description": "Replacement property-group filters. Omit to preserve the existing filters.", + "properties": { + "type": { + "enum": ["AND", "OR"], + "type": "string" + }, + "values": { + "items": { + "anyOf": [ + {}, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "exact" + }, + "type": { + "const": "event", + "default": "event", + "description": "Event properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "person", + "default": "person", + "description": "Person properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "person_metadata", + "default": "person_metadata", + "description": "Top-level columns on the persons table (e.g. created_at), not properties JSON", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "enum": ["tag_name", "text", "href", "selector"], + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "element", + "default": "element", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "event_metadata", + "default": "event_metadata", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "session", + "default": "session", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "cohort_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "key": { + "const": "id", + "default": "id", + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "in" + }, + "type": { + "const": "cohort", + "default": "cohort", + "type": "string" + }, + "value": { + "type": "number" + } + }, + "required": ["value"], + "type": "object" + }, + { + "properties": { + "key": { + "anyOf": [ + { + "enum": ["duration", "active_seconds", "inactive_seconds"], + "type": "string" + }, + { + "type": "string" + } + ] + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "recording", + "default": "recording", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "log_entry", + "default": "log_entry", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "group_key_names": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "propertyNames": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ] + }, + "group_type_index": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "group", + "default": "group", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "feature", + "default": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "description": "The key should be the flag ID", + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "const": "flag_evaluates_to", + "default": "flag_evaluates_to", + "description": "Only flag_evaluates_to operator is allowed for flag dependencies", + "type": "string" + }, + "type": { + "const": "flag", + "default": "flag", + "description": "Feature flag dependency", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string" + } + ], + "description": "The value can be true, false, or a variant name" + } + }, + "required": ["key", "value"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "hogql", + "default": "hogql", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + }, + { + "properties": { + "type": { + "const": "empty", + "default": "empty", + "type": "string" + } + }, + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "data_warehouse", + "default": "data_warehouse", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "data_warehouse_person_property", + "default": "data_warehouse_person_property", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "error_tracking_issue", + "default": "error_tracking_issue", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "enum": ["log", "log_attribute", "log_resource_attribute"], + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "metric_attribute", + "default": "metric_attribute", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "enum": ["span", "span_attribute", "span_resource_attribute"], + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator", "type"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "revenue_analytics", + "default": "revenue_analytics", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "account_custom_property", + "default": "account_custom_property", + "description": "Customer analytics account custom property — the key is the property definition id", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "workflow_variable", + "default": "workflow_variable", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + } + ] + }, + "type": "array" + } + }, + "required": ["type", "values"], + "type": "object" + }, + "id": { + "type": "string" + }, + "severity": { + "description": "Replacement severity. Omit to preserve the existing severity.\n\n* `low` - low\n* `medium` - medium\n* `high` - high\n* `critical` - critical", + "enum": ["low", "medium", "high", "critical"], + "type": "string" + } + }, + "required": ["id"], + "type": "object" +} From cfa8d6507d5848aa4da26dbeeb74e60683cb0b79 Mon Sep 17 00:00:00 2001 From: Hugues Pouillot Date: Tue, 25 Aug 2026 15:37:50 +0200 Subject: [PATCH 2/4] fix(mcp): accept compacted workflow domain prefixes Validate that each affected tool remains reachable through the compact domain index instead of requiring one exact domain spelling. Generated-By: PostHog Desktop Task-Id: bc15d8bc-972e-4aea-8ad5-bebb38b8b6b1 --- .../tests/unit/instructions-formatter-snapshot.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/mcp/tests/unit/instructions-formatter-snapshot.test.ts b/services/mcp/tests/unit/instructions-formatter-snapshot.test.ts index 7194f51385ce..2e5a49b787bc 100644 --- a/services/mcp/tests/unit/instructions-formatter-snapshot.test.ts +++ b/services/mcp/tests/unit/instructions-formatter-snapshot.test.ts @@ -254,9 +254,12 @@ describe('InstructionsFormatter prompt snapshots', () => { const domains = domainsIn(rendered) expect(rendered.length).toBeLessThanOrEqual(MCP_INSTRUCTIONS_CHAR_BUDGET) - // Domains past the old cutoff point, i.e. the ones a truncated payload lost. - for (const domain of ['query', 'scout', 'session-recording', 'survey', 'web-analytics', 'workflows']) { - expect(domains).toContain(domain) + // Families past the old cutoff point must remain searchable after the index compacts. + const toolNames = Object.keys(getToolDefinitions()) + for (const family of ['query', 'scout', 'session-recording', 'survey', 'web-analytics', 'workflows']) { + const familyTools = toolNames.filter((name) => name.startsWith(family)) + expect(familyTools.length).toBeGreaterThan(0) + expect(familyTools.every((name) => domains.some((domain) => name.startsWith(domain)))).toBe(true) } }) From d8da1abd1661845515e432f360f0226b69bc4469 Mon Sep 17 00:00:00 2001 From: "tests-posthog[bot]" <250237707+tests-posthog[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 15:44:52 +0000 Subject: [PATCH 3/4] chore: update OpenAPI generated types --- .../mcp/src/generated/error_tracking/api.ts | 976 +++++++++++++++--- 1 file changed, 847 insertions(+), 129 deletions(-) diff --git a/services/mcp/src/generated/error_tracking/api.ts b/services/mcp/src/generated/error_tracking/api.ts index 1b6d38746bf8..5073e79dbbbd 100644 --- a/services/mcp/src/generated/error_tracking/api.ts +++ b/services/mcp/src/generated/error_tracking/api.ts @@ -8640,6 +8640,13 @@ export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwozeroType export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwotwoTypeDefault = `revenue_analytics` export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwothreeTypeDefault = `account_custom_property` export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofourTypeDefault = `workflow_variable` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneOperatorDefault = `exact` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneTypeDefault = `event` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemTwoTypeDefault = `person` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemThreeTypeDefault = `element` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFourTypeDefault = `feature` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFiveTypeDefault = `hogql` +export const errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveTypeDefault = `behavioral` export const errorTrackingSeverityRulesCreateBodyOrderKeyDefault = 0 export const ErrorTrackingSeverityRulesCreateBody = /* @__PURE__ */ zod.object({ @@ -9815,6 +9822,358 @@ export const ErrorTrackingSeverityRulesCreateBody = /* @__PURE__ */ zod.object({ ]) .optional(), }), + zod.object({ + event_filters: zod + .union([ + zod.array( + zod.union([ + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .union([ + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + zod.null(), + ]) + .default( + errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneOperatorDefault + ), + type: zod + .literal('event') + .default( + errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneTypeDefault + ) + .describe('Event properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('person') + .default( + errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemTwoTypeDefault + ) + .describe('Person properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.enum(['tag_name', 'text', 'href', 'selector']), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('element') + .default( + errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemThreeTypeDefault + ), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('feature') + .default( + errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFourTypeDefault + ) + .describe('Event property with \"$feature\/\" prepended'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + type: zod + .literal('hogql') + .default( + errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFiveTypeDefault + ), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + ]) + ), + zod.null(), + ]) + .optional() + .describe( + 'Extra property filters the matching events must satisfy. Deliberately excludes nested behavioral\/cohort filters and groups' + ), + event_type: zod.enum(['events', 'actions']), + explicit_datetime: zod + .union([zod.string(), zod.null()]) + .optional() + .describe( + 'Absolute or relative (e.g. -30d) lower date bound — alternative to time_value\/time_interval' + ), + explicit_datetime_to: zod.union([zod.string(), zod.null()]).optional(), + key: zod.string().describe("Event name, or action id when event_type is 'actions'"), + label: zod.union([zod.string(), zod.null()]).optional(), + negation: zod + .union([zod.boolean(), zod.null()]) + .optional() + .describe( + 'Match persons who did NOT satisfy the criterion. Not the same as a low count — zero-occurrence persons never match count operators' + ), + operator: zod + .union([ + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + zod.null(), + ]) + .optional() + .describe('Count comparison for performed_event_multiple, defaults to exact'), + operator_value: zod + .union([zod.number(), zod.null()]) + .optional() + .describe('Count threshold for performed_event_multiple'), + time_interval: zod.union([zod.enum(['day', 'week', 'month', 'year']), zod.null()]).optional(), + time_value: zod + .union([zod.number(), zod.null()]) + .optional() + .describe('Relative time window size, paired with time_interval'), + type: zod + .literal('behavioral') + .default(errorTrackingSeverityRulesCreateBodyFiltersOneValuesItemTwofiveTypeDefault) + .describe( + "Person performed (or didn't perform) an event in a time window. ClickHouse-only — not evaluable by flags or CDP" + ), + value: zod.enum(['performed_event', 'performed_event_multiple']), + }), ]) ), }) @@ -9865,6 +10224,13 @@ export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwozeroType export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwotwoTypeDefault = `revenue_analytics` export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwothreeTypeDefault = `account_custom_property` export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofourTypeDefault = `workflow_variable` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneOperatorDefault = `exact` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneTypeDefault = `event` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemTwoTypeDefault = `person` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemThreeTypeDefault = `element` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFourTypeDefault = `feature` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFiveTypeDefault = `hogql` +export const errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveTypeDefault = `behavioral` export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ filters: zod @@ -10519,8 +10885,125 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ key: zod.string(), label: zod.union([zod.string(), zod.null()]).optional(), type: zod - .literal('hogql') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefourTypeDefault), + .literal('hogql') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefourTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + type: zod + .literal('empty') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefiveTypeDefault), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('data_warehouse') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesixTypeDefault), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('data_warehouse_person_property') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesevenTypeDefault), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10531,11 +11014,6 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ ]) .optional(), }), - zod.object({ - type: zod - .literal('empty') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnefiveTypeDefault), - }), zod.object({ key: zod.string(), label: zod.union([zod.string(), zod.null()]).optional(), @@ -10580,8 +11058,8 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ 'not_icontains_multi', ]), type: zod - .literal('data_warehouse') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesixTypeDefault), + .literal('error_tracking_issue') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOneeightTypeDefault), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10635,9 +11113,7 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ 'icontains_multi', 'not_icontains_multi', ]), - type: zod - .literal('data_warehouse_person_property') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOnesevenTypeDefault), + type: zod.enum(['log', 'log_attribute', 'log_resource_attribute']), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10692,8 +11168,8 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ 'not_icontains_multi', ]), type: zod - .literal('error_tracking_issue') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemOneeightTypeDefault), + .literal('metric_attribute') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwozeroTypeDefault), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10747,7 +11223,7 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ 'icontains_multi', 'not_icontains_multi', ]), - type: zod.enum(['log', 'log_attribute', 'log_resource_attribute']), + type: zod.enum(['span', 'span_attribute', 'span_resource_attribute']), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10802,8 +11278,8 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ 'not_icontains_multi', ]), type: zod - .literal('metric_attribute') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwozeroTypeDefault), + .literal('revenue_analytics') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwotwoTypeDefault), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10857,7 +11333,12 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ 'icontains_multi', 'not_icontains_multi', ]), - type: zod.enum(['span', 'span_attribute', 'span_resource_attribute']), + type: zod + .literal('account_custom_property') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwothreeTypeDefault) + .describe( + 'Customer analytics account custom property — the key is the property definition id' + ), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10912,8 +11393,8 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ 'not_icontains_multi', ]), type: zod - .literal('revenue_analytics') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwotwoTypeDefault), + .literal('workflow_variable') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofourTypeDefault), value: zod .union([ zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), @@ -10922,122 +11403,359 @@ export const ErrorTrackingSeverityRulesUpdateBody = /* @__PURE__ */ zod.object({ zod.boolean(), zod.null(), ]) - .optional(), - }), - zod.object({ - key: zod.string(), + .optional(), + }), + zod.object({ + event_filters: zod + .union([ + zod.array( + zod.union([ + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod + .union([ + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + zod.null(), + ]) + .default( + errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneOperatorDefault + ), + type: zod + .literal('event') + .default( + errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemOneTypeDefault + ) + .describe('Event properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('person') + .default( + errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemTwoTypeDefault + ) + .describe('Person properties'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.enum(['tag_name', 'text', 'href', 'selector']), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('element') + .default( + errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemThreeTypeDefault + ), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + operator: zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), + type: zod + .literal('feature') + .default( + errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFourTypeDefault + ) + .describe('Event property with \"$feature\/\" prepended'), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + zod.object({ + key: zod.string(), + label: zod.union([zod.string(), zod.null()]).optional(), + type: zod + .literal('hogql') + .default( + errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveEventFiltersOneItemFiveTypeDefault + ), + value: zod + .union([ + zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), + zod.string(), + zod.number(), + zod.boolean(), + zod.null(), + ]) + .optional(), + }), + ]) + ), + zod.null(), + ]) + .optional() + .describe( + 'Extra property filters the matching events must satisfy. Deliberately excludes nested behavioral\/cohort filters and groups' + ), + event_type: zod.enum(['events', 'actions']), + explicit_datetime: zod + .union([zod.string(), zod.null()]) + .optional() + .describe( + 'Absolute or relative (e.g. -30d) lower date bound — alternative to time_value\/time_interval' + ), + explicit_datetime_to: zod.union([zod.string(), zod.null()]).optional(), + key: zod.string().describe("Event name, or action id when event_type is 'actions'"), label: zod.union([zod.string(), zod.null()]).optional(), - operator: zod.enum([ - 'exact', - 'is_not', - 'icontains', - 'not_icontains', - 'starts_with', - 'not_starts_with', - 'ends_with', - 'not_ends_with', - 'regex', - 'not_regex', - 'gt', - 'gte', - 'lt', - 'lte', - 'is_set', - 'is_not_set', - 'is_date_exact', - 'is_date_before', - 'is_date_after', - 'between', - 'not_between', - 'min', - 'max', - 'in', - 'not_in', - 'is_cleaned_path_exact', - 'flag_evaluates_to', - 'semver_eq', - 'semver_neq', - 'semver_gt', - 'semver_gte', - 'semver_lt', - 'semver_lte', - 'semver_tilde', - 'semver_caret', - 'semver_wildcard', - 'icontains_multi', - 'not_icontains_multi', - ]), - type: zod - .literal('account_custom_property') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwothreeTypeDefault) + negation: zod + .union([zod.boolean(), zod.null()]) + .optional() .describe( - 'Customer analytics account custom property — the key is the property definition id' + 'Match persons who did NOT satisfy the criterion. Not the same as a low count — zero-occurrence persons never match count operators' ), - value: zod + operator: zod .union([ - zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), - zod.string(), - zod.number(), - zod.boolean(), + zod.enum([ + 'exact', + 'is_not', + 'icontains', + 'not_icontains', + 'starts_with', + 'not_starts_with', + 'ends_with', + 'not_ends_with', + 'regex', + 'not_regex', + 'gt', + 'gte', + 'lt', + 'lte', + 'is_set', + 'is_not_set', + 'is_date_exact', + 'is_date_before', + 'is_date_after', + 'between', + 'not_between', + 'min', + 'max', + 'in', + 'not_in', + 'is_cleaned_path_exact', + 'flag_evaluates_to', + 'semver_eq', + 'semver_neq', + 'semver_gt', + 'semver_gte', + 'semver_lt', + 'semver_lte', + 'semver_tilde', + 'semver_caret', + 'semver_wildcard', + 'icontains_multi', + 'not_icontains_multi', + ]), zod.null(), ]) - .optional(), - }), - zod.object({ - key: zod.string(), - label: zod.union([zod.string(), zod.null()]).optional(), - operator: zod.enum([ - 'exact', - 'is_not', - 'icontains', - 'not_icontains', - 'starts_with', - 'not_starts_with', - 'ends_with', - 'not_ends_with', - 'regex', - 'not_regex', - 'gt', - 'gte', - 'lt', - 'lte', - 'is_set', - 'is_not_set', - 'is_date_exact', - 'is_date_before', - 'is_date_after', - 'between', - 'not_between', - 'min', - 'max', - 'in', - 'not_in', - 'is_cleaned_path_exact', - 'flag_evaluates_to', - 'semver_eq', - 'semver_neq', - 'semver_gt', - 'semver_gte', - 'semver_lt', - 'semver_lte', - 'semver_tilde', - 'semver_caret', - 'semver_wildcard', - 'icontains_multi', - 'not_icontains_multi', - ]), + .optional() + .describe('Count comparison for performed_event_multiple, defaults to exact'), + operator_value: zod + .union([zod.number(), zod.null()]) + .optional() + .describe('Count threshold for performed_event_multiple'), + time_interval: zod.union([zod.enum(['day', 'week', 'month', 'year']), zod.null()]).optional(), + time_value: zod + .union([zod.number(), zod.null()]) + .optional() + .describe('Relative time window size, paired with time_interval'), type: zod - .literal('workflow_variable') - .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofourTypeDefault), - value: zod - .union([ - zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])), - zod.string(), - zod.number(), - zod.boolean(), - zod.null(), - ]) - .optional(), + .literal('behavioral') + .default(errorTrackingSeverityRulesUpdateBodyFiltersOneValuesItemTwofiveTypeDefault) + .describe( + "Person performed (or didn't perform) an event in a time window. ClickHouse-only — not evaluable by flags or CDP" + ), + value: zod.enum(['performed_event', 'performed_event_multiple']), }), ]) ), From 35fa9fa1b5afaa31867824fe6623aa06dc31882a Mon Sep 17 00:00:00 2001 From: Hugues Pouillot Date: Wed, 26 Aug 2026 13:36:47 +0200 Subject: [PATCH 4/4] fix(mcp): update severity rule schema snapshots Regenerate the MCP tool-schema snapshots after the generated error tracking API gained behavioral filters. Generated-By: PostHog Desktop Task-Id: 7c8792a2-2d15-4047-9067-ca7fb2c72e8f --- .../error-tracking-severity-rules-create.json | 629 ++++++++++++++++++ .../error-tracking-severity-rules-update.json | 629 ++++++++++++++++++ 2 files changed, 1258 insertions(+) diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json index c1396c9995ef..e3658d8f8e1f 100644 --- a/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json +++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-create.json @@ -2137,6 +2137,635 @@ }, "required": ["key", "operator"], "type": "object" + }, + { + "properties": { + "event_filters": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "exact" + }, + "type": { + "const": "event", + "default": "event", + "description": "Event properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "person", + "default": "person", + "description": "Person properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "enum": ["tag_name", "text", "href", "selector"], + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "element", + "default": "element", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "feature", + "default": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "hogql", + "default": "hogql", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Extra property filters the matching events must satisfy. Deliberately excludes nested behavioral/cohort filters and groups" + }, + "event_type": { + "enum": ["events", "actions"], + "type": "string" + }, + "explicit_datetime": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Absolute or relative (e.g. -30d) lower date bound — alternative to time_value/time_interval" + }, + "explicit_datetime_to": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "key": { + "description": "Event name, or action id when event_type is 'actions'", + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "negation": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Match persons who did NOT satisfy the criterion. Not the same as a low count — zero-occurrence persons never match count operators" + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Count comparison for performed_event_multiple, defaults to exact" + }, + "operator_value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Count threshold for performed_event_multiple" + }, + "time_interval": { + "anyOf": [ + { + "enum": ["day", "week", "month", "year"], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "time_value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Relative time window size, paired with time_interval" + }, + "type": { + "const": "behavioral", + "default": "behavioral", + "description": "Person performed (or didn't perform) an event in a time window. ClickHouse-only — not evaluable by flags or CDP", + "type": "string" + }, + "value": { + "enum": ["performed_event", "performed_event_multiple"], + "type": "string" + } + }, + "required": ["event_type", "key", "value"], + "type": "object" } ] }, diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json index 32c7a885512d..b700b2d43579 100644 --- a/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json +++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/error-tracking-severity-rules-update.json @@ -2137,6 +2137,635 @@ }, "required": ["key", "operator"], "type": "object" + }, + { + "properties": { + "event_filters": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "exact" + }, + "type": { + "const": "event", + "default": "event", + "description": "Event properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "person", + "default": "person", + "description": "Person properties", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "enum": ["tag_name", "text", "href", "selector"], + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "element", + "default": "element", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "operator": { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + "type": { + "const": "feature", + "default": "feature", + "description": "Event property with \"$feature/\" prepended", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key", "operator"], + "type": "object" + }, + { + "properties": { + "key": { + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "const": "hogql", + "default": "hogql", + "type": "string" + }, + "value": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": ["key"], + "type": "object" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Extra property filters the matching events must satisfy. Deliberately excludes nested behavioral/cohort filters and groups" + }, + "event_type": { + "enum": ["events", "actions"], + "type": "string" + }, + "explicit_datetime": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Absolute or relative (e.g. -30d) lower date bound — alternative to time_value/time_interval" + }, + "explicit_datetime_to": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "key": { + "description": "Event name, or action id when event_type is 'actions'", + "type": "string" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "negation": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Match persons who did NOT satisfy the criterion. Not the same as a low count — zero-occurrence persons never match count operators" + }, + "operator": { + "anyOf": [ + { + "enum": [ + "exact", + "is_not", + "icontains", + "not_icontains", + "starts_with", + "not_starts_with", + "ends_with", + "not_ends_with", + "regex", + "not_regex", + "gt", + "gte", + "lt", + "lte", + "is_set", + "is_not_set", + "is_date_exact", + "is_date_before", + "is_date_after", + "between", + "not_between", + "min", + "max", + "in", + "not_in", + "is_cleaned_path_exact", + "flag_evaluates_to", + "semver_eq", + "semver_neq", + "semver_gt", + "semver_gte", + "semver_lt", + "semver_lte", + "semver_tilde", + "semver_caret", + "semver_wildcard", + "icontains_multi", + "not_icontains_multi" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Count comparison for performed_event_multiple, defaults to exact" + }, + "operator_value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Count threshold for performed_event_multiple" + }, + "time_interval": { + "anyOf": [ + { + "enum": ["day", "week", "month", "year"], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "time_value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "Relative time window size, paired with time_interval" + }, + "type": { + "const": "behavioral", + "default": "behavioral", + "description": "Person performed (or didn't perform) an event in a time window. ClickHouse-only — not evaluable by flags or CDP", + "type": "string" + }, + "value": { + "enum": ["performed_event", "performed_event_multiple"], + "type": "string" + } + }, + "required": ["event_type", "key", "value"], + "type": "object" } ] },