:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
refactor(mcp-analytics): move Tool quality tab queries to gated runners (#71465)
Georgis Andonisfe16630430b9
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex 7536e90f91c5..6dafb9e03e6e 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -1022,6 +1022,18 @@{"$ref": "#/definitions/MCPToolDailyStatsQuery"},+ {+ "$ref": "#/definitions/MCPToolQualityRowsQuery"+ },+ {+ "$ref": "#/definitions/MCPToolQualityDailyStatsQuery"+ },+ {+ "$ref": "#/definitions/MCPToolCategoryCountsQuery"+ },+ {+ "$ref": "#/definitions/MCPToolCategoriesQuery"+ },{"$ref": "#/definitions/MCPToolDescriptionsQuery"},@@ -8288,7 +8300,7 @@],"type": "object"},- "CachedMCPToolDailyStatsQueryResponse": {+ "CachedMCPToolCategoriesQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8342,7 +8354,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolDailyStatItem"+ "$ref": "#/definitions/MCPToolCategoryItem"},"type": "array"},@@ -8381,7 +8393,7 @@],"type": "object"},- "CachedMCPToolDescriptionsQueryResponse": {+ "CachedMCPToolCategoryCountsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8435,7 +8447,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolDescriptionItem"+ "$ref": "#/definitions/MCPToolCategoryCountItem"},"type": "array"},@@ -8474,7 +8486,7 @@],"type": "object"},- "CachedMCPToolFailuresQueryResponse": {+ "CachedMCPToolDailyStatsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8528,7 +8540,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolFailureItem"+ "$ref": "#/definitions/MCPToolDailyStatItem"},"type": "array"},@@ -8567,7 +8579,7 @@],"type": "object"},- "CachedMCPToolNeighborsQueryResponse": {+ "CachedMCPToolDescriptionsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8621,7 +8633,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolNeighborItem"+ "$ref": "#/definitions/MCPToolDescriptionItem"},"type": "array"},@@ -8660,7 +8672,7 @@],"type": "object"},- "CachedMCPToolSampleIntentsQueryResponse": {+ "CachedMCPToolFailuresQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8714,7 +8726,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolSampleIntentItem"+ "$ref": "#/definitions/MCPToolFailureItem"},"type": "array"},@@ -8753,7 +8765,7 @@],"type": "object"},- "CachedMCPToolStatsQueryResponse": {+ "CachedMCPToolNeighborsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8806,9 +8818,8 @@"description": "The date range used for the query"},"results": {- "description": "Zero or one row; empty when the tool had no calls in the window.","items": {- "$ref": "#/definitions/MCPToolStatsItem"+ "$ref": "#/definitions/MCPToolNeighborItem"},"type": "array"},@@ -8847,7 +8858,7 @@],"type": "object"},- "CachedMCPToolTopUsersQueryResponse": {+ "CachedMCPToolQualityDailyStatsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8901,7 +8912,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolTopUserItem"+ "$ref": "#/definitions/MCPToolQualityDailyStatItem"},"type": "array"},@@ -8940,7 +8951,7 @@],"type": "object"},- "CachedMarketingAnalyticsAggregatedQueryResponse": {+ "CachedMCPToolQualityRowsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -8993,126 +9004,11 @@"description": "The date range used for the query"},"results": {- "additionalProperties": {- "$ref": "#/definitions/MarketingAnalyticsItem"- },- "type": "object"- },- "samplingRate": {- "$ref": "#/definitions/SamplingRate"- },- "timezone": {- "type": "string"- },- "timings": {- "description": "Measured timings for different parts of the query generation process","items": {- "$ref": "#/definitions/QueryTiming"+ "$ref": "#/definitions/MCPToolQualityRowItem"},"type": "array"},- "warnings": {- "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",- "items": {- "anyOf": [- {- "$ref": "#/definitions/DataWarehouseSyncWarning"- },- {- "$ref": "#/definitions/AccessControlFilterWarning"- }- ]- },- "type": "array"- }- },- "required": [- "cache_key",- "is_cached",- "last_refresh",- "next_allowed_client_refresh",- "results",- "timezone"- ],- "type": "object"- },- "CachedMarketingAnalyticsTableQueryResponse": {- "additionalProperties": false,- "properties": {- "cache_key": {- "type": "string"- },- "cache_target_age": {- "format": "date-time",- "type": "string"- },- "calculation_trigger": {- "description": "What triggered the calculation of the query, leave empty if user/immediate",- "type": "string"- },- "columns": {- "items": {},- "type": "array"- },- "error": {- "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",- "type": "string"- },- "hasMore": {- "type": "boolean"- },- "hogql": {- "description": "Generated HogQL query.",- "type": "string"- },- "is_cached": {- "type": "boolean"- },- "last_refresh": {- "format": "date-time",- "type": "string"- },- "limit": {- "$ref": "#/definitions/integer"- },- "modifiers": {- "$ref": "#/definitions/HogQLQueryModifiers",- "description": "Modifiers used when performing the query"- },- "next_allowed_client_refresh": {- "format": "date-time",- "type": "string"- },- "offset": {- "$ref": "#/definitions/integer"- },- "query_metadata": {- "type": "object"- },- "query_status": {- "$ref": "#/definitions/QueryStatus",- "description": "Query status indicates whether next to the provided data, a query is still running."- },- "resolved_compare_date_range": {- "$ref": "#/definitions/ResolvedDateRangeResponse",- "description": "The resolved previous/comparison period date range, when comparing against another period"- },- "resolved_date_range": {- "$ref": "#/definitions/ResolvedDateRangeResponse",- "description": "The date range used for the query"- },- "results": {- "items": {- "items": {- "$ref": "#/definitions/MarketingAnalyticsItem"- },- "type": "array"- },- "type": "array"- },- "samplingRate": {- "$ref": "#/definitions/SamplingRate"- },"timezone": {"type": "string"},@@ -9123,10 +9019,6 @@},"type": "array"},- "types": {- "items": {},- "type": "array"- },"warnings": {"description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.","items": {@@ -9152,7 +9044,7 @@],"type": "object"},- "CachedMetricsQueryResponse": {+ "CachedMCPToolSampleIntentsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -9206,7 +9098,7 @@},"results": {"items": {- "$ref": "#/definitions/MetricsQuerySeries"+ "$ref": "#/definitions/MCPToolSampleIntentItem"},"type": "array"},@@ -9245,96 +9137,7 @@],"type": "object"},- "CachedNewExperimentQueryResponse": {- "additionalProperties": false,- "properties": {- "baseline": {- "$ref": "#/definitions/ExperimentStatsBaseValidated"- },- "breakdown_results": {- "items": {- "$ref": "#/definitions/ExperimentBreakdownResult"- },- "type": "array"- },- "cache_key": {- "type": "string"- },- "cache_target_age": {- "format": "date-time",- "type": "string"- },- "calculation_trigger": {- "description": "What triggered the calculation of the query, leave empty if user/immediate",- "type": "string"- },- "clickhouse_sql": {- "type": "string"- },- "hogql": {- "type": "string"- },- "is_cached": {- "type": "boolean"- },- "is_precomputed": {- "description": "Whether exposures were served from the precomputation system",- "type": "boolean"- },- "last_refresh": {- "format": "date-time",- "type": "string"- },- "next_allowed_client_refresh": {- "format": "date-time",- "type": "string"- },- "query_metadata": {- "type": "object"- },- "query_status": {- "$ref": "#/definitions/QueryStatus",- "description": "Query status indicates whether next to the provided data, a query is still running."- },- "timezone": {- "type": "string"- },- "variant_results": {- "anyOf": [- {- "items": {- "$ref": "#/definitions/ExperimentVariantResultFrequentist"- },- "type": "array"- },- {- "items": {- "$ref": "#/definitions/ExperimentVariantResultBayesian"- },- "type": "array"- }- ]- },- "warnings": {- "description": "Data warehouse sync warnings — see AnalyticsQueryResponseBase.warnings for semantics.",- "items": {- "$ref": "#/definitions/DataWarehouseSyncWarning"- },- "type": "array"- }- },- "required": [- "baseline",- "cache_key",- "is_cached",- "last_refresh",- "next_allowed_client_refresh",- "timezone",- "variant_results"- ],- "type": "object"- },- "CachedNonIntegratedConversionsTableQueryResponse": {+ "CachedMCPToolStatsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -9348,17 +9151,10 @@"description": "What triggered the calculation of the query, leave empty if user/immediate","type": "string"},- "columns": {- "items": {},- "type": "array"- },"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},- "hasMore": {- "type": "boolean"- },"hogql": {"description": "Generated HogQL query.","type": "string"@@ -9370,9 +9166,6 @@"format": "date-time","type": "string"},- "limit": {- "$ref": "#/definitions/integer"- },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"@@ -9381,9 +9174,6 @@"format": "date-time","type": "string"},- "offset": {- "$ref": "#/definitions/integer"- },"query_metadata": {"type": "object"},@@ -9400,17 +9190,12 @@"description": "The date range used for the query"},"results": {+ "description": "Zero or one row; empty when the tool had no calls in the window.","items": {- "items": {- "$ref": "#/definitions/MarketingAnalyticsItem"- },- "type": "array"+ "$ref": "#/definitions/MCPToolStatsItem"},"type": "array"},- "samplingRate": {- "$ref": "#/definitions/SamplingRate"- },"timezone": {"type": "string"},@@ -9421,10 +9206,6 @@},"type": "array"},- "types": {- "items": {},- "type": "array"- },"warnings": {"description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.","items": {@@ -9450,7 +9231,7 @@],"type": "object"},- "CachedPathsQueryResponse": {+ "CachedMCPToolTopUsersQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -9504,7 +9285,7 @@},"results": {"items": {- "$ref": "#/definitions/PathsLink"+ "$ref": "#/definitions/MCPToolTopUserItem"},"type": "array"},@@ -9543,7 +9324,7 @@],"type": "object"},- "CachedPropertyValuesQueryResponse": {+ "CachedMarketingAnalyticsAggregatedQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -9596,10 +9377,13 @@"description": "The date range used for the query"},"results": {- "items": {- "$ref": "#/definitions/PropertyValueItem"+ "additionalProperties": {+ "$ref": "#/definitions/MarketingAnalyticsItem"},- "type": "array"+ "type": "object"+ },+ "samplingRate": {+ "$ref": "#/definitions/SamplingRate"},"timezone": {"type": "string"@@ -9636,7 +9420,7 @@],"type": "object"},- "CachedRecordingsQueryResponse": {+ "CachedMarketingAnalyticsTableQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -9650,11 +9434,15 @@"description": "What triggered the calculation of the query, leave empty if user/immediate","type": "string"},+ "columns": {+ "items": {},+ "type": "array"+ },"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},- "has_next": {+ "hasMore": {"type": "boolean"},"hogql": {@@ -9668,6 +9456,9 @@"format": "date-time","type": "string"},+ "limit": {+ "$ref": "#/definitions/integer"+ },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"@@ -9676,9 +9467,8 @@"format": "date-time","type": "string"},- "next_cursor": {- "description": "Cursor for the next page. Contains the ordering value and session_id from the last record.",- "type": "string"+ "offset": {+ "$ref": "#/definitions/integer"},"query_metadata": {"type": "object"@@ -9697,10 +9487,16 @@},"results": {"items": {- "$ref": "#/definitions/SessionRecordingType"+ "items": {+ "$ref": "#/definitions/MarketingAnalyticsItem"+ },+ "type": "array"},"type": "array"},+ "samplingRate": {+ "$ref": "#/definitions/SamplingRate"+ },"timezone": {"type": "string"},@@ -9711,6 +9507,10 @@},"type": "array"},+ "types": {+ "items": {},+ "type": "array"+ },"warnings": {"description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.","items": {@@ -9728,7 +9528,6 @@},"required": ["cache_key",- "has_next","is_cached","last_refresh","next_allowed_client_refresh",@@ -9737,7 +9536,7 @@],"type": "object"},- "CachedRetentionQueryResponse": {+ "CachedMetricsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -9791,7 +9590,7 @@},"results": {"items": {- "$ref": "#/definitions/RetentionResult"+ "$ref": "#/definitions/MetricsQuerySeries"},"type": "array"},@@ -9830,9 +9629,18 @@],"type": "object"},- "CachedRevenueAnalyticsGrossRevenueQueryResponse": {+ "CachedNewExperimentQueryResponse": {"additionalProperties": false,"properties": {+ "baseline": {+ "$ref": "#/definitions/ExperimentStatsBaseValidated"+ },+ "breakdown_results": {+ "items": {+ "$ref": "#/definitions/ExperimentBreakdownResult"+ },+ "type": "array"+ },"cache_key": {"type": "string"},@@ -9844,16 +9652,97 @@"description": "What triggered the calculation of the query, leave empty if user/immediate","type": "string"},- "columns": {+ "clickhouse_sql": {+ "type": "string"+ },+ "hogql": {+ "type": "string"+ },+ "is_cached": {+ "type": "boolean"+ },+ "is_precomputed": {+ "description": "Whether exposures were served from the precomputation system",+ "type": "boolean"+ },+ "last_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "next_allowed_client_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "query_metadata": {+ "type": "object"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "timezone": {+ "type": "string"+ },+ "variant_results": {+ "anyOf": [+ {+ "items": {+ "$ref": "#/definitions/ExperimentVariantResultFrequentist"+ },+ "type": "array"+ },+ {+ "items": {+ "$ref": "#/definitions/ExperimentVariantResultBayesian"+ },+ "type": "array"+ }+ ]+ },+ "warnings": {+ "description": "Data warehouse sync warnings — see AnalyticsQueryResponseBase.warnings for semantics.","items": {- "type": "string"+ "$ref": "#/definitions/DataWarehouseSyncWarning"},"type": "array"+ }+ },+ "required": [+ "baseline",+ "cache_key",+ "is_cached",+ "last_refresh",+ "next_allowed_client_refresh",+ "timezone",+ "variant_results"+ ],+ "type": "object"+ },+ "CachedNonIntegratedConversionsTableQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "cache_key": {+ "type": "string"+ },+ "cache_target_age": {+ "format": "date-time",+ "type": "string"+ },+ "calculation_trigger": {+ "description": "What triggered the calculation of the query, leave empty if user/immediate",+ "type": "string"+ },+ "columns": {+ "items": {},+ "type": "array"},"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},+ "hasMore": {+ "type": "boolean"+ },"hogql": {"description": "Generated HogQL query.","type": "string"@@ -9865,6 +9754,9 @@"format": "date-time","type": "string"},+ "limit": {+ "$ref": "#/definitions/integer"+ },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"@@ -9873,6 +9765,9 @@"format": "date-time","type": "string"},+ "offset": {+ "$ref": "#/definitions/integer"+ },"query_metadata": {"type": "object"},@@ -9889,9 +9784,17 @@"description": "The date range used for the query"},"results": {- "items": {},+ "items": {+ "items": {+ "$ref": "#/definitions/MarketingAnalyticsItem"+ },+ "type": "array"+ },"type": "array"},+ "samplingRate": {+ "$ref": "#/definitions/SamplingRate"+ },"timezone": {"type": "string"},@@ -9902,6 +9805,10 @@},"type": "array"},+ "types": {+ "items": {},+ "type": "array"+ },"warnings": {"description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.","items": {@@ -9927,7 +9834,7 @@],"type": "object"},- "CachedRevenueAnalyticsMRRQueryResponse": {+ "CachedPathsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -9941,11 +9848,98 @@"description": "What triggered the calculation of the query, leave empty if user/immediate","type": "string"},- "columns": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "is_cached": {+ "type": "boolean"+ },+ "last_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "next_allowed_client_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "query_metadata": {+ "type": "object"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {"items": {- "type": "string"+ "$ref": "#/definitions/PathsLink"+ },+ "type": "array"+ },+ "timezone": {+ "type": "string"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]},"type": "array"+ }+ },+ "required": [+ "cache_key",+ "is_cached",+ "last_refresh",+ "next_allowed_client_refresh",+ "results",+ "timezone"+ ],+ "type": "object"+ },+ "CachedPropertyValuesQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "cache_key": {+ "type": "string"+ },+ "cache_target_age": {+ "format": "date-time",+ "type": "string"+ },+ "calculation_trigger": {+ "description": "What triggered the calculation of the query, leave empty if user/immediate",+ "type": "string"},"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",@@ -9987,7 +9981,7 @@},"results": {"items": {- "$ref": "#/definitions/RevenueAnalyticsMRRQueryResultItem"+ "$ref": "#/definitions/PropertyValueItem"},"type": "array"},@@ -10026,7 +10020,7 @@],"type": "object"},- "CachedRevenueAnalyticsMetricsQueryResponse": {+ "CachedRecordingsQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -10040,16 +10034,13 @@"description": "What triggered the calculation of the query, leave empty if user/immediate","type": "string"},- "columns": {- "items": {- "type": "string"- },- "type": "array"- },"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},+ "has_next": {+ "type": "boolean"+ },"hogql": {"description": "Generated HogQL query.","type": "string"@@ -10069,6 +10060,10 @@"format": "date-time","type": "string"},+ "next_cursor": {+ "description": "Cursor for the next page. Contains the ordering value and session_id from the last record.",+ "type": "string"+ },"query_metadata": {"type": "object"},@@ -10084,7 +10079,12 @@"$ref": "#/definitions/ResolvedDateRangeResponse","description": "The date range used for the query"},- "results": {},+ "results": {+ "items": {+ "$ref": "#/definitions/SessionRecordingType"+ },+ "type": "array"+ },"timezone": {"type": "string"},@@ -10112,6 +10112,7 @@},"required": ["cache_key",+ "has_next","is_cached","last_refresh","next_allowed_client_refresh",@@ -10120,7 +10121,7 @@],"type": "object"},- "CachedRevenueAnalyticsOverviewQueryResponse": {+ "CachedRetentionQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -10174,7 +10175,7 @@},"results": {"items": {- "$ref": "#/definitions/RevenueAnalyticsOverviewItem"+ "$ref": "#/definitions/RetentionResult"},"type": "array"},@@ -10213,7 +10214,7 @@],"type": "object"},- "CachedRevenueAnalyticsTopCustomersQueryResponse": {+ "CachedRevenueAnalyticsGrossRevenueQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -10271,7 +10272,10 @@"$ref": "#/definitions/ResolvedDateRangeResponse","description": "The date range used for the query"},- "results": {},+ "results": {+ "items": {},+ "type": "array"+ },"timezone": {"type": "string"},@@ -10307,7 +10311,7 @@],"type": "object"},- "CachedRevenueExampleDataWarehouseTablesQueryResponse": {+ "CachedRevenueAnalyticsMRRQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -10322,16 +10326,114 @@"type": "string"},"columns": {- "items": {},+ "items": {+ "type": "string"+ },"type": "array"},"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},- "hasMore": {+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "is_cached": {"type": "boolean"},+ "last_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "next_allowed_client_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "query_metadata": {+ "type": "object"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/RevenueAnalyticsMRRQueryResultItem"+ },+ "type": "array"+ },+ "timezone": {+ "type": "string"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": [+ "cache_key",+ "is_cached",+ "last_refresh",+ "next_allowed_client_refresh",+ "results",+ "timezone"+ ],+ "type": "object"+ },+ "CachedRevenueAnalyticsMetricsQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "cache_key": {+ "type": "string"+ },+ "cache_target_age": {+ "format": "date-time",+ "type": "string"+ },+ "calculation_trigger": {+ "description": "What triggered the calculation of the query, leave empty if user/immediate",+ "type": "string"+ },+ "columns": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },"hogql": {"description": "Generated HogQL query.","type": "string"@@ -10343,9 +10445,6 @@"format": "date-time","type": "string"},- "limit": {- "$ref": "#/definitions/integer"- },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"@@ -10354,9 +10453,6 @@"format": "date-time","type": "string"},- "offset": {- "$ref": "#/definitions/integer"- },"query_metadata": {"type": "object"},@@ -10383,8 +10479,97 @@},"type": "array"},- "types": {- "items": {},+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": [+ "cache_key",+ "is_cached",+ "last_refresh",+ "next_allowed_client_refresh",+ "results",+ "timezone"+ ],+ "type": "object"+ },+ "CachedRevenueAnalyticsOverviewQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "cache_key": {+ "type": "string"+ },+ "cache_target_age": {+ "format": "date-time",+ "type": "string"+ },+ "calculation_trigger": {+ "description": "What triggered the calculation of the query, leave empty if user/immediate",+ "type": "string"+ },+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "is_cached": {+ "type": "boolean"+ },+ "last_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "next_allowed_client_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "query_metadata": {+ "type": "object"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/RevenueAnalyticsOverviewItem"+ },+ "type": "array"+ },+ "timezone": {+ "type": "string"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },"type": "array"},"warnings": {@@ -10412,7 +10597,7 @@],"type": "object"},- "CachedRevenueExampleEventsQueryResponse": {+ "CachedRevenueAnalyticsTopCustomersQueryResponse": {"additionalProperties": false,"properties": {"cache_key": {@@ -10427,16 +10612,15 @@"type": "string"},"columns": {- "items": {},+ "items": {+ "type": "string"+ },"type": "array"},"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},- "hasMore": {- "type": "boolean"- },"hogql": {"description": "Generated HogQL query.","type": "string"@@ -10448,9 +10632,6 @@"format": "date-time","type": "string"},- "limit": {- "$ref": "#/definitions/integer"- },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"@@ -10459,9 +10640,6 @@"format": "date-time","type": "string"},- "offset": {- "$ref": "#/definitions/integer"- },"query_metadata": {"type": "object"},@@ -10488,10 +10666,216 @@},"type": "array"},- "types": {- "items": {},- "type": "array"- },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": [+ "cache_key",+ "is_cached",+ "last_refresh",+ "next_allowed_client_refresh",+ "results",+ "timezone"+ ],+ "type": "object"+ },+ "CachedRevenueExampleDataWarehouseTablesQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "cache_key": {+ "type": "string"+ },+ "cache_target_age": {+ "format": "date-time",+ "type": "string"+ },+ "calculation_trigger": {+ "description": "What triggered the calculation of the query, leave empty if user/immediate",+ "type": "string"+ },+ "columns": {+ "items": {},+ "type": "array"+ },+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hasMore": {+ "type": "boolean"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "is_cached": {+ "type": "boolean"+ },+ "last_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "limit": {+ "$ref": "#/definitions/integer"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "next_allowed_client_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "offset": {+ "$ref": "#/definitions/integer"+ },+ "query_metadata": {+ "type": "object"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {},+ "timezone": {+ "type": "string"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "types": {+ "items": {},+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": [+ "cache_key",+ "is_cached",+ "last_refresh",+ "next_allowed_client_refresh",+ "results",+ "timezone"+ ],+ "type": "object"+ },+ "CachedRevenueExampleEventsQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "cache_key": {+ "type": "string"+ },+ "cache_target_age": {+ "format": "date-time",+ "type": "string"+ },+ "calculation_trigger": {+ "description": "What triggered the calculation of the query, leave empty if user/immediate",+ "type": "string"+ },+ "columns": {+ "items": {},+ "type": "array"+ },+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hasMore": {+ "type": "boolean"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "is_cached": {+ "type": "boolean"+ },+ "last_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "limit": {+ "$ref": "#/definitions/integer"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "next_allowed_client_refresh": {+ "format": "date-time",+ "type": "string"+ },+ "offset": {+ "$ref": "#/definitions/integer"+ },+ "query_metadata": {+ "type": "object"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {},+ "timezone": {+ "type": "string"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "types": {+ "items": {},+ "type": "array"+ },"warnings": {"description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.","items": {@@ -28419,6 +28803,205 @@"required": ["results"],"type": "object"},+ "MCPToolCategoriesQuery": {+ "additionalProperties": false,+ "description": "Distinct $mcp_tool_category values seen in the window, sorted — powers the scope selector.",+ "properties": {+ "dateRange": {+ "$ref": "#/definitions/DateRange"+ },+ "kind": {+ "const": "MCPToolCategoriesQuery",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "response": {+ "$ref": "#/definitions/MCPToolCategoriesQueryResponse"+ },+ "tags": {+ "$ref": "#/definitions/QueryLogTags"+ },+ "version": {+ "description": "version of the node, used for schema migrations",+ "type": "number"+ }+ },+ "required": ["kind"],+ "type": "object"+ },+ "MCPToolCategoriesQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/MCPToolCategoryItem"+ },+ "type": "array"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": ["results"],+ "type": "object"+ },+ "MCPToolCategoryCountItem": {+ "additionalProperties": false,+ "description": "Call count for one $mcp_tool_category, powering the tab's share-of-usage headline.",+ "properties": {+ "calls": {+ "$ref": "#/definitions/integer"+ },+ "category": {+ "type": "string"+ }+ },+ "required": ["category", "calls"],+ "type": "object"+ },+ "MCPToolCategoryCountsQuery": {+ "additionalProperties": false,+ "description": "Per-category call counts over the window (empty category = uncategorized traffic).",+ "properties": {+ "dateRange": {+ "$ref": "#/definitions/DateRange"+ },+ "kind": {+ "const": "MCPToolCategoryCountsQuery",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "response": {+ "$ref": "#/definitions/MCPToolCategoryCountsQueryResponse"+ },+ "tags": {+ "$ref": "#/definitions/QueryLogTags"+ },+ "version": {+ "description": "version of the node, used for schema migrations",+ "type": "number"+ }+ },+ "required": ["kind"],+ "type": "object"+ },+ "MCPToolCategoryCountsQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/MCPToolCategoryCountItem"+ },+ "type": "array"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": ["results"],+ "type": "object"+ },+ "MCPToolCategoryItem": {+ "additionalProperties": false,+ "description": "One distinct $mcp_tool_category value seen in the window.",+ "properties": {+ "category": {+ "type": "string"+ }+ },+ "required": ["category"],+ "type": "object"+ },"MCPToolDailyStatItem": {"additionalProperties": false,"description": "One day of activity for a single MCP tool.",@@ -28764,48 +29347,176 @@"required": ["results"],"type": "object"},- "MCPToolNeighborItem": {+ "MCPToolNeighborItem": {+ "additionalProperties": false,+ "description": "One tool frequently called adjacent to the target tool within the same conversation.",+ "properties": {+ "co_occurrences": {+ "$ref": "#/definitions/integer"+ },+ "neighbor_tool": {+ "type": "string"+ }+ },+ "required": ["neighbor_tool", "co_occurrences"],+ "type": "object"+ },+ "MCPToolNeighborsQuery": {+ "additionalProperties": false,+ "description": "Tools most often called immediately before or after a single MCP tool within a conversation.",+ "properties": {+ "dateRange": {+ "$ref": "#/definitions/DateRange"+ },+ "kind": {+ "const": "MCPToolNeighborsQuery",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "neighborDirection": {+ "description": "Whether to count tools called immediately before or after the target tool.",+ "enum": ["before", "after"],+ "type": "string"+ },+ "response": {+ "$ref": "#/definitions/MCPToolNeighborsQueryResponse"+ },+ "tags": {+ "$ref": "#/definitions/QueryLogTags"+ },+ "toolName": {+ "description": "The effective tool name to scope to (matched against the single-exec-resolved tool name).",+ "type": "string"+ },+ "version": {+ "description": "version of the node, used for schema migrations",+ "type": "number"+ }+ },+ "required": ["kind", "neighborDirection", "toolName"],+ "type": "object"+ },+ "MCPToolNeighborsQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/MCPToolNeighborItem"+ },+ "type": "array"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": ["results"],+ "type": "object"+ },+ "MCPToolQualityDailyStatItem": {"additionalProperties": false,- "description": "One tool frequently called adjacent to the target tool within the same conversation.",+ "description": "One bucket of aggregate activity across tools on the Tool quality tab.","properties": {- "co_occurrences": {+ "calls": {"$ref": "#/definitions/integer"},- "neighbor_tool": {+ "day": {"type": "string"+ },+ "errors": {+ "$ref": "#/definitions/integer"+ },+ "p50": {+ "type": "number"+ },+ "p95": {+ "type": "number"+ },+ "p99": {+ "type": "number"}},- "required": ["neighbor_tool", "co_occurrences"],+ "required": ["day", "calls", "errors", "p50", "p95", "p99"],"type": "object"},- "MCPToolNeighborsQuery": {+ "MCPToolQualityDailyStatsQuery": {"additionalProperties": false,- "description": "Tools most often called immediately before or after a single MCP tool within a conversation.",+ "description": "Interval-bucketed activity series for the Tool quality tab (optionally scoped to one tool).","properties": {+ "categories": {+ "description": "Restrict to these $mcp_tool_category values; empty or omitted means all categories.",+ "items": {+ "type": "string"+ },+ "type": "array"+ },"dateRange": {"$ref": "#/definitions/DateRange"},+ "interval": {+ "$ref": "#/definitions/IntervalType",+ "description": "Bucket granularity; the frontend passes getDefaultInterval. Defaults to day."+ },"kind": {- "const": "MCPToolNeighborsQuery",+ "const": "MCPToolQualityDailyStatsQuery","type": "string"},"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"},- "neighborDirection": {- "description": "Whether to count tools called immediately before or after the target tool.",- "enum": ["before", "after"],- "type": "string"- },"response": {- "$ref": "#/definitions/MCPToolNeighborsQueryResponse"+ "$ref": "#/definitions/MCPToolQualityDailyStatsQueryResponse"},"tags": {"$ref": "#/definitions/QueryLogTags"},"toolName": {- "description": "The effective tool name to scope to (matched against the single-exec-resolved tool name).",+ "description": "Restrict to a single $mcp_tool_name; omitted means the aggregate across all tools.","type": "string"},"version": {@@ -28813,10 +29524,10 @@"type": "number"}},- "required": ["kind", "neighborDirection", "toolName"],+ "required": ["kind"],"type": "object"},- "MCPToolNeighborsQueryResponse": {+ "MCPToolQualityDailyStatsQueryResponse": {"additionalProperties": false,"properties": {"error": {@@ -28845,7 +29556,154 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolNeighborItem"+ "$ref": "#/definitions/MCPToolQualityDailyStatItem"+ },+ "type": "array"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": ["results"],+ "type": "object"+ },+ "MCPToolQualityRowItem": {+ "additionalProperties": false,+ "description": "Per-tool quality metrics for the Tool quality tab table.",+ "properties": {+ "error_rate_pct": {+ "type": "number"+ },+ "errors": {+ "$ref": "#/definitions/integer"+ },+ "first_seen": {+ "type": "string"+ },+ "last_seen": {+ "type": "string"+ },+ "p50_duration_ms": {+ "type": "number"+ },+ "p95_duration_ms": {+ "type": "number"+ },+ "p99_duration_ms": {+ "type": "number"+ },+ "sessions": {+ "$ref": "#/definitions/integer"+ },+ "tool": {+ "type": "string"+ },+ "total_calls": {+ "$ref": "#/definitions/integer"+ },+ "users": {+ "$ref": "#/definitions/integer"+ }+ },+ "required": [+ "tool",+ "total_calls",+ "errors",+ "error_rate_pct",+ "p50_duration_ms",+ "p95_duration_ms",+ "p99_duration_ms",+ "users",+ "sessions",+ "first_seen",+ "last_seen"+ ],+ "type": "object"+ },+ "MCPToolQualityRowsQuery": {+ "additionalProperties": false,+ "description": "One row per $mcp_tool_name — call volume, error rate, latency percentiles, and reach — over the window.",+ "properties": {+ "categories": {+ "description": "Restrict to these $mcp_tool_category values; empty or omitted means all categories.",+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "dateRange": {+ "$ref": "#/definitions/DateRange"+ },+ "kind": {+ "const": "MCPToolQualityRowsQuery",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "response": {+ "$ref": "#/definitions/MCPToolQualityRowsQueryResponse"+ },+ "tags": {+ "$ref": "#/definitions/QueryLogTags"+ },+ "version": {+ "description": "version of the node, used for schema migrations",+ "type": "number"+ }+ },+ "required": ["kind"],+ "type": "object"+ },+ "MCPToolQualityRowsQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/MCPToolQualityRowItem"},"type": "array"},@@ -32526,6 +33384,10 @@"MCPToolFailuresQuery","MCPToolStatsQuery","MCPToolDailyStatsQuery",+ "MCPToolQualityRowsQuery",+ "MCPToolQualityDailyStatsQuery",+ "MCPToolCategoryCountsQuery",+ "MCPToolCategoriesQuery","MCPToolDescriptionsQuery","MCPToolSampleIntentsQuery","MCPToolNeighborsQuery",@@ -40247,21 +41109,126 @@{"additionalProperties": false,"properties": {- "newerTimestamp": {- "description": "Timestamp of the newer trace",+ "newerTimestamp": {+ "description": "Timestamp of the newer trace",+ "type": "string"+ },+ "newerTraceId": {+ "description": "ID of the newer trace (chronologically after current)",+ "type": "string"+ },+ "olderTimestamp": {+ "description": "Timestamp of the older trace",+ "type": "string"+ },+ "olderTraceId": {+ "description": "ID of the older trace (chronologically before current)",+ "type": "string"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Data warehouse sync warnings — see AnalyticsQueryResponseBase.warnings for semantics.",+ "items": {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ "type": "array"+ }+ },+ "type": "object"+ },+ {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "$ref": "#/definitions/VectorSearchResponse"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },+ "type": "array"+ },+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": ["results"],+ "type": "object"+ },+ {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},- "newerTraceId": {- "description": "ID of the newer trace (chronologically after current)",+ "hogql": {+ "description": "Generated HogQL query.","type": "string"},- "olderTimestamp": {- "description": "Timestamp of the older trace",- "type": "string"+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"},- "olderTraceId": {- "description": "ID of the older trace (chronologically before current)",- "type": "string"+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/UsageMetric"+ },+ "type": "array"},"timings": {"description": "Measured timings for different parts of the query generation process",@@ -40271,30 +41238,62 @@"type": "array"},"warnings": {- "description": "Data warehouse sync warnings — see AnalyticsQueryResponseBase.warnings for semantics.",+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.","items": {- "$ref": "#/definitions/DataWarehouseSyncWarning"+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]},"type": "array"}},+ "required": ["results"],"type": "object"},{"additionalProperties": false,"properties": {+ "columns": {+ "items": {},+ "type": "array"+ },"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},+ "hasMore": {+ "type": "boolean"+ },"hogql": {"description": "Generated HogQL query.","type": "string"},+ "kind": {+ "const": "AccountsQuery",+ "type": "string"+ },+ "limit": {+ "$ref": "#/definitions/integer"+ },+ "metricsResults": {+ "description": "When `metrics` is set on the query, the aggregated values in the same order.",+ "items": {+ "type": ["number", "null"]+ },+ "type": "array"+ },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"},+ "offset": {+ "$ref": "#/definitions/integer"+ },"query_status": {"$ref": "#/definitions/QueryStatus","description": "Query status indicates whether next to the provided data, a query is still running."@@ -40308,7 +41307,11 @@"description": "The date range used for the query"},"results": {- "$ref": "#/definitions/VectorSearchResponse"+ "items": {+ "items": {},+ "type": "array"+ },+ "type": "array"},"timings": {"description": "Measured timings for different parts of the query generation process",@@ -40317,6 +41320,12 @@},"type": "array"},+ "types": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },"warnings": {"description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.","items": {@@ -40332,7 +41341,7 @@"type": "array"}},- "required": ["results"],+ "required": ["columns", "hogql", "kind", "limit", "offset", "results", "types"],"type": "object"},{@@ -40364,7 +41373,7 @@},"results": {"items": {- "$ref": "#/definitions/UsageMetric"+ "$ref": "#/definitions/EndpointsUsageOverviewItem"},"type": "array"},@@ -40411,20 +41420,9 @@"description": "Generated HogQL query.","type": "string"},- "kind": {- "const": "AccountsQuery",- "type": "string"- },"limit": {"$ref": "#/definitions/integer"},- "metricsResults": {- "description": "When `metrics` is set on the query, the aggregated values in the same order.",- "items": {- "type": ["number", "null"]- },- "type": "array"- },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"@@ -40445,10 +41443,7 @@"description": "The date range used for the query"},"results": {- "items": {- "items": {},- "type": "array"- },+ "items": {},"type": "array"},"timings": {@@ -40459,9 +41454,7 @@"type": "array"},"types": {- "items": {- "type": "string"- },+ "items": {},"type": "array"},"warnings": {@@ -40479,7 +41472,7 @@"type": "array"}},- "required": ["columns", "hogql", "kind", "limit", "offset", "results", "types"],+ "required": ["results"],"type": "object"},{@@ -40511,7 +41504,7 @@},"results": {"items": {- "$ref": "#/definitions/EndpointsUsageOverviewItem"+ "type": "object"},"type": "array"},@@ -40543,31 +41536,76 @@{"additionalProperties": false,"properties": {- "columns": {- "items": {},+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/MCPHarnessBreakdownItem"+ },+ "type": "array"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },"type": "array"},+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": ["results"],+ "type": "object"+ },+ {+ "additionalProperties": false,+ "properties": {"error": {"description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.","type": "string"},- "hasMore": {- "type": "boolean"- },"hogql": {"description": "Generated HogQL query.","type": "string"},- "limit": {- "$ref": "#/definitions/integer"- },"modifiers": {"$ref": "#/definitions/HogQLQueryModifiers","description": "Modifiers used when performing the query"},- "offset": {- "$ref": "#/definitions/integer"- },"query_status": {"$ref": "#/definitions/QueryStatus","description": "Query status indicates whether next to the provided data, a query is still running."@@ -40581,7 +41619,9 @@"description": "The date range used for the query"},"results": {- "items": {},+ "items": {+ "$ref": "#/definitions/MCPToolTopUserItem"+ },"type": "array"},"timings": {@@ -40591,8 +41631,62 @@},"type": "array"},- "types": {- "items": {},+ "warnings": {+ "description": "Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access.",+ "items": {+ "anyOf": [+ {+ "$ref": "#/definitions/DataWarehouseSyncWarning"+ },+ {+ "$ref": "#/definitions/AccessControlFilterWarning"+ }+ ]+ },+ "type": "array"+ }+ },+ "required": ["results"],+ "type": "object"+ },+ {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "hogql": {+ "description": "Generated HogQL query.",+ "type": "string"+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "query_status": {+ "$ref": "#/definitions/QueryStatus",+ "description": "Query status indicates whether next to the provided data, a query is still running."+ },+ "resolved_compare_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The resolved previous/comparison period date range, when comparing against another period"+ },+ "resolved_date_range": {+ "$ref": "#/definitions/ResolvedDateRangeResponse",+ "description": "The date range used for the query"+ },+ "results": {+ "items": {+ "$ref": "#/definitions/MCPToolFailureItem"+ },+ "type": "array"+ },+ "timings": {+ "description": "Measured timings for different parts of the query generation process",+ "items": {+ "$ref": "#/definitions/QueryTiming"+ },"type": "array"},"warnings": {@@ -40641,8 +41735,9 @@"description": "The date range used for the query"},"results": {+ "description": "Zero or one row; empty when the tool had no calls in the window.","items": {- "type": "object"+ "$ref": "#/definitions/MCPToolStatsItem"},"type": "array"},@@ -40700,7 +41795,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPHarnessBreakdownItem"+ "$ref": "#/definitions/MCPToolDailyStatItem"},"type": "array"},@@ -40758,7 +41853,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolTopUserItem"+ "$ref": "#/definitions/MCPToolQualityRowItem"},"type": "array"},@@ -40816,7 +41911,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolFailureItem"+ "$ref": "#/definitions/MCPToolQualityDailyStatItem"},"type": "array"},@@ -40873,9 +41968,8 @@"description": "The date range used for the query"},"results": {- "description": "Zero or one row; empty when the tool had no calls in the window.","items": {- "$ref": "#/definitions/MCPToolStatsItem"+ "$ref": "#/definitions/MCPToolCategoryCountItem"},"type": "array"},@@ -40933,7 +42027,7 @@},"results": {"items": {- "$ref": "#/definitions/MCPToolDailyStatItem"+ "$ref": "#/definitions/MCPToolCategoryItem"},"type": "array"},@@ -41459,6 +42553,18 @@{"$ref": "#/definitions/MCPToolDailyStatsQuery"},+ {+ "$ref": "#/definitions/MCPToolQualityRowsQuery"+ },+ {+ "$ref": "#/definitions/MCPToolQualityDailyStatsQuery"+ },+ {+ "$ref": "#/definitions/MCPToolCategoryCountsQuery"+ },+ {+ "$ref": "#/definitions/MCPToolCategoriesQuery"+ },{"$ref": "#/definitions/MCPToolDescriptionsQuery"},diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex 752edf754ce4..da5442d7bc07 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -200,6 +200,10 @@ export enum NodeKind {MCPToolFailuresQuery = 'MCPToolFailuresQuery',MCPToolStatsQuery = 'MCPToolStatsQuery',MCPToolDailyStatsQuery = 'MCPToolDailyStatsQuery',+ MCPToolQualityRowsQuery = 'MCPToolQualityRowsQuery',+ MCPToolQualityDailyStatsQuery = 'MCPToolQualityDailyStatsQuery',+ MCPToolCategoryCountsQuery = 'MCPToolCategoryCountsQuery',+ MCPToolCategoriesQuery = 'MCPToolCategoriesQuery',MCPToolDescriptionsQuery = 'MCPToolDescriptionsQuery',MCPToolSampleIntentsQuery = 'MCPToolSampleIntentsQuery',MCPToolNeighborsQuery = 'MCPToolNeighborsQuery',@@ -277,6 +281,10 @@ export type AnyDataNode =| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -400,6 +408,10 @@ export type QuerySchema =| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -2802,6 +2814,98 @@ export interface MCPToolDailyStatsQuery extends DataNode<MCPToolDailyStatsQueryRexport type CachedMCPToolDailyStatsQueryResponse = CachedQueryResponse<MCPToolDailyStatsQueryResponse>+/** Per-tool quality metrics for the Tool quality tab table. */+export interface MCPToolQualityRowItem {+ tool: string+ total_calls: integer+ errors: integer+ error_rate_pct: number+ p50_duration_ms: number+ p95_duration_ms: number+ p99_duration_ms: number+ users: integer+ sessions: integer+ first_seen: string+ last_seen: string+}++export interface MCPToolQualityRowsQueryResponse extends AnalyticsQueryResponseBase {+ results: MCPToolQualityRowItem[]+}++/** One row per $mcp_tool_name — call volume, error rate, latency percentiles, and reach — over the window. */+export interface MCPToolQualityRowsQuery extends DataNode<MCPToolQualityRowsQueryResponse> {+ kind: NodeKind.MCPToolQualityRowsQuery+ dateRange?: DateRange+ /** Restrict to these $mcp_tool_category values; empty or omitted means all categories. */+ categories?: string[]+}++export type CachedMCPToolQualityRowsQueryResponse = CachedQueryResponse<MCPToolQualityRowsQueryResponse>++/** One bucket of aggregate activity across tools on the Tool quality tab. */+export interface MCPToolQualityDailyStatItem {+ day: string+ calls: integer+ errors: integer+ p50: number+ p95: number+ p99: number+}++export interface MCPToolQualityDailyStatsQueryResponse extends AnalyticsQueryResponseBase {+ results: MCPToolQualityDailyStatItem[]+}++/** Interval-bucketed activity series for the Tool quality tab (optionally scoped to one tool). */+export interface MCPToolQualityDailyStatsQuery extends DataNode<MCPToolQualityDailyStatsQueryResponse> {+ kind: NodeKind.MCPToolQualityDailyStatsQuery+ dateRange?: DateRange+ /** Bucket granularity; the frontend passes getDefaultInterval. Defaults to day. */+ interval?: IntervalType+ /** Restrict to these $mcp_tool_category values; empty or omitted means all categories. */+ categories?: string[]+ /** Restrict to a single $mcp_tool_name; omitted means the aggregate across all tools. */+ toolName?: string+}++export type CachedMCPToolQualityDailyStatsQueryResponse = CachedQueryResponse<MCPToolQualityDailyStatsQueryResponse>++/** Call count for one $mcp_tool_category, powering the tab's share-of-usage headline. */+export interface MCPToolCategoryCountItem {+ category: string+ calls: integer+}++export interface MCPToolCategoryCountsQueryResponse extends AnalyticsQueryResponseBase {+ results: MCPToolCategoryCountItem[]+}++/** Per-category call counts over the window (empty category = uncategorized traffic). */+export interface MCPToolCategoryCountsQuery extends DataNode<MCPToolCategoryCountsQueryResponse> {+ kind: NodeKind.MCPToolCategoryCountsQuery+ dateRange?: DateRange+}++export type CachedMCPToolCategoryCountsQueryResponse = CachedQueryResponse<MCPToolCategoryCountsQueryResponse>++/** One distinct $mcp_tool_category value seen in the window. */+export interface MCPToolCategoryItem {+ category: string+}++export interface MCPToolCategoriesQueryResponse extends AnalyticsQueryResponseBase {+ results: MCPToolCategoryItem[]+}++/** Distinct $mcp_tool_category values seen in the window, sorted — powers the scope selector. */+export interface MCPToolCategoriesQuery extends DataNode<MCPToolCategoriesQueryResponse> {+ kind: NodeKind.MCPToolCategoriesQuery+ dateRange?: DateRange+}++export type CachedMCPToolCategoriesQueryResponse = CachedQueryResponse<MCPToolCategoriesQueryResponse>+/** One distinct description seen for a single MCP tool, with the last time it was reported. */export interface MCPToolDescriptionItem {description: stringdiff --git a/frontend/src/scenes/saved-insights/SavedInsights.tsx b/frontend/src/scenes/saved-insights/SavedInsights.tsxindex f6aed8a2e637..2a23ff37a443 100644--- a/frontend/src/scenes/saved-insights/SavedInsights.tsx+++ b/frontend/src/scenes/saved-insights/SavedInsights.tsx@@ -687,6 +687,30 @@ export const QUERY_TYPES_METADATA: Record<NodeKind, InsightTypeMetadata> = {icon: IconPieChart,inMenu: false,},+ [NodeKind.MCPToolQualityRowsQuery]: {+ name: 'MCP tool quality rows',+ description: 'Per-tool quality metrics for the Tool quality tab.',+ icon: IconPieChart,+ inMenu: false,+ },+ [NodeKind.MCPToolQualityDailyStatsQuery]: {+ name: 'MCP tool quality daily stats',+ description: 'Interval-bucketed activity series for the Tool quality tab.',+ icon: IconPieChart,+ inMenu: false,+ },+ [NodeKind.MCPToolCategoryCountsQuery]: {+ name: 'MCP tool category counts',+ description: 'Per-category call counts for the Tool quality tab.',+ icon: IconPieChart,+ inMenu: false,+ },+ [NodeKind.MCPToolCategoriesQuery]: {+ name: 'MCP tool categories',+ description: 'Distinct tool categories for the Tool quality scope selector.',+ icon: IconPieChart,+ inMenu: false,+ },}export const INSIGHT_TYPES_METADATA: Record<InsightType, InsightTypeMetadata> = {diff --git a/posthog/clickhouse/query_tagging.py b/posthog/clickhouse/query_tagging.pyindex f94f3f56f202..e90dc66a3e11 100644--- a/posthog/clickhouse/query_tagging.py+++ b/posthog/clickhouse/query_tagging.py@@ -279,6 +279,10 @@ def kind_fallback_tags(kind: NodeKind) -> FallbackTags | None:| NodeKind.MCP_TOOL_FAILURES_QUERY| NodeKind.MCP_TOOL_STATS_QUERY| NodeKind.MCP_TOOL_DAILY_STATS_QUERY+ | NodeKind.MCP_TOOL_QUALITY_ROWS_QUERY+ | NodeKind.MCP_TOOL_QUALITY_DAILY_STATS_QUERY+ | NodeKind.MCP_TOOL_CATEGORY_COUNTS_QUERY+ | NodeKind.MCP_TOOL_CATEGORIES_QUERY| NodeKind.MCP_TOOL_DESCRIPTIONS_QUERY| NodeKind.MCP_TOOL_SAMPLE_INTENTS_QUERY| NodeKind.MCP_TOOL_NEIGHBORS_QUERYdiff --git a/posthog/hogql_queries/query_runner.py b/posthog/hogql_queries/query_runner.pyindex a41fe281475c..c90b8e45b8d7 100644--- a/posthog/hogql_queries/query_runner.py+++ b/posthog/hogql_queries/query_runner.py@@ -45,10 +45,14 @@ from posthog.schema import (MarketingAnalyticsAggregatedQuery,MarketingAnalyticsTableQuery,MCPHarnessBreakdownQuery,+ MCPToolCategoriesQuery,+ MCPToolCategoryCountsQuery,MCPToolDailyStatsQuery,MCPToolDescriptionsQuery,MCPToolFailuresQuery,MCPToolNeighborsQuery,+ MCPToolQualityDailyStatsQuery,+ MCPToolQualityRowsQuery,MCPToolSampleIntentsQuery,MCPToolStatsQuery,MCPToolTopUsersQuery,@@ -354,6 +358,10 @@ RunnableQueryNode = Union[MCPToolFailuresQuery,MCPToolStatsQuery,MCPToolDailyStatsQuery,+ MCPToolQualityRowsQuery,+ MCPToolQualityDailyStatsQuery,+ MCPToolCategoryCountsQuery,+ MCPToolCategoriesQuery,MCPToolDescriptionsQuery,MCPToolSampleIntentsQuery,MCPToolNeighborsQuery,@@ -1052,6 +1060,50 @@ def get_query_runner(modifiers=modifiers,user=user,)+ if kind == "MCPToolQualityRowsQuery":+ from products.mcp_analytics.backend.facade.queries import MCPToolQualityRowsQueryRunner++ return MCPToolQualityRowsQueryRunner(+ query=cast(MCPToolQualityRowsQuery | dict[str, Any], query),+ team=team,+ timings=timings,+ limit_context=limit_context,+ modifiers=modifiers,+ user=user,+ )+ if kind == "MCPToolQualityDailyStatsQuery":+ from products.mcp_analytics.backend.facade.queries import MCPToolQualityDailyStatsQueryRunner++ return MCPToolQualityDailyStatsQueryRunner(+ query=cast(MCPToolQualityDailyStatsQuery | dict[str, Any], query),+ team=team,+ timings=timings,+ limit_context=limit_context,+ modifiers=modifiers,+ user=user,+ )+ if kind == "MCPToolCategoryCountsQuery":+ from products.mcp_analytics.backend.facade.queries import MCPToolCategoryCountsQueryRunner++ return MCPToolCategoryCountsQueryRunner(+ query=cast(MCPToolCategoryCountsQuery | dict[str, Any], query),+ team=team,+ timings=timings,+ limit_context=limit_context,+ modifiers=modifiers,+ user=user,+ )+ if kind == "MCPToolCategoriesQuery":+ from products.mcp_analytics.backend.facade.queries import MCPToolCategoriesQueryRunner++ return MCPToolCategoriesQueryRunner(+ query=cast(MCPToolCategoriesQuery | dict[str, Any], query),+ team=team,+ timings=timings,+ limit_context=limit_context,+ modifiers=modifiers,+ user=user,+ )if kind == "MCPToolDescriptionsQuery":from products.mcp_analytics.backend.facade.queries import MCPToolDescriptionsQueryRunnerdiff --git a/posthog/schema.py b/posthog/schema.pyindex 60b7a75c0d9d..4c1b77822e7f 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -1597,6 +1597,13 @@ class LogAttributeResult(BaseModel):propertyFilterType: str = Field(..., description="Either 'log_attribute' or 'log_resource_attribute'.")+class MCPToolCategoryItem(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ category: str++class MCPToolDescriptionItem(BaseModel):model_config = ConfigDict(extra="forbid",@@ -5298,6 +5305,14 @@ class MCPHarnessBreakdownItem(BaseModel):total_calls: int+class MCPToolCategoryCountItem(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ calls: int+ category: str++class MCPToolDailyStatItem(BaseModel):model_config = ConfigDict(extra="forbid",@@ -5338,6 +5353,35 @@ class MCPToolNeighborItem(BaseModel):neighbor_tool: str+class MCPToolQualityDailyStatItem(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ calls: int+ day: str+ errors: int+ p50: float+ p95: float+ p99: float+++class MCPToolQualityRowItem(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error_rate_pct: float+ errors: int+ first_seen: str+ last_seen: str+ p50_duration_ms: float+ p95_duration_ms: float+ p99_duration_ms: float+ sessions: int+ tool: str+ total_calls: int+ users: int++class MCPToolStatsItem(BaseModel):model_config = ConfigDict(extra="forbid",@@ -10807,6 +10851,114 @@ class CachedMCPHarnessBreakdownQueryResponse(BaseModel):)+class CachedMCPToolCategoriesQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ cache_key: str+ cache_target_age: AwareDatetime | None = None+ calculation_trigger: str | None = Field(+ default=None,+ description=("What triggered the calculation of the query, leave empty if user/immediate"),+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ is_cached: bool+ last_refresh: AwareDatetime+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ next_allowed_client_refresh: AwareDatetime+ query_metadata: dict[str, Any] | None = None+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolCategoryItem]+ timezone: str+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class CachedMCPToolCategoryCountsQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ cache_key: str+ cache_target_age: AwareDatetime | None = None+ calculation_trigger: str | None = Field(+ default=None,+ description=("What triggered the calculation of the query, leave empty if user/immediate"),+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ is_cached: bool+ last_refresh: AwareDatetime+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ next_allowed_client_refresh: AwareDatetime+ query_metadata: dict[str, Any] | None = None+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolCategoryCountItem]+ timezone: str+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )++class CachedMCPToolDailyStatsQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",@@ -11023,6 +11175,114 @@ class CachedMCPToolNeighborsQueryResponse(BaseModel):)+class CachedMCPToolQualityDailyStatsQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ cache_key: str+ cache_target_age: AwareDatetime | None = None+ calculation_trigger: str | None = Field(+ default=None,+ description=("What triggered the calculation of the query, leave empty if user/immediate"),+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ is_cached: bool+ last_refresh: AwareDatetime+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ next_allowed_client_refresh: AwareDatetime+ query_metadata: dict[str, Any] | None = None+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolQualityDailyStatItem]+ timezone: str+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class CachedMCPToolQualityRowsQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ cache_key: str+ cache_target_age: AwareDatetime | None = None+ calculation_trigger: str | None = Field(+ default=None,+ description=("What triggered the calculation of the query, leave empty if user/immediate"),+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ is_cached: bool+ last_refresh: AwareDatetime+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ next_allowed_client_refresh: AwareDatetime+ query_metadata: dict[str, Any] | None = None+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolQualityRowItem]+ timezone: str+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )++class CachedMCPToolSampleIntentsQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",@@ -17122,7 +17382,7 @@ class MCPHarnessBreakdownQueryResponse(BaseModel):)-class MCPToolDailyStatsQueryResponse(BaseModel):+class MCPToolCategoriesQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",)@@ -17145,7 +17405,7 @@ class MCPToolDailyStatsQueryResponse(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolDailyStatItem]+ results: list[MCPToolCategoryItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -17165,7 +17425,7 @@ class MCPToolDailyStatsQueryResponse(BaseModel):)-class MCPToolDescriptionsQueryResponse(BaseModel):+class MCPToolCategoryCountsQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",)@@ -17188,7 +17448,7 @@ class MCPToolDescriptionsQueryResponse(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolDescriptionItem]+ results: list[MCPToolCategoryCountItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -17208,7 +17468,7 @@ class MCPToolDescriptionsQueryResponse(BaseModel):)-class MCPToolFailuresQueryResponse(BaseModel):+class MCPToolDailyStatsQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",)@@ -17231,7 +17491,7 @@ class MCPToolFailuresQueryResponse(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolFailureItem]+ results: list[MCPToolDailyStatItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -17251,7 +17511,7 @@ class MCPToolFailuresQueryResponse(BaseModel):)-class MCPToolNeighborsQueryResponse(BaseModel):+class MCPToolDescriptionsQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",)@@ -17274,7 +17534,7 @@ class MCPToolNeighborsQueryResponse(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolNeighborItem]+ results: list[MCPToolDescriptionItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -17294,7 +17554,7 @@ class MCPToolNeighborsQueryResponse(BaseModel):)-class MCPToolSampleIntentsQueryResponse(BaseModel):+class MCPToolFailuresQueryResponse(BaseModel):model_config = ConfigDict(extra="forbid",)@@ -17317,7 +17577,179 @@ class MCPToolSampleIntentsQueryResponse(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolSampleIntentItem]+ results: list[MCPToolFailureItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class MCPToolNeighborsQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolNeighborItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class MCPToolQualityDailyStatsQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolQualityDailyStatItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class MCPToolQualityRowsQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolQualityRowItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class MCPToolSampleIntentsQueryResponse(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolSampleIntentItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -21682,7 +22114,7 @@ class QueryResponseAlternative104(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolDescriptionItem]+ results: list[MCPToolQualityRowItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -21725,7 +22157,7 @@ class QueryResponseAlternative105(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolSampleIntentItem]+ results: list[MCPToolQualityDailyStatItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -21768,7 +22200,7 @@ class QueryResponseAlternative106(BaseModel):resolved_date_range: ResolvedDateRangeResponse | None = Field(default=None, description="The date range used for the query")- results: list[MCPToolNeighborItem]+ results: list[MCPToolCategoryCountItem]timings: list[QueryTiming] | None = Field(default=None,description=("Measured timings for different parts of the query generation process"),@@ -21789,6 +22221,178 @@ class QueryResponseAlternative106(BaseModel):class QueryResponseAlternative107(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolCategoryItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class QueryResponseAlternative108(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolDescriptionItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class QueryResponseAlternative109(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolSampleIntentItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class QueryResponseAlternative110(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ error: str | None = Field(+ default=None,+ description=(+ "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise."+ ),+ )+ hogql: str | None = Field(default=None, description="Generated HogQL query.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ query_status: QueryStatus | None = Field(+ default=None,+ description=("Query status indicates whether next to the provided data, a query is still running."),+ )+ resolved_compare_date_range: ResolvedDateRangeResponse | None = Field(+ default=None,+ description=("The resolved previous/comparison period date range, when comparing against another period"),+ )+ resolved_date_range: ResolvedDateRangeResponse | None = Field(+ default=None, description="The date range used for the query"+ )+ results: list[MCPToolNeighborItem]+ timings: list[QueryTiming] | None = Field(+ default=None,+ description=("Measured timings for different parts of the query generation process"),+ )+ warnings: list[DataWarehouseSyncWarning | AccessControlFilterWarning] | None = Field(+ default=None,+ description=(+ "Warnings about data warehouse sources referenced by the query whose"+ " latest sync failed, is paused, hit a billing limit, or is otherwise"+ " stale. Results may not reflect current source data. Accumulated"+ " across every HogQL execution that contributes to this response — so"+ " insights backed by warehouse tables (Trends, Funnels, etc.) receive"+ " the same warnings as raw HogQL queries. Also carries access control"+ " warnings when a system-table query filters out objects the user can't"+ " access."+ ),+ )+++class QueryResponseAlternative111(BaseModel):model_config = ConfigDict(extra="forbid",)@@ -24235,6 +24839,30 @@ class MCPHarnessBreakdownQuery(BaseModel):version: float | None = Field(default=None, description="version of the node, used for schema migrations")+class MCPToolCategoriesQuery(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ dateRange: DateRange | None = None+ kind: Literal["MCPToolCategoriesQuery"] = "MCPToolCategoriesQuery"+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ response: MCPToolCategoriesQueryResponse | None = None+ tags: QueryLogTags | None = None+ version: float | None = Field(default=None, description="version of the node, used for schema migrations")+++class MCPToolCategoryCountsQuery(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ dateRange: DateRange | None = None+ kind: Literal["MCPToolCategoryCountsQuery"] = "MCPToolCategoryCountsQuery"+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ response: MCPToolCategoryCountsQueryResponse | None = None+ tags: QueryLogTags | None = None+ version: float | None = Field(default=None, description="version of the node, used for schema migrations")++class MCPToolDailyStatsQuery(BaseModel):model_config = ConfigDict(extra="forbid",@@ -24311,6 +24939,46 @@ class MCPToolNeighborsQuery(BaseModel):version: float | None = Field(default=None, description="version of the node, used for schema migrations")+class MCPToolQualityDailyStatsQuery(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ categories: list[str] | None = Field(+ default=None,+ description=("Restrict to these $mcp_tool_category values; empty or omitted means all categories."),+ )+ dateRange: DateRange | None = None+ interval: IntervalType | None = Field(+ default=None,+ description=("Bucket granularity; the frontend passes getDefaultInterval. Defaults to day."),+ )+ kind: Literal["MCPToolQualityDailyStatsQuery"] = "MCPToolQualityDailyStatsQuery"+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ response: MCPToolQualityDailyStatsQueryResponse | None = None+ tags: QueryLogTags | None = None+ toolName: str | None = Field(+ default=None,+ description=("Restrict to a single $mcp_tool_name; omitted means the aggregate across all tools."),+ )+ version: float | None = Field(default=None, description="version of the node, used for schema migrations")+++class MCPToolQualityRowsQuery(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ categories: list[str] | None = Field(+ default=None,+ description=("Restrict to these $mcp_tool_category values; empty or omitted means all categories."),+ )+ dateRange: DateRange | None = None+ kind: Literal["MCPToolQualityRowsQuery"] = "MCPToolQualityRowsQuery"+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ response: MCPToolQualityRowsQueryResponse | None = None+ tags: QueryLogTags | None = None+ version: float | None = Field(default=None, description="version of the node, used for schema migrations")++class MCPToolSampleIntentsQuery(BaseModel):model_config = ConfigDict(extra="forbid",@@ -27102,6 +27770,10 @@ class QueryResponseAlternative(| QueryResponseAlternative105| QueryResponseAlternative106| QueryResponseAlternative107+ | QueryResponseAlternative108+ | QueryResponseAlternative109+ | QueryResponseAlternative110+ | QueryResponseAlternative111]):root: (@@ -27206,6 +27878,10 @@ class QueryResponseAlternative(| QueryResponseAlternative105| QueryResponseAlternative106| QueryResponseAlternative107+ | QueryResponseAlternative108+ | QueryResponseAlternative109+ | QueryResponseAlternative110+ | QueryResponseAlternative111)@@ -28328,6 +29004,10 @@ class HogQLAutocomplete(BaseModel):| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -28431,6 +29111,10 @@ class HogQLMetadata(BaseModel):| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -28566,6 +29250,10 @@ class MaxInsightContext(BaseModel):| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -28697,6 +29385,10 @@ class QueryRequest(BaseModel):| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -28820,6 +29512,10 @@ class QuerySchemaRoot(| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -28913,6 +29609,10 @@ class QuerySchemaRoot(| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -29011,6 +29711,10 @@ class QueryUpgradeRequest(BaseModel):| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -29109,6 +29813,10 @@ class QueryUpgradeResponse(BaseModel):| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery@@ -29389,6 +30097,10 @@ class VisualizationArtifactContent(BaseModel):| MCPToolFailuresQuery| MCPToolStatsQuery| MCPToolDailyStatsQuery+ | MCPToolQualityRowsQuery+ | MCPToolQualityDailyStatsQuery+ | MCPToolCategoryCountsQuery+ | MCPToolCategoriesQuery| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuerydiff --git a/posthog/schema_enums.py b/posthog/schema_enums.pyindex d775e2d13ed5..59364e5e6521 100644--- a/posthog/schema_enums.py+++ b/posthog/schema_enums.py@@ -2830,6 +2830,10 @@ class NodeKind(StrEnum):MCP_TOOL_FAILURES_QUERY = "MCPToolFailuresQuery"MCP_TOOL_STATS_QUERY = "MCPToolStatsQuery"MCP_TOOL_DAILY_STATS_QUERY = "MCPToolDailyStatsQuery"+ MCP_TOOL_QUALITY_ROWS_QUERY = "MCPToolQualityRowsQuery"+ MCP_TOOL_QUALITY_DAILY_STATS_QUERY = "MCPToolQualityDailyStatsQuery"+ MCP_TOOL_CATEGORY_COUNTS_QUERY = "MCPToolCategoryCountsQuery"+ MCP_TOOL_CATEGORIES_QUERY = "MCPToolCategoriesQuery"MCP_TOOL_DESCRIPTIONS_QUERY = "MCPToolDescriptionsQuery"MCP_TOOL_SAMPLE_INTENTS_QUERY = "MCPToolSampleIntentsQuery"MCP_TOOL_NEIGHBORS_QUERY = "MCPToolNeighborsQuery"diff --git a/products/mcp_analytics/backend/facade/queries.py b/products/mcp_analytics/backend/facade/queries.pyindex b9ad278b1270..c3802ac62479 100644--- a/products/mcp_analytics/backend/facade/queries.py+++ b/products/mcp_analytics/backend/facade/queries.py@@ -6,6 +6,12 @@ mcp_analytics is tach-isolated to expose only `backend.facade.*`, so core's"""from products.mcp_analytics.backend.hogql_queries.harness_breakdown import MCPHarnessBreakdownQueryRunner+from products.mcp_analytics.backend.hogql_queries.tool_quality_tables import (+ MCPToolCategoriesQueryRunner,+ MCPToolCategoryCountsQueryRunner,+ MCPToolQualityDailyStatsQueryRunner,+ MCPToolQualityRowsQueryRunner,+)from products.mcp_analytics.backend.hogql_queries.tool_tables import (MCPToolDailyStatsQueryRunner,MCPToolDescriptionsQueryRunner,@@ -18,10 +24,14 @@ from products.mcp_analytics.backend.hogql_queries.tool_tables import (__all__ = ["MCPHarnessBreakdownQueryRunner",+ "MCPToolCategoriesQueryRunner",+ "MCPToolCategoryCountsQueryRunner","MCPToolDailyStatsQueryRunner","MCPToolDescriptionsQueryRunner","MCPToolFailuresQueryRunner","MCPToolNeighborsQueryRunner",+ "MCPToolQualityDailyStatsQueryRunner",+ "MCPToolQualityRowsQueryRunner","MCPToolSampleIntentsQueryRunner","MCPToolStatsQueryRunner","MCPToolTopUsersQueryRunner",diff --git a/products/mcp_analytics/backend/hogql_queries/tool_quality_tables.py b/products/mcp_analytics/backend/hogql_queries/tool_quality_tables.pynew file mode 100644index 000000000000..9e7246e9cba1--- /dev/null+++ b/products/mcp_analytics/backend/hogql_queries/tool_quality_tables.py@@ -0,0 +1,356 @@+"""Query runners for the MCP analytics Tool quality tab.++The tab's per-tool table, aggregate activity series, and category share/counts.+Unlike the per-tool detail runners in `tool_tables.py`, these scope by the raw+`$mcp_tool_name` property (not the single-exec-resolved effective tool), matching+the tab's broad overview — the two surfaces intentionally query different populations.+"""++from functools import cached_property+from typing import TYPE_CHECKING++from posthog.schema import (+ CachedMCPToolCategoriesQueryResponse,+ CachedMCPToolCategoryCountsQueryResponse,+ CachedMCPToolQualityDailyStatsQueryResponse,+ CachedMCPToolQualityRowsQueryResponse,+ MCPToolCategoriesQuery,+ MCPToolCategoriesQueryResponse,+ MCPToolCategoryCountItem,+ MCPToolCategoryCountsQuery,+ MCPToolCategoryCountsQueryResponse,+ MCPToolCategoryItem,+ MCPToolQualityDailyStatItem,+ MCPToolQualityDailyStatsQuery,+ MCPToolQualityDailyStatsQueryResponse,+ MCPToolQualityRowItem,+ MCPToolQualityRowsQuery,+ MCPToolQualityRowsQueryResponse,+)++from posthog.hogql import ast+from posthog.hogql.parser import parse_expr, parse_select+from posthog.hogql.query import execute_hogql_query++from posthog.clickhouse.query_tagging import Feature, Product, tags_context+from posthog.hogql_queries.query_runner import AnalyticsQueryRunner+from posthog.hogql_queries.utils.query_date_range import QueryDateRange++from products.mcp_analytics.backend.constants import MCP_TOOL_CALL_EVENT+from products.mcp_analytics.backend.hogql_queries.base import mcp_query_date_range, validate_mcp_analytics_access++if TYPE_CHECKING:+ from posthog.models.user import User++# The tab scopes to $mcp_tool_call events that carry a tool name. Category and tool are event-supplied+# and bound as constants (never interpolated).+_P50 = "round(quantile(0.5)(toFloat(properties.$mcp_duration_ms)))"+_P95 = "round(quantile(0.95)(toFloat(properties.$mcp_duration_ms)))"+_P99 = "round(quantile(0.99)(toFloat(properties.$mcp_duration_ms)))"+_IS_ERROR = "countIf(toBool(properties.$mcp_is_error))"+++def _category_in(categories: list[str] | None) -> list[ast.Expr]:+ """Optional `$mcp_tool_category IN (...)` predicate, values bound as constants."""+ if not categories:+ return []+ return [+ parse_expr(+ "properties.$mcp_tool_category IN {categories}",+ placeholders={"categories": ast.Tuple(exprs=[ast.Constant(value=c) for c in categories])},+ )+ ]+++def _named_tool_where(+ date_range: QueryDateRange,+ categories: list[str] | None,+ *,+ tool_name: str | None = None,+) -> ast.Expr:+ """WHERE for tool-name-bearing $mcp_tool_call events in the window, filtered by category/tool."""+ exprs: list[ast.Expr] = [+ parse_expr("event = {event}", placeholders={"event": ast.Constant(value=MCP_TOOL_CALL_EVENT)}),+ parse_expr("timestamp >= {date_from}", placeholders={"date_from": date_range.date_from_as_hogql()}),+ parse_expr("timestamp <= {date_to}", placeholders={"date_to": date_range.date_to_as_hogql()}),+ parse_expr("properties.$mcp_tool_name IS NOT NULL"),+ parse_expr("properties.$mcp_tool_name != ''"),+ *_category_in(categories),+ ]+ if tool_name:+ exprs.append(+ parse_expr("properties.$mcp_tool_name = {tool}", placeholders={"tool": ast.Constant(value=tool_name)})+ )+ return ast.And(exprs=exprs)+++class MCPToolQualityRowsQueryRunner(AnalyticsQueryRunner[MCPToolQualityRowsQueryResponse]):+ query: MCPToolQualityRowsQuery+ cached_response: CachedMCPToolQualityRowsQueryResponse++ def validate_query_runner_access(self, user: "User") -> bool:+ return validate_mcp_analytics_access(self.team, user)++ @cached_property+ def query_date_range(self) -> QueryDateRange:+ return mcp_query_date_range(self.team, self.query.dateRange)++ def to_query(self) -> ast.SelectQuery | ast.SelectSetQuery:+ return parse_select(+ """+ SELECT+ toString(properties.$mcp_tool_name) AS tool,+ count() AS total_calls,+ {_IS_ERROR} AS errors,+ round({_IS_ERROR} * 100.0 / count(), 1) AS error_rate_pct,+ {_P50} AS p50_duration_ms,+ {_P95} AS p95_duration_ms,+ {_P99} AS p99_duration_ms,+ uniq(distinct_id) AS users,+ countDistinctIf(toString(properties.$session_id), toString(properties.$session_id) != '') AS sessions,+ min(timestamp) AS first_seen,+ max(timestamp) AS last_seen+ FROM events+ WHERE {where}+ GROUP BY tool+ ORDER BY total_calls DESC+ LIMIT 200+ """,+ placeholders={+ "_IS_ERROR": parse_expr(_IS_ERROR),+ "_P50": parse_expr(_P50),+ "_P95": parse_expr(_P95),+ "_P99": parse_expr(_P99),+ "where": _named_tool_where(self.query_date_range, self.query.categories),+ },+ )++ def _calculate(self) -> MCPToolQualityRowsQueryResponse:+ with tags_context(+ product=Product.MCP_ANALYTICS,+ feature=Feature.QUERY,+ team_id=self.team.id,+ name="mcp_tool_quality_rows_query",+ ):+ response = execute_hogql_query(+ query=self.to_query(),+ team=self.team,+ user=self.user,+ query_type="mcp_tool_quality_rows_query",+ timings=self.timings,+ modifiers=self.modifiers,+ limit_context=self.limit_context,+ )++ results = [+ MCPToolQualityRowItem(+ tool=str(row[0] or ""),+ total_calls=int(row[1] or 0),+ errors=int(row[2] or 0),+ error_rate_pct=float(row[3] or 0),+ p50_duration_ms=float(row[4] or 0),+ p95_duration_ms=float(row[5] or 0),+ p99_duration_ms=float(row[6] or 0),+ users=int(row[7] or 0),+ sessions=int(row[8] or 0),+ first_seen=str(row[9] or ""),+ last_seen=str(row[10] or ""),+ )+ for row in (response.results or [])+ ]+ return MCPToolQualityRowsQueryResponse(+ results=results, timings=response.timings, hogql=response.hogql, modifiers=self.modifiers+ )+++class MCPToolQualityDailyStatsQueryRunner(AnalyticsQueryRunner[MCPToolQualityDailyStatsQueryResponse]):+ query: MCPToolQualityDailyStatsQuery+ cached_response: CachedMCPToolQualityDailyStatsQueryResponse++ def validate_query_runner_access(self, user: "User") -> bool:+ return validate_mcp_analytics_access(self.team, user)++ @cached_property+ def query_date_range(self) -> QueryDateRange:+ return mcp_query_date_range(self.team, self.query.dateRange)++ def to_query(self) -> ast.SelectQuery | ast.SelectSetQuery:+ # Bucket granularity comes from the frontend's getDefaultInterval so a sub-day window buckets+ # by hour/minute; dateTrunc respects the team timezone so buckets line up with the axis keys.+ # Explicit generous LIMIT so a fine interval over a wide window isn't silently cut to the+ # default 100 rows (which, with ORDER BY day ASC, would drop the most recent buckets).+ interval = self.query.interval.value if self.query.interval else "day"+ return parse_select(+ """+ SELECT+ toString(dateTrunc({interval}, timestamp)) AS day,+ count() AS calls,+ {_IS_ERROR} AS errors,+ {_P50} AS p50,+ {_P95} AS p95,+ {_P99} AS p99+ FROM events+ WHERE {where}+ GROUP BY day+ ORDER BY day+ LIMIT 10000+ """,+ placeholders={+ "interval": ast.Constant(value=interval),+ "_IS_ERROR": parse_expr(_IS_ERROR),+ "_P50": parse_expr(_P50),+ "_P95": parse_expr(_P95),+ "_P99": parse_expr(_P99),+ "where": _named_tool_where(self.query_date_range, self.query.categories, tool_name=self.query.toolName),+ },+ )++ def _calculate(self) -> MCPToolQualityDailyStatsQueryResponse:+ with tags_context(+ product=Product.MCP_ANALYTICS,+ feature=Feature.QUERY,+ team_id=self.team.id,+ name="mcp_tool_quality_daily_stats_query",+ ):+ response = execute_hogql_query(+ query=self.to_query(),+ team=self.team,+ user=self.user,+ query_type="mcp_tool_quality_daily_stats_query",+ timings=self.timings,+ modifiers=self.modifiers,+ limit_context=self.limit_context,+ )++ results = [+ MCPToolQualityDailyStatItem(+ day=str(row[0] or ""),+ calls=int(row[1] or 0),+ errors=int(row[2] or 0),+ p50=float(row[3] or 0),+ p95=float(row[4] or 0),+ p99=float(row[5] or 0),+ )+ for row in (response.results or [])+ ]+ return MCPToolQualityDailyStatsQueryResponse(+ results=results, timings=response.timings, hogql=response.hogql, modifiers=self.modifiers+ )+++class MCPToolCategoryCountsQueryRunner(AnalyticsQueryRunner[MCPToolCategoryCountsQueryResponse]):+ query: MCPToolCategoryCountsQuery+ cached_response: CachedMCPToolCategoryCountsQueryResponse++ def validate_query_runner_access(self, user: "User") -> bool:+ return validate_mcp_analytics_access(self.team, user)++ @cached_property+ def query_date_range(self) -> QueryDateRange:+ return mcp_query_date_range(self.team, self.query.dateRange)++ def to_query(self) -> ast.SelectQuery | ast.SelectSetQuery:+ # Counts every call (uncategorized included) so the share-of-usage denominator is complete.+ where = ast.And(+ exprs=[+ parse_expr("event = {event}", placeholders={"event": ast.Constant(value=MCP_TOOL_CALL_EVENT)}),+ parse_expr(+ "timestamp >= {date_from}", placeholders={"date_from": self.query_date_range.date_from_as_hogql()}+ ),+ parse_expr(+ "timestamp <= {date_to}", placeholders={"date_to": self.query_date_range.date_to_as_hogql()}+ ),+ ]+ )+ return parse_select(+ """+ SELECT toString(properties.$mcp_tool_category) AS category, count() AS calls+ FROM events+ WHERE {where}+ GROUP BY category+ """,+ placeholders={"where": where},+ )++ def _calculate(self) -> MCPToolCategoryCountsQueryResponse:+ with tags_context(+ product=Product.MCP_ANALYTICS,+ feature=Feature.QUERY,+ team_id=self.team.id,+ name="mcp_tool_category_counts_query",+ ):+ response = execute_hogql_query(+ query=self.to_query(),+ team=self.team,+ user=self.user,+ query_type="mcp_tool_category_counts_query",+ timings=self.timings,+ modifiers=self.modifiers,+ limit_context=self.limit_context,+ )++ results = [+ MCPToolCategoryCountItem(category=str(row[0] or ""), calls=int(row[1] or 0))+ for row in (response.results or [])+ ]+ return MCPToolCategoryCountsQueryResponse(+ results=results, timings=response.timings, hogql=response.hogql, modifiers=self.modifiers+ )+++class MCPToolCategoriesQueryRunner(AnalyticsQueryRunner[MCPToolCategoriesQueryResponse]):+ query: MCPToolCategoriesQuery+ cached_response: CachedMCPToolCategoriesQueryResponse++ def validate_query_runner_access(self, user: "User") -> bool:+ return validate_mcp_analytics_access(self.team, user)++ @cached_property+ def query_date_range(self) -> QueryDateRange:+ return mcp_query_date_range(self.team, self.query.dateRange)++ def to_query(self) -> ast.SelectQuery | ast.SelectSetQuery:+ where = ast.And(+ exprs=[+ parse_expr("event = {event}", placeholders={"event": ast.Constant(value=MCP_TOOL_CALL_EVENT)}),+ parse_expr(+ "timestamp >= {date_from}", placeholders={"date_from": self.query_date_range.date_from_as_hogql()}+ ),+ parse_expr(+ "timestamp <= {date_to}", placeholders={"date_to": self.query_date_range.date_to_as_hogql()}+ ),+ parse_expr("properties.$mcp_tool_category IS NOT NULL"),+ parse_expr("properties.$mcp_tool_category != ''"),+ ]+ )+ return parse_select(+ """+ SELECT DISTINCT toString(properties.$mcp_tool_category) AS category+ FROM events+ WHERE {where}+ ORDER BY category+ """,+ placeholders={"where": where},+ )++ def _calculate(self) -> MCPToolCategoriesQueryResponse:+ with tags_context(+ product=Product.MCP_ANALYTICS,+ feature=Feature.QUERY,+ team_id=self.team.id,+ name="mcp_tool_categories_query",+ ):+ response = execute_hogql_query(+ query=self.to_query(),+ team=self.team,+ user=self.user,+ query_type="mcp_tool_categories_query",+ timings=self.timings,+ modifiers=self.modifiers,+ limit_context=self.limit_context,+ )++ results = [MCPToolCategoryItem(category=str(row[0] or "")) for row in (response.results or []) if row[0]]+ return MCPToolCategoriesQueryResponse(+ results=results, timings=response.timings, hogql=response.hogql, modifiers=self.modifiers+ )diff --git a/products/mcp_analytics/backend/templates/tool_quality.sql b/products/mcp_analytics/backend/templates/tool_quality.sqldeleted file mode 100644index cff849f6cb4b..000000000000--- a/products/mcp_analytics/backend/templates/tool_quality.sql+++ /dev/null@@ -1,33 +0,0 @@-/*--- Per-tool quality metrics for the MCP analytics Tool quality tab.--- One row per $mcp_tool_name with call volume, error rate, latency percentiles,--- and reach (unique users / sessions / first / last seen).------ Source events: `$mcp_tool_call`, emitted by the MCP analytics SDK on every--- tool invocation. Expected properties:--- $mcp_tool_name string--- $mcp_is_error boolean--- $mcp_duration_ms number (milliseconds)--- $session_id string-*/--SELECT- properties.$mcp_tool_name AS tool,- count() AS total_calls,- countIf(toBool(properties.$mcp_is_error)) AS errors,- round(countIf(toBool(properties.$mcp_is_error)) * 100.0 / count(), 1) AS error_rate_pct,- round(quantile(0.5)(toFloat(properties.$mcp_duration_ms))) AS p50_duration_ms,- round(quantile(0.95)(toFloat(properties.$mcp_duration_ms))) AS p95_duration_ms,- round(quantile(0.99)(toFloat(properties.$mcp_duration_ms))) AS p99_duration_ms,- uniq(distinct_id) AS users,- countDistinctIf(properties.$session_id, properties.$session_id != '') AS sessions,- min(timestamp) AS first_seen,- max(timestamp) AS last_seen-FROM events-WHERE event = '$mcp_tool_call'- AND properties.$mcp_tool_name IS NOT NULL- AND properties.$mcp_tool_name != ''- AND {filters}-GROUP BY tool-ORDER BY __ORDER_BY__ __ORDER_DIRECTION__-LIMIT 200diff --git a/products/mcp_analytics/backend/tests/test_tool_quality_sql.py b/products/mcp_analytics/backend/tests/test_tool_quality_sql.pydeleted file mode 100644index a5d5d1b51a22..000000000000--- a/products/mcp_analytics/backend/tests/test_tool_quality_sql.py+++ /dev/null@@ -1,44 +0,0 @@-from pathlib import Path--TEMPLATES_DIR = Path(__file__).resolve().parents[1] / "templates"-TOOL_QUALITY_SQL_PATH = TEMPLATES_DIR / "tool_quality.sql"---def test_tool_quality_sql_exists() -> None:- assert TOOL_QUALITY_SQL_PATH.is_file()---def test_tool_quality_sql_contains_required_columns() -> None:- sql = TOOL_QUALITY_SQL_PATH.read_text()-- # Aliased output columns the frontend table relies on.- for column in (- "tool",- "total_calls",- "error_rate_pct",- "p50_duration_ms",- "p95_duration_ms",- "p99_duration_ms",- "users",- "sessions",- "first_seen",- "last_seen",- ):- assert f" {column}" in sql, f"missing column alias '{column}' in tool_quality.sql"---def test_tool_quality_sql_supports_filters_and_sort_placeholders() -> None:- sql = TOOL_QUALITY_SQL_PATH.read_text()-- # The HogQL engine resolves {filters} from the wrapping HogQLQuery node.- assert "{filters}" in sql- # The frontend logic does .replace() on these markers before sending the query.- assert "__ORDER_BY__" in sql- assert "__ORDER_DIRECTION__" in sql---def test_tool_quality_sql_targets_canonical_mcp_tool_call_event() -> None:- sql = TOOL_QUALITY_SQL_PATH.read_text()-- assert "event = '$mcp_tool_call'" in sql- assert "$mcp_tool_name" in sqldiff --git a/products/mcp_analytics/backend/tests/test_tool_quality_tables.py b/products/mcp_analytics/backend/tests/test_tool_quality_tables.pynew file mode 100644index 000000000000..833eca830819--- /dev/null+++ b/products/mcp_analytics/backend/tests/test_tool_quality_tables.py@@ -0,0 +1,174 @@+from datetime import UTC, datetime, timedelta+from typing import Any++from posthog.test.base import APIBaseTest, ClickhouseTestMixin, _create_event, flush_persons_and_events+from unittest.mock import patch++from parameterized import parameterized++from posthog.schema import (+ DateRange,+ IntervalType,+ MCPToolCategoriesQuery,+ MCPToolCategoryCountsQuery,+ MCPToolQualityDailyStatsQuery,+ MCPToolQualityRowsQuery,+)++from posthog.rbac.user_access_control import UserAccessControlError++from products.mcp_analytics.backend.hogql_queries.tool_quality_tables import (+ MCPToolCategoriesQueryRunner,+ MCPToolCategoryCountsQueryRunner,+ MCPToolQualityDailyStatsQueryRunner,+ MCPToolQualityRowsQueryRunner,+)+from products.mcp_analytics.backend.tests import _MCPAnalyticsTeamScopedTestMixin++NEW_SDK_SOURCE = "posthog_mcp_analytics"+++def _emit(+ team: Any,+ *,+ tool_name: str = "query_run",+ category: str | None = None,+ is_error: bool = False,+ duration_ms: float = 100,+ session_id: str = "s1",+ distinct_id: str = "d1",+ timestamp: datetime | None = None,+) -> None:+ properties: dict[str, Any] = {+ "$mcp_tool_name": tool_name,+ "$mcp_source": NEW_SDK_SOURCE,+ "$mcp_is_error": is_error,+ "$mcp_duration_ms": duration_ms,+ "$session_id": session_id,+ }+ if category is not None:+ properties["$mcp_tool_category"] = category+ _create_event(+ team=team,+ event="$mcp_tool_call",+ distinct_id=distinct_id,+ timestamp=timestamp or datetime.now(tz=UTC),+ properties=properties,+ )+++class TestMCPToolQualityRowsQueryRunner(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTestMixin, APIBaseTest):+ def _run(self, categories: list[str] | None = None) -> list[Any]:+ runner = MCPToolQualityRowsQueryRunner(+ query=MCPToolQualityRowsQuery(dateRange=DateRange(date_from="-7d"), categories=categories),+ team=self.team,+ )+ return runner.calculate().results++ def test_one_row_per_tool_ordered_by_calls_with_error_rate(self) -> None:+ _emit(self.team, tool_name="query_run", is_error=False)+ _emit(self.team, tool_name="query_run", is_error=True)+ _emit(self.team, tool_name="insight_get", is_error=False)+ flush_persons_and_events()++ rows = self._run()++ assert [r.tool for r in rows] == ["query_run", "insight_get"]+ assert rows[0].total_calls == 2+ assert rows[0].errors == 1+ assert rows[0].error_rate_pct == 50.0++ def test_category_filter_narrows_the_rows(self) -> None:+ _emit(self.team, tool_name="query_run", category="Data")+ _emit(self.team, tool_name="insight_get", category="Insights")+ flush_persons_and_events()++ rows = self._run(categories=["Data"])++ assert [r.tool for r in rows] == ["query_run"]+++class TestMCPToolQualityDailyStatsQueryRunner(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTestMixin, APIBaseTest):+ def test_buckets_by_hour_when_interval_is_hour(self) -> None:+ now = datetime.now(tz=UTC)+ _emit(self.team, timestamp=now - timedelta(hours=1, minutes=30))+ _emit(self.team, timestamp=now - timedelta(minutes=5))+ flush_persons_and_events()++ runner = MCPToolQualityDailyStatsQueryRunner(+ query=MCPToolQualityDailyStatsQuery(dateRange=DateRange(date_from="-6h"), interval=IntervalType.HOUR),+ team=self.team,+ )+ rows = runner.calculate().results++ assert len(rows) == 2+ assert rows[0].day < rows[1].day++ def test_tool_name_scopes_the_series(self) -> None:+ _emit(self.team, tool_name="query_run")+ _emit(self.team, tool_name="insight_get")+ flush_persons_and_events()++ runner = MCPToolQualityDailyStatsQueryRunner(+ query=MCPToolQualityDailyStatsQuery(dateRange=DateRange(date_from="-7d"), toolName="query_run"),+ team=self.team,+ )+ rows = runner.calculate().results++ assert sum(r.calls for r in rows) == 1+++class TestMCPToolCategoryCountsQueryRunner(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTestMixin, APIBaseTest):+ def test_counts_per_category_including_uncategorized(self) -> None:+ _emit(self.team, category="Data")+ _emit(self.team, category="Data")+ _emit(self.team, category=None) # uncategorized still counts toward the denominator+ flush_persons_and_events()++ runner = MCPToolCategoryCountsQueryRunner(+ query=MCPToolCategoryCountsQuery(dateRange=DateRange(date_from="-7d")),+ team=self.team,+ )+ counts = {r.category: r.calls for r in runner.calculate().results}++ assert counts["Data"] == 2+ assert sum(counts.values()) == 3+++class TestMCPToolCategoriesQueryRunner(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTestMixin, APIBaseTest):+ def test_distinct_sorted_categories_excludes_empty(self) -> None:+ _emit(self.team, category="Insights")+ _emit(self.team, category="Data")+ _emit(self.team, category="Data")+ _emit(self.team, category=None)+ flush_persons_and_events()++ runner = MCPToolCategoriesQueryRunner(+ query=MCPToolCategoriesQuery(dateRange=DateRange(date_from="-7d")),+ team=self.team,+ )+ categories = [r.category for r in runner.calculate().results]++ assert categories == ["Data", "Insights"]+++class TestMCPToolQualityGate(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTestMixin, APIBaseTest):+ # The whole point of the migration: each kind gates on `mcp-analytics`, so the generic /query/+ # endpoint can't reach it without the flag. Every other test here calls calculate() with the flag+ # already on, so a runner that lost its validate_query_runner_access override would stay green.+ @parameterized.expand(+ [+ (MCPToolQualityRowsQueryRunner, MCPToolQualityRowsQuery()),+ (MCPToolQualityDailyStatsQueryRunner, MCPToolQualityDailyStatsQuery()),+ (MCPToolCategoryCountsQueryRunner, MCPToolCategoryCountsQuery()),+ (MCPToolCategoriesQueryRunner, MCPToolCategoriesQuery()),+ ]+ )+ def test_runner_gates_on_mcp_analytics_flag(self, runner_cls: Any, query: Any) -> None:+ runner = runner_cls(query=query, team=self.team, user=self.user)++ assert runner.validate_query_runner_access(self.user) is True++ with patch("posthoganalytics.feature_enabled", return_value=False):+ with self.assertRaises(UserAccessControlError):+ runner.validate_query_runner_access(self.user)diff --git a/products/mcp_analytics/frontend/MCPAnalyticsDashboard.stories.tsx b/products/mcp_analytics/frontend/MCPAnalyticsDashboard.stories.tsxindex 958f39f4616f..0b1290acec89 100644--- a/products/mcp_analytics/frontend/MCPAnalyticsDashboard.stories.tsx+++ b/products/mcp_analytics/frontend/MCPAnalyticsDashboard.stories.tsx@@ -341,6 +341,48 @@ const meta: Meta = {if (body?.query?.kind === 'MCPHarnessBreakdownQuery') {return [200, { results: HARNESS_RESULTS }]}+ // Tool quality tab runners return typed item rows — match on kind, not a SQL string.+ if (body?.query?.kind === 'MCPToolQualityRowsQuery') {+ return [+ 200,+ {+ results: TOOL_QUALITY_ROWS.map((r) => ({+ tool: r[0],+ total_calls: r[1],+ errors: r[2],+ error_rate_pct: r[3],+ p50_duration_ms: r[4],+ p95_duration_ms: r[5],+ p99_duration_ms: r[6],+ users: r[7],+ sessions: r[8],+ first_seen: r[9],+ last_seen: r[10],+ })),+ },+ ]+ }+ if (body?.query?.kind === 'MCPToolQualityDailyStatsQuery') {+ return [+ 200,+ {+ results: DAILY_STATS.map((r) => ({+ day: r[0],+ calls: r[1],+ errors: r[2],+ p50: r[3],+ p95: r[4],+ p99: r[5],+ })),+ },+ ]+ }+ if (body?.query?.kind === 'MCPToolCategoriesQuery') {+ return [200, { results: CATEGORY_LIST.map((r) => ({ category: r[0] })) }]+ }+ if (body?.query?.kind === 'MCPToolCategoryCountsQuery') {+ return [200, { results: CATEGORY_COUNTS.map((r) => ({ category: r[0], calls: r[1] })) }]+ }// Onboarding gate: report the project as instrumented so the scene// renders the dashboard/tabs instead of the empty state.if (query.includes('has_initialize')) {@@ -349,22 +391,6 @@ const meta: Meta = {if (query.includes('AS session_id')) {return [200, { results: SESSION_RESULTS }]}- // Tool quality tab queries — checked before the dashboard's- // p95 tool table so the more specific markers win. The daily series- // buckets by dateTrunc at the active interval; `AS day,` + the p99- // quantile uniquely identify it (the per-tool table has neither).- if (query.includes('quantile(0.99)') && query.includes('AS day,')) {- return [200, { results: DAILY_STATS }]- }- if (query.includes('p99_duration_ms')) {- return [200, { results: TOOL_QUALITY_ROWS }]- }- if (query.includes('DISTINCT') && query.includes('AS category')) {- return [200, { results: CATEGORY_LIST }]- }- if (query.includes('count() AS calls') && query.includes('GROUP BY category')) {- return [200, { results: CATEGORY_COUNTS }]- }if (query.includes('AS successes')) {return [200, { results: ACTIVITY_RESULTS }]}diff --git a/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.test.ts b/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.test.tsindex d3d3cb3ef822..91bc5f355872 100644--- a/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.test.ts+++ b/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.test.ts@@ -78,7 +78,7 @@ describe('mcpAnalyticsToolQualityLogic', () => {jest.spyOn(mockApi, 'query').mockResolvedValue({ results: [] })})- function queryCallsSince(callIndex: number): { query: string; filters: Record<string, any> }[] {+ function queryCallsSince(callIndex: number): Record<string, any>[] {return mockApi.query.mock.calls.slice(callIndex).map((call) => call[0] as any)}@@ -95,14 +95,14 @@ describe('mcpAnalyticsToolQualityLogic', () => {const newCalls = queryCallsSince(callsBefore)expect(newCalls.length).toBe(3) // tool rows + daily stats + category counts// The scope-share headline must track the same window as the rest of the tab.- expect(newCalls.map((call) => call.filters.dateRange)).toEqual([+ expect(newCalls.map((call) => call.dateRange)).toEqual([{ date_from: '-30d', date_to: null },{ date_from: '-30d', date_to: null },{ date_from: '-30d', date_to: null },])})- it('reloads daily stats with the tool as a property filter when a tool is selected', async () => {+ it('reloads daily stats scoped to the tool when one is selected, passing it as a typed param', async () => {const logic = mcpAnalyticsToolQualityLogic()logic.mount()await expectLogic(logic).toFinishAllListeners()@@ -114,20 +114,25 @@ describe('mcpAnalyticsToolQualityLogic', () => {const newCalls = queryCallsSince(callsBefore)expect(newCalls.length).toBe(1) // daily stats only- expect(newCalls[0].filters.properties).toEqual([- expect.objectContaining({- key: '$mcp_tool_name',- value: ["evil'); DROP TABLE events; --"],- operator: 'exact',- type: 'event',- }),- ])- // The tool value must never be interpolated into the HogQL string.- expect(newCalls[0].query).not.toContain('DROP TABLE')+ // The tool rides as a typed toolName param (the runner binds it as a constant), never as raw SQL.+ expect(newCalls[0].toolName).toBe("evil'); DROP TABLE events; --")+ expect(newCalls[0].query).toBeUndefined()})- // Tool-quality row tuple as returned by the query (tool, calls, errors, then unused cols)- const toolRowResult = (tool: string): unknown[] => [tool, 1, 0, 0, 0, 0, 0, 0, 0, '', '']+ // Tool-quality row item as returned by the runner.+ const toolRowResult = (tool: string): Record<string, unknown> => ({+ tool,+ total_calls: 1,+ errors: 0,+ error_rate_pct: 0,+ p50_duration_ms: 0,+ p95_duration_ms: 0,+ p99_duration_ms: 0,+ users: 0,+ sessions: 0,+ first_seen: '',+ last_seen: '',+ })it('clears the selected tool when a reload no longer includes it', async () => {mockApi.query.mockResolvedValue({ results: [toolRowResult('tool_a')] })diff --git a/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.ts b/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.tsindex c73e3a06c65d..c11241801df8 100644--- a/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.ts+++ b/products/mcp_analytics/frontend/mcpAnalyticsToolQualityLogic.ts@@ -7,41 +7,17 @@ import { dateFilterToText, getDefaultInterval } from 'lib/utils/dateFilters'import { teamLogic } from 'scenes/teamLogic'import { urls } from 'scenes/urls'-import { hogqlQuery } from '~/queries/query'-import { HogQLQueryResponse, NodeKind } from '~/queries/schema/schema-general'-import { hogql } from '~/queries/utils'-import { type AnyPropertyFilter, IntervalType, PropertyFilterType, PropertyOperator } from '~/types'+import {+ MCPToolCategoryCountItem,+ MCPToolCategoryItem,+ MCPToolQualityDailyStatItem,+ MCPToolQualityRowItem,+ NodeKind,+} from '~/queries/schema/schema-general'+import { IntervalType } from '~/types'-import toolQualityQueryTemplate from '../backend/templates/tool_quality.sql?raw'import { buildBucketKeys, normalizeBucket } from './timeBuckets'-// `$mcp_tool_category` is stamped onto every $mcp_tool_call event by the producer-// (PostHog's MCP server from its catalog; external servers via the SDK). We read-// the available categories straight from the data so the scope selector works for-// any project's taxonomy without a hardcoded tool→category map.-const CATEGORIES_QUERY = hogql`-SELECT DISTINCT toString(properties.$mcp_tool_category) AS category-FROM events-WHERE event = '$mcp_tool_call'- AND timestamp >= now() - INTERVAL 30 DAY- AND properties.$mcp_tool_category IS NOT NULL- AND properties.$mcp_tool_category != ''-ORDER BY category-`--// Per-category call counts over the selected window, powering the "share of MCP-// usage" headline. Rows with an empty category count toward the total but not the-// in-scope numerator, so uncategorized traffic dilutes the share as expected. The-// date range rides in via the {filters} placeholder so the headline tracks the-// same window as the rest of the tab.-const CATEGORY_COUNTS_QUERY = `-SELECT toString(properties.$mcp_tool_category) AS category, count() AS calls-FROM events-WHERE event = '$mcp_tool_call'- AND {filters}-GROUP BY category-`-export interface CategoryCount {category: stringcalls: number@@ -164,7 +140,6 @@ export interface mcpAnalyticsToolQualityLogicValues {availableCategoriesLoading: booleancategoryCounts: CategoryCount[]categoryCountsLoading: boolean- categoryProperties: AnyPropertyFilter[]dailyChartData: DailyChartDatadailyStats: DailyToolStat[]dailyStatsLoading: boolean@@ -274,7 +249,6 @@ export interface mcpAnalyticsToolQualityLogicActions {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface mcpAnalyticsToolQualityLogicMeta {__keaTypeGenInternalSelectorTypes: {- categoryProperties: (selectedCategories: string[]) => AnyPropertyFilter[]dateRangeLabel: (dateFilter: DateFilter) => stringinterval: (dateFilter: DateFilter) => IntervalTypescopeShare: (categoryCounts: CategoryCount[], selectedCategories: string[]) => ScopeShare@@ -345,8 +319,12 @@ export const mcpAnalyticsToolQualityLogic = kea<mcpAnalyticsToolQualityLogicType[] as string[],{loadAvailableCategories: async (): Promise<string[]> => {- const response = await hogqlQuery(CATEGORIES_QUERY)- return ((response?.results as unknown[][]) ?? []).map((r) => String(r[0] ?? '')).filter(Boolean)+ // Fixed 30-day window so the scope selector lists every category regardless of the tab filter.+ const response = (await api.query({+ kind: NodeKind.MCPToolCategoriesQuery,+ dateRange: { date_from: '-30d' },+ })) as { results?: MCPToolCategoryItem[] }+ return (response.results ?? []).map((r) => r.category).filter(Boolean)},},],@@ -355,19 +333,10 @@ export const mcpAnalyticsToolQualityLogic = kea<mcpAnalyticsToolQualityLogicType{loadCategoryCounts: async (): Promise<CategoryCount[]> => {const response = (await api.query({- kind: NodeKind.HogQLQuery,- query: CATEGORY_COUNTS_QUERY,- filters: {- dateRange: {- date_from: values.dateFilter.dateFrom,- date_to: values.dateFilter.dateTo,- },- },- })) as HogQLQueryResponse- return ((response.results as unknown[][]) ?? []).map((r) => ({- category: String(r[0] ?? ''),- calls: Number(r[1] ?? 0),- }))+ kind: NodeKind.MCPToolCategoryCountsQuery,+ dateRange: { date_from: values.dateFilter.dateFrom, date_to: values.dateFilter.dateTo },+ })) as { results?: MCPToolCategoryCountItem[] }+ return (response.results ?? []).map((r) => ({ category: r.category, calls: r.calls }))},},],@@ -376,34 +345,25 @@ export const mcpAnalyticsToolQualityLogic = kea<mcpAnalyticsToolQualityLogicType{loadToolRows: async (_: void, breakpoint): Promise<ToolQualityRow[]> => {await breakpoint(100)- // Fixed server-side order; column sorting happens client-side on the loaded set.- const query = toolQualityQueryTemplate- .replace('__ORDER_BY__', 'total_calls')- .replace('__ORDER_DIRECTION__', 'DESC')+ // Fixed server-side order (total_calls DESC); column sorting happens client-side.const response = (await api.query({- kind: NodeKind.HogQLQuery,- query,- filters: {- dateRange: {- date_from: values.dateFilter.dateFrom,- date_to: values.dateFilter.dateTo,- },- ...(values.categoryProperties.length > 0 ? { properties: values.categoryProperties } : {}),- },- })) as HogQLQueryResponse+ kind: NodeKind.MCPToolQualityRowsQuery,+ dateRange: { date_from: values.dateFilter.dateFrom, date_to: values.dateFilter.dateTo },+ categories: values.selectedCategories,+ })) as { results?: MCPToolQualityRowItem[] }breakpoint()- return ((response.results as unknown[][]) ?? []).map((r) => ({- tool: String(r[0] ?? ''),- total_calls: Number(r[1] ?? 0),- errors: Number(r[2] ?? 0),- error_rate_pct: Number(r[3] ?? 0),- p50_duration_ms: Number(r[4] ?? 0),- p95_duration_ms: Number(r[5] ?? 0),- p99_duration_ms: Number(r[6] ?? 0),- users: Number(r[7] ?? 0),- sessions: Number(r[8] ?? 0),- first_seen: String(r[9] ?? ''),- last_seen: String(r[10] ?? ''),+ return (response.results ?? []).map((r) => ({+ tool: r.tool,+ total_calls: r.total_calls,+ errors: r.errors,+ error_rate_pct: r.error_rate_pct,+ p50_duration_ms: r.p50_duration_ms,+ p95_duration_ms: r.p95_duration_ms,+ p99_duration_ms: r.p99_duration_ms,+ users: r.users,+ sessions: r.sessions,+ first_seen: r.first_seen,+ last_seen: r.last_seen,}))},},@@ -413,55 +373,21 @@ export const mcpAnalyticsToolQualityLogic = kea<mcpAnalyticsToolQualityLogicType{loadDailyStats: async (_: void, breakpoint): Promise<DailyToolStat[]> => {await breakpoint(100)- // The selected tool rides along as a property filter resolved by the- // {filters} placeholder, so the value never touches the query string.- const toolProperty: AnyPropertyFilter[] = values.selectedTool- ? [- {- key: '$mcp_tool_name',- value: [values.selectedTool],- operator: PropertyOperator.Exact,- type: PropertyFilterType.Event,- },- ]- : []- const properties = [...values.categoryProperties, ...toolProperty]const response = (await api.query({- kind: NodeKind.HogQLQuery,- // `values.interval` is a fixed IntervalType from getDefaultInterval, never user- // input, so interpolating it into the dateTrunc is safe.- query: `-SELECT- dateTrunc('${values.interval}', timestamp) AS day,- count() AS calls,- countIf(toBool(properties.$mcp_is_error)) AS errors,- round(quantile(0.5)(toFloat(properties.$mcp_duration_ms))) AS p50,- round(quantile(0.95)(toFloat(properties.$mcp_duration_ms))) AS p95,- round(quantile(0.99)(toFloat(properties.$mcp_duration_ms))) AS p99-FROM events-WHERE event = '$mcp_tool_call'- AND properties.$mcp_tool_name IS NOT NULL- AND properties.$mcp_tool_name != ''- AND {filters}-GROUP BY day-ORDER BY day-`,- filters: {- dateRange: {- date_from: values.dateFilter.dateFrom,- date_to: values.dateFilter.dateTo,- },- ...(properties.length > 0 ? { properties } : {}),- },- })) as HogQLQueryResponse+ kind: NodeKind.MCPToolQualityDailyStatsQuery,+ dateRange: { date_from: values.dateFilter.dateFrom, date_to: values.dateFilter.dateTo },+ interval: values.interval,+ categories: values.selectedCategories,+ ...(values.selectedTool ? { toolName: values.selectedTool } : {}),+ })) as { results?: MCPToolQualityDailyStatItem[] }breakpoint()- return ((response.results as unknown[][]) ?? []).map((r) => ({- day: String(r[0] ?? ''),- calls: Number(r[1] ?? 0),- errors: Number(r[2] ?? 0),- p50: Number(r[3] ?? 0),- p95: Number(r[4] ?? 0),- p99: Number(r[5] ?? 0),+ return (response.results ?? []).map((r) => ({+ day: r.day,+ calls: r.calls,+ errors: r.errors,+ p50: r.p50,+ p95: r.p95,+ p99: r.p99,}))},},@@ -469,22 +395,6 @@ ORDER BY day})),selectors({- // Event property filter applied to every query so the whole tab scopes to- // the selected categories. Empty selection means "all categories".- categoryProperties: [- (s) => [s.selectedCategories],- (selectedCategories: string[]): AnyPropertyFilter[] =>- selectedCategories.length > 0- ? [- {- key: '$mcp_tool_category',- value: selectedCategories,- operator: PropertyOperator.Exact,- type: PropertyFilterType.Event,- },- ]- : [],- ],// Human-readable label for the active window (e.g. "Last 7 days"), used by// the scope-share headline so it never falls out of sync with the filter.dateRangeLabel: [diff --git a/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.ts b/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.tsindex 577376114de6..2786e24c52f7 100644--- a/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.ts+++ b/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.ts@@ -86,8 +86,8 @@ ORDER BY tool_calls DESCLIMIT 500`-// Mirrors products/mcp_analytics/backend/templates/tool_quality.sql for the-// compact reliability matrix on the overview. Limited columns + 50 rows.+// Mirrors MCPToolQualityRowsQueryRunner (products/mcp_analytics/backend/hogql_queries/tool_quality_tables.py)+// for the compact reliability matrix on the overview. Limited columns + 50 rows.const TOOL_ROWS_QUERY = `SELECTtoString(properties.$mcp_tool_name) AS tool,diff --git a/products/mcp_analytics/frontend/tool-quality/ToolQualityTable.tsx b/products/mcp_analytics/frontend/tool-quality/ToolQualityTable.tsxindex ce379c2d2118..21d9819d7e40 100644--- a/products/mcp_analytics/frontend/tool-quality/ToolQualityTable.tsx+++ b/products/mcp_analytics/frontend/tool-quality/ToolQualityTable.tsx@@ -38,7 +38,7 @@ import {const DESTRUCTIVE_ERROR_PCT = 5-// LIMIT in tool_quality.sql — when the fetched set hits this, more tools may exist.+// LIMIT in MCPToolQualityRowsQueryRunner — when the fetched set hits this, more tools may exist.const TOOL_ROW_LIMIT = 200function formatToolCount(filtered: number, total: number): string {diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex fe259c438989..87e873919fac 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -32190,6 +32190,170 @@ export namespace Schemas {version?: number | null;}+ export interface MCPToolQualityRowItem {+ error_rate_pct: number;+ errors: number;+ first_seen: string;+ last_seen: string;+ p50_duration_ms: number;+ p95_duration_ms: number;+ p99_duration_ms: number;+ sessions: number;+ tool: string;+ total_calls: number;+ users: number;+ }++ export interface MCPToolQualityRowsQueryResponse {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolQualityRowItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface MCPToolQualityRowsQuery {+ /** Restrict to these $mcp_tool_category values; empty or omitted means all categories. */+ categories?: string[] | null;+ dateRange?: DateRange | null;+ kind?: 'MCPToolQualityRowsQuery';+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ response?: MCPToolQualityRowsQueryResponse | null;+ tags?: QueryLogTags | null;+ /** version of the node, used for schema migrations */+ version?: number | null;+ }++ export interface MCPToolQualityDailyStatItem {+ calls: number;+ day: string;+ errors: number;+ p50: number;+ p95: number;+ p99: number;+ }++ export interface MCPToolQualityDailyStatsQueryResponse {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolQualityDailyStatItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface MCPToolQualityDailyStatsQuery {+ /** Restrict to these $mcp_tool_category values; empty or omitted means all categories. */+ categories?: string[] | null;+ dateRange?: DateRange | null;+ /** Bucket granularity; the frontend passes getDefaultInterval. Defaults to day. */+ interval?: IntervalType | null;+ kind?: 'MCPToolQualityDailyStatsQuery';+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ response?: MCPToolQualityDailyStatsQueryResponse | null;+ tags?: QueryLogTags | null;+ /** Restrict to a single $mcp_tool_name; omitted means the aggregate across all tools. */+ toolName?: string | null;+ /** version of the node, used for schema migrations */+ version?: number | null;+ }++ export interface MCPToolCategoryCountItem {+ calls: number;+ category: string;+ }++ export interface MCPToolCategoryCountsQueryResponse {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolCategoryCountItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface MCPToolCategoryCountsQuery {+ dateRange?: DateRange | null;+ kind?: 'MCPToolCategoryCountsQuery';+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ response?: MCPToolCategoryCountsQueryResponse | null;+ tags?: QueryLogTags | null;+ /** version of the node, used for schema migrations */+ version?: number | null;+ }++ export interface MCPToolCategoryItem {+ category: string;+ }++ export interface MCPToolCategoriesQueryResponse {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolCategoryItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface MCPToolCategoriesQuery {+ dateRange?: DateRange | null;+ kind?: 'MCPToolCategoriesQuery';+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ response?: MCPToolCategoriesQueryResponse | null;+ tags?: QueryLogTags | null;+ /** version of the node, used for schema migrations */+ version?: number | null;+ }+export interface MCPToolDescriptionItem {description: string;last_seen: string;@@ -32346,7 +32510,7 @@ export namespace Schemas {query: string;response?: HogQLMetadataResponse | null;/** Query within which "expr" and "template" are validated. Defaults to "select * from events" */- sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | null;+ sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | null;tags?: QueryLogTags | null;/** Variables to be subsituted into the query */variables?: HogQLMetadataVariables;@@ -32372,7 +32536,7 @@ export namespace Schemas {query: string;response?: HogQLAutocompleteResponse | null;/** Query in whose context to validate. */- sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | null;+ sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | null;/** Start position of the editor word */startPosition: number;tags?: QueryLogTags | null;@@ -52546,7 +52710,7 @@ export namespace Schemas {* ```** For more details on HogQL queries, see the [PostHog HogQL documentation](/docs/hogql#api-access). */- query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | PropertyValuesQuery;+ query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | PropertyValuesQuery;/** Whether results should be calculated sync or async, and how much to rely on the cache:* - `'blocking'` - calculate synchronously (returning only when the query is done), UNLESS there are very fresh results in the cache* - `'async'` - kick off background calculation (returning immediately with a query status), UNLESS there are very fresh results in the cache@@ -54690,7 +54854,7 @@ export namespace Schemas {resolved_compare_date_range?: ResolvedDateRangeResponse | null;/** The date range used for the query */resolved_date_range?: ResolvedDateRangeResponse | null;- results: MCPToolDescriptionItem[];+ results: MCPToolQualityRowItem[];/** Measured timings for different parts of the query generation process */timings?: QueryTiming[] | null;/** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */@@ -54710,7 +54874,7 @@ export namespace Schemas {resolved_compare_date_range?: ResolvedDateRangeResponse | null;/** The date range used for the query */resolved_date_range?: ResolvedDateRangeResponse | null;- results: MCPToolSampleIntentItem[];+ results: MCPToolQualityDailyStatItem[];/** Measured timings for different parts of the query generation process */timings?: QueryTiming[] | null;/** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */@@ -54730,7 +54894,7 @@ export namespace Schemas {resolved_compare_date_range?: ResolvedDateRangeResponse | null;/** The date range used for the query */resolved_date_range?: ResolvedDateRangeResponse | null;- results: MCPToolNeighborItem[];+ results: MCPToolCategoryCountItem[];/** Measured timings for different parts of the query generation process */timings?: QueryTiming[] | null;/** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */@@ -54738,6 +54902,86 @@ export namespace Schemas {}export interface QueryResponseAlternative107 {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolCategoryItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface QueryResponseAlternative108 {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolDescriptionItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface QueryResponseAlternative109 {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolSampleIntentItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface QueryResponseAlternative110 {+ /** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */+ error?: string | null;+ /** Generated HogQL query. */+ hogql?: string | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Query status indicates whether next to the provided data, a query is still running. */+ query_status?: QueryStatus | null;+ /** The resolved previous/comparison period date range, when comparing against another period */+ resolved_compare_date_range?: ResolvedDateRangeResponse | null;+ /** The date range used for the query */+ resolved_date_range?: ResolvedDateRangeResponse | null;+ results: MCPToolNeighborItem[];+ /** Measured timings for different parts of the query generation process */+ timings?: QueryTiming[] | null;+ /** Warnings about data warehouse sources referenced by the query whose latest sync failed, is paused, hit a billing limit, or is otherwise stale. Results may not reflect current source data. Accumulated across every HogQL execution that contributes to this response — so insights backed by warehouse tables (Trends, Funnels, etc.) receive the same warnings as raw HogQL queries. Also carries access control warnings when a system-table query filters out objects the user can't access. */+ warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;+ }++ export interface QueryResponseAlternative111 {/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */error?: string | null;/** Generated HogQL query. */@@ -54757,18 +55001,18 @@ export namespace Schemas {warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;}- export type QueryResponseAlternative = { [key: string]: unknown } | QueryResponseAlternative1 | QueryResponseAlternative2 | QueryResponseAlternative3 | QueryResponseAlternative4 | QueryResponseAlternative5 | QueryResponseAlternative6 | QueryResponseAlternative7 | QueryResponseAlternative8 | QueryResponseAlternative9 | QueryResponseAlternative10 | QueryResponseAlternative11 | QueryResponseAlternative14 | QueryResponseAlternative15 | QueryResponseAlternative16 | QueryResponseAlternative17 | QueryResponseAlternative18 | QueryResponseAlternative19 | QueryResponseAlternative20 | QueryResponseAlternative21 | QueryResponseAlternative22 | QueryResponseAlternative23 | QueryResponseAlternative24 | QueryResponseAlternative25 | QueryResponseAlternative26 | QueryResponseAlternative27 | QueryResponseAlternative28 | QueryResponseAlternative29 | QueryResponseAlternative30 | QueryResponseAlternative31 | QueryResponseAlternative32 | QueryResponseAlternative33 | QueryResponseAlternative34 | QueryResponseAlternative35 | QueryResponseAlternative36 | QueryResponseAlternative37 | QueryResponseAlternative38 | unknown | QueryResponseAlternative39 | QueryResponseAlternative40 | QueryResponseAlternative41 | QueryResponseAlternative42 | QueryResponseAlternative43 | QueryResponseAlternative44 | QueryResponseAlternative45 | QueryResponseAlternative46 | QueryResponseAlternative47 | QueryResponseAlternative48 | QueryResponseAlternative49 | QueryResponseAlternative50 | QueryResponseAlternative51 | QueryResponseAlternative52 | QueryResponseAlternative53 | QueryResponseAlternative54 | QueryResponseAlternative55 | QueryResponseAlternative57 | QueryResponseAlternative58 | QueryResponseAlternative59 | QueryResponseAlternative60 | QueryResponseAlternative62 | QueryResponseAlternative63 | QueryResponseAlternative64 | QueryResponseAlternative66 | QueryResponseAlternative67 | QueryResponseAlternative68 | QueryResponseAlternative69 | QueryResponseAlternative70 | QueryResponseAlternative71 | QueryResponseAlternative72 | QueryResponseAlternative74 | QueryResponseAlternative75 | QueryResponseAlternative76 | QueryResponseAlternative77 | QueryResponseAlternative78 | QueryResponseAlternative79 | QueryResponseAlternative80 | QueryResponseAlternative81 | QueryResponseAlternative82 | QueryResponseAlternative83 | QueryResponseAlternative84 | QueryResponseAlternative85 | QueryResponseAlternative86 | QueryResponseAlternative87 | QueryResponseAlternative88 | QueryResponseAlternative89 | QueryResponseAlternative92 | QueryResponseAlternative93 | QueryResponseAlternative94 | QueryResponseAlternative95 | QueryResponseAlternative96 | QueryResponseAlternative97 | QueryResponseAlternative98 | QueryResponseAlternative99 | QueryResponseAlternative100 | QueryResponseAlternative101 | QueryResponseAlternative102 | QueryResponseAlternative103 | QueryResponseAlternative104 | QueryResponseAlternative105 | QueryResponseAlternative106 | QueryResponseAlternative107;+ export type QueryResponseAlternative = { [key: string]: unknown } | QueryResponseAlternative1 | QueryResponseAlternative2 | QueryResponseAlternative3 | QueryResponseAlternative4 | QueryResponseAlternative5 | QueryResponseAlternative6 | QueryResponseAlternative7 | QueryResponseAlternative8 | QueryResponseAlternative9 | QueryResponseAlternative10 | QueryResponseAlternative11 | QueryResponseAlternative14 | QueryResponseAlternative15 | QueryResponseAlternative16 | QueryResponseAlternative17 | QueryResponseAlternative18 | QueryResponseAlternative19 | QueryResponseAlternative20 | QueryResponseAlternative21 | QueryResponseAlternative22 | QueryResponseAlternative23 | QueryResponseAlternative24 | QueryResponseAlternative25 | QueryResponseAlternative26 | QueryResponseAlternative27 | QueryResponseAlternative28 | QueryResponseAlternative29 | QueryResponseAlternative30 | QueryResponseAlternative31 | QueryResponseAlternative32 | QueryResponseAlternative33 | QueryResponseAlternative34 | QueryResponseAlternative35 | QueryResponseAlternative36 | QueryResponseAlternative37 | QueryResponseAlternative38 | unknown | QueryResponseAlternative39 | QueryResponseAlternative40 | QueryResponseAlternative41 | QueryResponseAlternative42 | QueryResponseAlternative43 | QueryResponseAlternative44 | QueryResponseAlternative45 | QueryResponseAlternative46 | QueryResponseAlternative47 | QueryResponseAlternative48 | QueryResponseAlternative49 | QueryResponseAlternative50 | QueryResponseAlternative51 | QueryResponseAlternative52 | QueryResponseAlternative53 | QueryResponseAlternative54 | QueryResponseAlternative55 | QueryResponseAlternative57 | QueryResponseAlternative58 | QueryResponseAlternative59 | QueryResponseAlternative60 | QueryResponseAlternative62 | QueryResponseAlternative63 | QueryResponseAlternative64 | QueryResponseAlternative66 | QueryResponseAlternative67 | QueryResponseAlternative68 | QueryResponseAlternative69 | QueryResponseAlternative70 | QueryResponseAlternative71 | QueryResponseAlternative72 | QueryResponseAlternative74 | QueryResponseAlternative75 | QueryResponseAlternative76 | QueryResponseAlternative77 | QueryResponseAlternative78 | QueryResponseAlternative79 | QueryResponseAlternative80 | QueryResponseAlternative81 | QueryResponseAlternative82 | QueryResponseAlternative83 | QueryResponseAlternative84 | QueryResponseAlternative85 | QueryResponseAlternative86 | QueryResponseAlternative87 | QueryResponseAlternative88 | QueryResponseAlternative89 | QueryResponseAlternative92 | QueryResponseAlternative93 | QueryResponseAlternative94 | QueryResponseAlternative95 | QueryResponseAlternative96 | QueryResponseAlternative97 | QueryResponseAlternative98 | QueryResponseAlternative99 | QueryResponseAlternative100 | QueryResponseAlternative101 | QueryResponseAlternative102 | QueryResponseAlternative103 | QueryResponseAlternative104 | QueryResponseAlternative105 | QueryResponseAlternative106 | QueryResponseAlternative107 | QueryResponseAlternative108 | QueryResponseAlternative109 | QueryResponseAlternative110 | QueryResponseAlternative111;export interface QueryStatusResponse {query_status: QueryStatus;}export interface QueryUpgradeRequest {- query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | PropertyValuesQuery;+ query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | PropertyValuesQuery;}export interface QueryUpgradeResponse {- query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | PropertyValuesQuery;+ query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | RevenueExampleEventsQuery | RevenueExampleDataWarehouseTablesQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | RevenueAnalyticsGrossRevenueQuery | RevenueAnalyticsMetricsQuery | RevenueAnalyticsMRRQuery | RevenueAnalyticsOverviewQuery | RevenueAnalyticsTopCustomersQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | NonIntegratedConversionsTableQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | PropertyValuesQuery;}export interface QuotaResourceLimit {