Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(mcp-analytics): show MCP model share (#97764)

Lucas Faria772d0d314e79
diff --git a/bin/patch-schema-property-filter-discriminator.py b/bin/patch-schema-property-filter-discriminator.py
index 50d2a6694798..4f6d4017bc70 100644
--- a/bin/patch-schema-property-filter-discriminator.py
+++ b/bin/patch-schema-property-filter-discriminator.py
@@ -73,7 +73,7 @@ EXPECTED_SITE_COUNTS = {
# recursive site, discriminated including the group via its AND/OR -> property_group tag.
"recursive": 1,
# Plain inlined runs: list[<members>], optionally `| PropertyGroupFilter` / `| None`.
- "plain": 64,
+ "plain": 65,
}
diff --git a/docs/published/docs/mcp-analytics/model-share.mdx b/docs/published/docs/mcp-analytics/model-share.mdx
new file mode 100644
index 000000000000..1b8c5dfe6029
--- /dev/null
+++ b/docs/published/docs/mcp-analytics/model-share.mdx
@@ -0,0 +1,21 @@
+---
+title: MCP model share
+sidebar: Docs
+showTitle: true
+---
+
+The **Share of calls by model** card on the MCP analytics dashboard compares tool call volume across captured model names.
+It appears when at least one tool call in the selected date range and filters has an identified model.
+
+Horizontal bars rank models by call count. Each bar shows its percentage of all tool calls and its call count.
+Hover over a bar to see the full model name.
+
+Recognized model families use consistent colors, with related shades for individual models.
+Colors stay the same when call counts or rankings change. Provider prefixes do not change a recognized model's color.
+Other named models receive a stable palette color; **Unknown** and **Other** remain neutral gray.
+
+- **Unknown** includes calls without an identified model. Its gray bar remains in the percentage denominator.
+- **Other** combines identified models outside the six most-used model names.
+- **Identified** shows the percentage of all tool calls with an identified model, including those grouped into **Other**.
+
+The card uses the model metadata captured with each call. Calls without model metadata remain **Unknown**.
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index aee3b749fffd..5a2cd3666159 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -8384,6 +8384,14 @@ snapshots:
hash: v1.k794b7964.a4f65ae92d92d3600674689dc61f5ba834aac470154fb26b82821cb17b12cada.vAYLkto1-GBp1WeHETUeB5R0Pljn-RwHDW9h3bib1KQ
scenes-app-mcp-analytics-dashboard-cards--share-by-harness--light:
hash: v1.k794b7964.c5eae070d2b0728ce676a8248650123f9a153ec8a9b9052f119d28b82e112e75.CdS-40DZGyT0t1Th9qh7g6Cc9Dgt__lEEujO7OXp4IM
+ scenes-app-mcp-analytics-dashboard-cards--share-by-model--dark:
+ hash: v1.k794b7964.f1cd0d50270811709b21860ec24f74dbc4a0ccce9841fc41b4cecabcd97ca447.S1pSjSh-DsFc_Onzdgc7zvj6g4n5Q5YROMGTKnp3iuc
+ scenes-app-mcp-analytics-dashboard-cards--share-by-model--light:
+ hash: v1.k794b7964.40b706717d21cabf7fc288b6531698ee207368c6b3fb83a6b66ca6acfe2af6df.2Xva50fHqEd4vwrvAvd5-8wBy1icz-LK_EgpRSjO0Eg
+ scenes-app-mcp-analytics-dashboard-cards--share-by-model-narrow--dark:
+ hash: v1.k794b7964.1565523b8bf28f1b9e9da27d78ac894e48190990f52542bc29a056ddec18bbad.wcFDEppca70quTjgH2H8u2NzA6c0GteoGLnViMcQ2E0
+ scenes-app-mcp-analytics-dashboard-cards--share-by-model-narrow--light:
+ hash: v1.k794b7964.bafbff928ee418e609247d0bb7d9c380056d1c1415800545ca69c3e77679b526.ySislSzbxIwQSNIVnbQKs-69P8F70MmLOzvlq9Yi2fQ
scenes-app-mcp-analytics-missing-capabilities-preview--example-reports--dark:
hash: v1.k794b7964.e1dfe15b20b22dec1f74881db821597e40d534cf0c9773fc032948311de642f7.iAS_FuPfykHZ7rjy90ExdGbsAT1eKhSIwVLvxUg1aGM
scenes-app-mcp-analytics-missing-capabilities-preview--example-reports--light:
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 960373f9b9e3..731669806e0f 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -1765,6 +1765,9 @@
{
"$ref": "#/definitions/MCPHarnessBreakdownQuery"
},
+ {
+ "$ref": "#/definitions/MCPModelBreakdownQuery"
+ },
{
"$ref": "#/definitions/MCPToolTopUsersQuery"
},
@@ -10098,6 +10101,106 @@
],
"type": "object"
},
+ "CachedMCPModelBreakdownQueryResponse": {
+ "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/MCPModelBreakdownItem"
+ },
+ "type": "array"
+ },
+ "timezone": {
+ "type": "string"
+ },
+ "timings": {
+ "description": "Measured timings for different parts of the query generation process",
+ "items": {
+ "$ref": "#/definitions/QueryTiming"
+ },
+ "type": "array"
+ },
+ "used_data_warehouse_sources": {
+ "description": "Connector-synced data warehouse sources referenced by this query, if any.",
+ "items": {
+ "$ref": "#/definitions/DataWarehouseSourceUsage"
+ },
+ "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"
+ },
"CachedMCPToolCallBreakdownQueryResponse": {
"additionalProperties": false,
"properties": {
@@ -32484,6 +32587,123 @@
"required": ["has_next", "results"],
"type": "object"
},
+ "MCPModelBreakdownItem": {
+ "additionalProperties": false,
+ "description": "One model's share of MCP tool calls.",
+ "properties": {
+ "model": {
+ "type": "string"
+ },
+ "total_calls": {
+ "$ref": "#/definitions/integer"
+ }
+ },
+ "required": ["model", "total_calls"],
+ "type": "object"
+ },
+ "MCPModelBreakdownQuery": {
+ "additionalProperties": false,
+ "description": "MCP tool-call activity grouped by captured model identity.",
+ "properties": {
+ "dateRange": {
+ "$ref": "#/definitions/DateRange"
+ },
+ "filterTestAccounts": {
+ "type": "boolean"
+ },
+ "kind": {
+ "const": "MCPModelBreakdownQuery",
+ "type": "string"
+ },
+ "modifiers": {
+ "$ref": "#/definitions/HogQLQueryModifiers",
+ "description": "Modifiers used when performing the query"
+ },
+ "properties": {
+ "items": {
+ "$ref": "#/definitions/AnyPropertyFilter"
+ },
+ "type": "array"
+ },
+ "response": {
+ "$ref": "#/definitions/MCPModelBreakdownQueryResponse"
+ },
+ "tags": {
+ "$ref": "#/definitions/QueryLogTags"
+ },
+ "version": {
+ "description": "version of the node, used for schema migrations",
+ "type": "number"
+ }
+ },
+ "required": ["kind"],
+ "type": "object"
+ },
+ "MCPModelBreakdownQueryResponse": {
+ "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/MCPModelBreakdownItem"
+ },
+ "type": "array"
+ },
+ "timings": {
+ "description": "Measured timings for different parts of the query generation process",
+ "items": {
+ "$ref": "#/definitions/QueryTiming"
+ },
+ "type": "array"
+ },
+ "used_data_warehouse_sources": {
+ "description": "Connector-synced data warehouse sources referenced by this query, if any.",
+ "items": {
+ "$ref": "#/definitions/DataWarehouseSourceUsage"
+ },
+ "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"
+ },
"MCPToolCallBreakdownItem": {
"additionalProperties": false,
"description": "One tool's call count within one interval bucket.",
@@ -38414,6 +38634,7 @@
"MCPToolCallBreakdownQuery",
"MCPToolCallsAndErrorsQuery",
"MCPHarnessBreakdownQuery",
+ "MCPModelBreakdownQuery",
"MCPToolTopUsersQuery",
"MCPToolFailuresQuery",
"MCPToolFailureOccurrencesQuery",
@@ -47542,6 +47763,71 @@
"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/MCPModelBreakdownItem"
+ },
+ "type": "array"
+ },
+ "timings": {
+ "description": "Measured timings for different parts of the query generation process",
+ "items": {
+ "$ref": "#/definitions/QueryTiming"
+ },
+ "type": "array"
+ },
+ "used_data_warehouse_sources": {
+ "description": "Connector-synced data warehouse sources referenced by this query, if any.",
+ "items": {
+ "$ref": "#/definitions/DataWarehouseSourceUsage"
+ },
+ "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": {
@@ -48788,6 +49074,9 @@
{
"$ref": "#/definitions/MCPHarnessBreakdownQuery"
},
+ {
+ "$ref": "#/definitions/MCPModelBreakdownQuery"
+ },
{
"$ref": "#/definitions/MCPToolTopUsersQuery"
},
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index ac4e3ac7561f..be94e26ed683 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -198,6 +198,7 @@ export enum NodeKind {
MCPToolCallBreakdownQuery = 'MCPToolCallBreakdownQuery',
MCPToolCallsAndErrorsQuery = 'MCPToolCallsAndErrorsQuery',
MCPHarnessBreakdownQuery = 'MCPHarnessBreakdownQuery',
+ MCPModelBreakdownQuery = 'MCPModelBreakdownQuery',
MCPToolTopUsersQuery = 'MCPToolTopUsersQuery',
MCPToolFailuresQuery = 'MCPToolFailuresQuery',
MCPToolFailureOccurrencesQuery = 'MCPToolFailureOccurrencesQuery',
@@ -284,6 +285,7 @@ export type AnyDataNode =
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -417,6 +419,7 @@ export type QuerySchema =
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -3413,6 +3416,26 @@ export interface MCPHarnessBreakdownQuery extends DataNode<MCPHarnessBreakdownQu
export type CachedMCPHarnessBreakdownQueryResponse = CachedQueryResponse<MCPHarnessBreakdownQueryResponse>
+/** One model's share of MCP tool calls. */
+export interface MCPModelBreakdownItem {
+ model: string
+ total_calls: integer
+}
+
+export interface MCPModelBreakdownQueryResponse extends AnalyticsQueryResponseBase {
+ results: MCPModelBreakdownItem[]
+}
+
+/** MCP tool-call activity grouped by captured model identity. */
+export interface MCPModelBreakdownQuery extends DataNode<MCPModelBreakdownQueryResponse> {
+ kind: NodeKind.MCPModelBreakdownQuery
+ dateRange?: DateRange
+ properties?: AnyPropertyFilter[]
+ filterTestAccounts?: boolean
+}
+
+export type CachedMCPModelBreakdownQueryResponse = CachedQueryResponse<MCPModelBreakdownQueryResponse>
+
/** One row of the per-tool "Top users" table: a user and their activity on a tool. */
export interface MCPToolTopUserItem {
distinct_id: string
diff --git a/frontend/src/scenes/saved-insights/insightTypesMetadata.tsx b/frontend/src/scenes/saved-insights/insightTypesMetadata.tsx
index 97d46a57d95f..ace38da0037b 100644
--- a/frontend/src/scenes/saved-insights/insightTypesMetadata.tsx
+++ b/frontend/src/scenes/saved-insights/insightTypesMetadata.tsx
@@ -622,6 +622,12 @@ export const QUERY_TYPES_METADATA: Record<NodeKind, InsightTypeMetadata> = {
icon: IconPieChart,
inMenu: false,
},
+ [NodeKind.MCPModelBreakdownQuery]: {
+ name: 'MCP model breakdown',
+ description: 'MCP tool-call activity grouped by captured model.',
+ icon: IconPieChart,
+ inMenu: false,
+ },
[NodeKind.MCPToolSampleIntentsQuery]: {
name: 'MCP tool sample intents',
description: 'Recent sampled intents for a single MCP tool.',
diff --git a/posthog/clickhouse/query_tagging.py b/posthog/clickhouse/query_tagging.py
index e8d4e9713f89..4ecc85c2cd71 100644
--- a/posthog/clickhouse/query_tagging.py
+++ b/posthog/clickhouse/query_tagging.py
@@ -284,6 +284,7 @@ def kind_fallback_tags(kind: NodeKind) -> FallbackTags | None:
return {"product": Product.MARKETING_ANALYTICS}
case (
NodeKind.MCP_HARNESS_BREAKDOWN_QUERY
+ | NodeKind.MCP_MODEL_BREAKDOWN_QUERY
| NodeKind.MCP_TOOL_CALL_BREAKDOWN_QUERY
| NodeKind.MCP_TOOL_CALLS_AND_ERRORS_QUERY
| NodeKind.MCP_TOOL_TOP_USERS_QUERY
diff --git a/posthog/clickhouse/test/test_query_tagging.py b/posthog/clickhouse/test/test_query_tagging.py
index 9908fcac4d33..eb57b6fc0454 100644
--- a/posthog/clickhouse/test/test_query_tagging.py
+++ b/posthog/clickhouse/test/test_query_tagging.py
@@ -590,8 +590,9 @@ class TestAddFallbackQueryTags(BaseTest):
assert tags.product == Product.PRODUCT_ANALYTICS
assert tags.feature is None
- def test_missing_capabilities_kind_attributes_to_mcp_analytics(self):
- tags = QueryTags(query_type="MCPMissingCapabilitiesQuery")
+ @parameterized.expand([("MCPMissingCapabilitiesQuery",), ("MCPModelBreakdownQuery",)])
+ def test_mcp_analytics_kind_attributes_to_mcp_analytics(self, query_type: str) -> None:
+ tags = QueryTags(query_type=query_type)
add_fallback_query_tags(tags)
assert tags.product == Product.MCP_ANALYTICS
diff --git a/posthog/hogql_queries/query_runner.py b/posthog/hogql_queries/query_runner.py
index dd6e62b8a16e..0bc6bc30d665 100644
--- a/posthog/hogql_queries/query_runner.py
+++ b/posthog/hogql_queries/query_runner.py
@@ -51,6 +51,7 @@ from posthog.schema import (
MarketingAnalyticsTableQuery,
MCPHarnessBreakdownQuery,
MCPMissingCapabilitiesQuery,
+ MCPModelBreakdownQuery,
MCPToolCallBreakdownQuery,
MCPToolCallsAndErrorsQuery,
MCPToolCategoriesQuery,
@@ -459,6 +460,7 @@ RunnableQueryNode = Union[
EndpointsUsageTrendsQuery,
MetricsQuery,
MCPHarnessBreakdownQuery,
+ MCPModelBreakdownQuery,
MCPToolCallBreakdownQuery,
MCPToolCallsAndErrorsQuery,
MCPToolTopUsersQuery,
@@ -1167,6 +1169,17 @@ def get_query_runner(
modifiers=modifiers,
user=user,
)
+ if kind == "MCPModelBreakdownQuery":
+ from products.mcp_analytics.backend.facade.queries import MCPModelBreakdownQueryRunner
+
+ return MCPModelBreakdownQueryRunner(
+ query=cast(MCPModelBreakdownQuery | dict[str, Any], query),
+ team=team,
+ timings=timings,
+ limit_context=limit_context,
+ modifiers=modifiers,
+ user=user,
+ )
if kind == "MCPMissingCapabilitiesQuery":
from products.mcp_analytics.backend.facade.queries import MCPMissingCapabilitiesQueryRunner
diff --git a/posthog/schema.py b/posthog/schema.py
index 693b097204f3..205fa805b941 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -5878,6 +5878,14 @@ class MCPHarnessBreakdownItem(BaseModel):
total_calls: int
+class MCPModelBreakdownItem(BaseModel):
+ model_config = ConfigDict(
+ extra="forbid",
+ )
+ model: str
+ total_calls: int
+
+
class MCPToolCallBreakdownItem(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -12292,6 +12300,64 @@ class CachedMCPMissingCapabilitiesQueryResponse(BaseModel):
)
+class CachedMCPModelBreakdownQueryResponse(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[MCPModelBreakdownItem]
+ timezone: str
+ timings: list[QueryTiming] | None = Field(
+ default=None,
+ description=("Measured timings for different parts of the query generation process"),
+ )
+ used_data_warehouse_sources: list[DataWarehouseSourceUsage] | None = Field(
+ default=None,
+ description=("Connector-synced data warehouse sources referenced by this query, if any."),
+ )
+ 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 CachedMCPToolCallBreakdownQueryResponse(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -17955,6 +18021,53 @@ class MCPMissingCapabilitiesQueryResponse(BaseModel):
)
+class MCPModelBreakdownQueryResponse(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[MCPModelBreakdownItem]
+ timings: list[QueryTiming] | None = Field(
+ default=None,
+ description=("Measured timings for different parts of the query generation process"),
+ )
+ used_data_warehouse_sources: list[DataWarehouseSourceUsage] | None = Field(
+ default=None,
+ description=("Connector-synced data warehouse sources referenced by this query, if any."),
+ )
+ 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 MCPToolCallBreakdownQueryResponse(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -23217,7 +23330,7 @@ class QueryResponseAlternative97(BaseModel):
resolved_date_range: ResolvedDateRangeResponse | None = Field(
default=None, description="The date range used for the query"
)
- results: list[MCPToolTopUserItem]
+ results: list[MCPModelBreakdownItem]
timings: list[QueryTiming] | None = Field(
default=None,
description=("Measured timings for different parts of the query generation process"),
@@ -23264,7 +23377,7 @@ class QueryResponseAlternative98(BaseModel):
resolved_date_range: ResolvedDateRangeResponse | None = Field(
default=None, description="The date range used for the query"
)
- results: list[MCPToolFailureItem]
+ results: list[MCPToolTopUserItem]
timings: list[QueryTiming] | None = Field(
default=None,
description=("Measured timings for different parts of the query generation process"),
@@ -23311,7 +23424,7 @@ class QueryResponseAlternative99(BaseModel):
resolved_date_range: ResolvedDateRangeResponse | None = Field(
default=None, description="The date range used for the query"
)
- results: list[MCPToolFailureOccurrenceItem]
+ results: list[MCPToolFailureItem]
timings: list[QueryTiming] | None = Field(
default=None,
description=("Measured timings for different parts of the query generation process"),
@@ -23336,6 +23449,53 @@ class QueryResponseAlternative99(BaseModel):
class QueryResponseAlternative100(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[MCPToolFailureOccurrenceItem]
+ timings: list[QueryTiming] | None = Field(
+ default=None,
+ description=("Measured timings for different parts of the query generation process"),
+ )
+ used_data_warehouse_sources: list[DataWarehouseSourceUsage] | None = Field(
+ default=None,
+ description=("Connector-synced data warehouse sources referenced by this query, if any."),
+ )
+ 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 QueryResponseAlternative101(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23385,7 +23545,7 @@ class QueryResponseAlternative100(BaseModel):
)
-class QueryResponseAlternative101(BaseModel):
+class QueryResponseAlternative102(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23432,7 +23592,7 @@ class QueryResponseAlternative101(BaseModel):
)
-class QueryResponseAlternative102(BaseModel):
+class QueryResponseAlternative103(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23483,7 +23643,7 @@ class QueryResponseAlternative102(BaseModel):
)
-class QueryResponseAlternative103(BaseModel):
+class QueryResponseAlternative104(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23530,7 +23690,7 @@ class QueryResponseAlternative103(BaseModel):
)
-class QueryResponseAlternative104(BaseModel):
+class QueryResponseAlternative105(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23577,7 +23737,7 @@ class QueryResponseAlternative104(BaseModel):
)
-class QueryResponseAlternative105(BaseModel):
+class QueryResponseAlternative106(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23624,7 +23784,7 @@ class QueryResponseAlternative105(BaseModel):
)
-class QueryResponseAlternative106(BaseModel):
+class QueryResponseAlternative107(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23671,7 +23831,7 @@ class QueryResponseAlternative106(BaseModel):
)
-class QueryResponseAlternative107(BaseModel):
+class QueryResponseAlternative108(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23718,7 +23878,7 @@ class QueryResponseAlternative107(BaseModel):
)
-class QueryResponseAlternative108(BaseModel):
+class QueryResponseAlternative109(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23765,7 +23925,7 @@ class QueryResponseAlternative108(BaseModel):
)
-class QueryResponseAlternative109(BaseModel):
+class QueryResponseAlternative110(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23812,7 +23972,7 @@ class QueryResponseAlternative109(BaseModel):
)
-class QueryResponseAlternative110(BaseModel):
+class QueryResponseAlternative111(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -23860,7 +24020,7 @@ class QueryResponseAlternative110(BaseModel):
)
-class QueryResponseAlternative111(BaseModel):
+class QueryResponseAlternative112(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
@@ -26674,6 +26834,20 @@ class MCPMissingCapabilitiesQuery(BaseModel):
version: float | None = Field(default=None, description="version of the node, used for schema migrations")
+class MCPModelBreakdownQuery(BaseModel):
+ model_config = ConfigDict(
+ extra="forbid",
+ )
+ dateRange: DateRange | None = None
+ filterTestAccounts: bool | None = None
+ kind: Literal["MCPModelBreakdownQuery"] = "MCPModelBreakdownQuery"
+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")
+ properties: list[AnyPropertyFilterDiscriminated] | None = None
+ response: MCPModelBreakdownQueryResponse | None = None
+ tags: QueryLogTags | None = None
+ version: float | None = Field(default=None, description="version of the node, used for schema migrations")
+
+
class MCPToolCallBreakdownQuery(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -30142,6 +30316,7 @@ class QueryResponseAlternative(
| QueryResponseAlternative109
| QueryResponseAlternative110
| QueryResponseAlternative111
+ | QueryResponseAlternative112
]
):
root: (
@@ -30252,6 +30427,7 @@ class QueryResponseAlternative(
| QueryResponseAlternative109
| QueryResponseAlternative110
| QueryResponseAlternative111
+ | QueryResponseAlternative112
)
@@ -31212,6 +31388,7 @@ class HogQLAutocomplete(BaseModel):
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -31337,6 +31514,7 @@ class HogQLMetadata(BaseModel):
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -31482,6 +31660,7 @@ class MaxInsightContext(BaseModel):
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -31623,6 +31802,7 @@ class QueryRequest(BaseModel):
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -31756,6 +31936,7 @@ class QuerySchemaRoot(
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -31859,6 +32040,7 @@ class QuerySchemaRoot(
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -31967,6 +32149,7 @@ class QueryUpgradeRequest(BaseModel):
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -32075,6 +32258,7 @@ class QueryUpgradeResponse(BaseModel):
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
@@ -32369,6 +32553,7 @@ class VisualizationArtifactContent(BaseModel):
| MCPToolCallBreakdownQuery
| MCPToolCallsAndErrorsQuery
| MCPHarnessBreakdownQuery
+ | MCPModelBreakdownQuery
| MCPToolTopUsersQuery
| MCPToolFailuresQuery
| MCPToolFailureOccurrencesQuery
diff --git a/posthog/schema_enums.py b/posthog/schema_enums.py
index 57d94a755d66..a45192707cce 100644
--- a/posthog/schema_enums.py
+++ b/posthog/schema_enums.py
@@ -3502,6 +3502,7 @@ class NodeKind(StrEnum):
MCP_TOOL_CALL_BREAKDOWN_QUERY = "MCPToolCallBreakdownQuery"
MCP_TOOL_CALLS_AND_ERRORS_QUERY = "MCPToolCallsAndErrorsQuery"
MCP_HARNESS_BREAKDOWN_QUERY = "MCPHarnessBreakdownQuery"
+ MCP_MODEL_BREAKDOWN_QUERY = "MCPModelBreakdownQuery"
MCP_TOOL_TOP_USERS_QUERY = "MCPToolTopUsersQuery"
MCP_TOOL_FAILURES_QUERY = "MCPToolFailuresQuery"
MCP_TOOL_FAILURE_OCCURRENCES_QUERY = "MCPToolFailureOccurrencesQuery"
diff --git a/posthog/test/test_property_filter_discriminator.py b/posthog/test/test_property_filter_discriminator.py
index ee304a0eefc4..b656a490f5bc 100644
--- a/posthog/test/test_property_filter_discriminator.py
+++ b/posthog/test/test_property_filter_discriminator.py
@@ -24,6 +24,7 @@ from posthog.schema import (
LogEntryPropertyFilter,
LogPropertyFilter,
LogPropertyFilterType,
+ MCPModelBreakdownQuery,
MetricPropertyFilter,
PersonMetadataPropertyFilter,
PersonPropertyFilter,
@@ -272,6 +273,17 @@ class TestPropertyFilterDiscriminator(SimpleTestCase):
assert isinstance(query.properties, list)
assert type(query.properties[0]) is EventPropertyFilter
+ def test_mcp_model_breakdown_properties_use_the_discriminated_filter(self) -> None:
+ query = MCPModelBreakdownQuery.model_validate(
+ {
+ "kind": "MCPModelBreakdownQuery",
+ "properties": [{"type": "event", "key": "$mcp_llm_model", "operator": "exact"}],
+ }
+ )
+
+ assert query.properties is not None
+ assert type(query.properties[0]) is EventPropertyFilter
+
def test_serialization_round_trip_is_stable(self) -> None:
node = EventsNode(
properties=[
diff --git a/products/mcp_analytics/backend/facade/queries.py b/products/mcp_analytics/backend/facade/queries.py
index 4a1cccdc5696..f76eddad6f34 100644
--- a/products/mcp_analytics/backend/facade/queries.py
+++ b/products/mcp_analytics/backend/facade/queries.py
@@ -11,6 +11,7 @@ from products.mcp_analytics.backend.hogql_queries.dashboard_series import (
)
from products.mcp_analytics.backend.hogql_queries.harness_breakdown import MCPHarnessBreakdownQueryRunner
from products.mcp_analytics.backend.hogql_queries.missing_capabilities import MCPMissingCapabilitiesQueryRunner
+from products.mcp_analytics.backend.hogql_queries.model_breakdown import MCPModelBreakdownQueryRunner
from products.mcp_analytics.backend.hogql_queries.tool_quality_tables import (
MCPToolCategoriesQueryRunner,
MCPToolCategoryCountsQueryRunner,
@@ -31,6 +32,7 @@ from products.mcp_analytics.backend.hogql_queries.tool_tables import (
__all__ = [
"MCPHarnessBreakdownQueryRunner",
+ "MCPModelBreakdownQueryRunner",
"MCPToolCallBreakdownQueryRunner",
"MCPToolCallsAndErrorsQueryRunner",
"MCPToolCategoriesQueryRunner",
diff --git a/products/mcp_analytics/backend/hogql_queries/model_breakdown.py b/products/mcp_analytics/backend/hogql_queries/model_breakdown.py
new file mode 100644
index 000000000000..91f9c63eaf98
--- /dev/null
+++ b/products/mcp_analytics/backend/hogql_queries/model_breakdown.py
@@ -0,0 +1,111 @@
+from functools import cached_property
+from typing import TYPE_CHECKING
+
+from posthog.schema import (
+ CachedMCPModelBreakdownQueryResponse,
+ MCPModelBreakdownItem,
+ MCPModelBreakdownQuery,
+ MCPModelBreakdownQueryResponse,
+)
+
+from posthog.hogql import ast
+from posthog.hogql.parser import parse_expr, parse_select
+from posthog.hogql.property import property_to_expr
+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
+
+
+MODEL_SERIES_LIMIT = 6
+
+
+class MCPModelBreakdownQueryRunner(AnalyticsQueryRunner[MCPModelBreakdownQueryResponse]):
+ query: MCPModelBreakdownQuery
+ cached_response: CachedMCPModelBreakdownQueryResponse
+
+ 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 _where(self) -> ast.Expr:
+ 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()}),
+ ]
+ properties = list(self.query.properties or [])
+ if self.query.filterTestAccounts:
+ properties += self.team.test_account_filters or []
+ if properties:
+ exprs.append(property_to_expr(properties, self.team))
+ return ast.And(exprs=exprs)
+
+ def to_query(self) -> ast.SelectQuery | ast.SelectSetQuery:
+ return parse_select(
+ """
+ SELECT
+ if(model = 'Unknown', 'Unknown', if(model_rank <= {limit}, model, 'Other')) AS model_group,
+ sum(total_calls) AS total_calls
+ FROM (
+ SELECT
+ model,
+ total_calls,
+ row_number() OVER (ORDER BY model = 'Unknown' ASC, total_calls DESC, model ASC) AS model_rank
+ FROM (
+ SELECT
+ coalesce(nullIf(trim(toString(properties.$mcp_llm_model)), ''), 'Unknown') AS model,
+ count() AS total_calls
+ FROM events
+ WHERE {where}
+ GROUP BY model
+ )
+ )
+ GROUP BY model_group
+ ORDER BY total_calls DESC, model_group ASC
+ """,
+ placeholders={
+ "where": self._where(),
+ "limit": ast.Constant(value=MODEL_SERIES_LIMIT),
+ },
+ )
+
+ def _calculate(self) -> MCPModelBreakdownQueryResponse:
+ with tags_context(
+ product=Product.MCP_ANALYTICS,
+ feature=Feature.QUERY,
+ team_id=self.team.id,
+ name="mcp_model_breakdown_query",
+ ):
+ response = execute_hogql_query(
+ query=self.to_query(),
+ team=self.team,
+ user=self.user,
+ query_type="mcp_model_breakdown_query",
+ timings=self.timings,
+ modifiers=self.modifiers,
+ limit_context=self.limit_context,
+ )
+
+ results = [
+ MCPModelBreakdownItem(model=str(row[0]), total_calls=int(row[1] or 0)) for row in (response.results or [])
+ ]
+
+ return MCPModelBreakdownQueryResponse(
+ results=results,
+ timings=response.timings,
+ hogql=response.hogql,
+ modifiers=self.modifiers,
+ )
diff --git a/products/mcp_analytics/backend/tests/test_model_breakdown.py b/products/mcp_analytics/backend/tests/test_model_breakdown.py
new file mode 100644
index 000000000000..5cbc150526c3
--- /dev/null
+++ b/products/mcp_analytics/backend/tests/test_model_breakdown.py
@@ -0,0 +1,85 @@
+from datetime import UTC, datetime
+from typing import Any
+
+from posthog.test.base import APIBaseTest, ClickhouseTestMixin, _create_event, flush_persons_and_events
+
+from posthog.schema import DateRange, MCPModelBreakdownItem, MCPModelBreakdownQuery
+
+from products.mcp_analytics.backend.hogql_queries.model_breakdown import (
+ MODEL_SERIES_LIMIT,
+ MCPModelBreakdownQueryRunner,
+)
+from products.mcp_analytics.backend.tests import _MCPAnalyticsTeamScopedTestMixin
+
+
+class TestMCPModelBreakdownQueryRunner(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTestMixin, APIBaseTest):
+ def _emit(self, *, properties: dict[str, Any], distinct_id: str) -> None:
+ _create_event(
+ team=self.team,
+ event="$mcp_tool_call",
+ distinct_id=distinct_id,
+ timestamp=datetime.now(tz=UTC),
+ properties={"$mcp_tool_name": "query_run", **properties},
+ )
+
+ def _breakdown(self) -> dict[str, MCPModelBreakdownItem]:
+ runner = MCPModelBreakdownQueryRunner(
+ query=MCPModelBreakdownQuery(dateRange=DateRange(date_from="-90d")),
+ team=self.team,
+ )
+ return {row.model: row for row in runner.calculate().results}
+
+ def test_aggregates_models_and_unknown_calls(self) -> None:
+ self._emit(
+ distinct_id="d1",
+ properties={"$mcp_llm_model": "gpt-5.6-sol", "$mcp_llm_model_source": "client_metadata"},
+ )
+ self._emit(
+ distinct_id="d2",
+ properties={"$mcp_llm_model": "gpt-5.6-sol", "$mcp_llm_model_source": "self_reported"},
+ )
+ self._emit(distinct_id="d3", properties={"$mcp_llm_model": "claude-sonnet-5"})
+ self._emit(distinct_id="d4", properties={})
+ self._emit(distinct_id="d5", properties={"$mcp_llm_model": " "})
+ self._emit(
+ distinct_id="d6",
+ properties={"$mcp_llm_model": "Unknown", "$mcp_llm_model_source": "self_reported"},
+ )
+ flush_persons_and_events()
+
+ rows = self._breakdown()
+
+ assert rows["gpt-5.6-sol"].total_calls == 2
+ assert rows["claude-sonnet-5"].total_calls == 1
+ assert rows["Unknown"].total_calls == 3
+ assert sum(row.total_calls for row in rows.values()) == 6
+
+ def test_collapses_long_tail_into_other_without_losing_calls(self) -> None:
+ expected_total = 0
+ for index in range(MODEL_SERIES_LIMIT + 2):
+ calls = MODEL_SERIES_LIMIT + 2 - index
+ expected_total += calls
+ for call in range(calls):
+ self._emit(
+ distinct_id=f"d-{index}-{call}",
+ properties={
+ "$mcp_llm_model": f"model-{index}",
+ "$mcp_llm_model_source": "self_reported",
+ },
+ )
+ for call in range(9):
+ self._emit(
+ distinct_id=f"other-{call}",
+ properties={"$mcp_llm_model": "Other", "$mcp_llm_model_source": "self_reported"},
+ )
+ expected_total += 9
+ self._emit(distinct_id="unknown", properties={})
+ expected_total += 1
+ flush_persons_and_events()
+
+ rows = self._breakdown()
+
+ assert rows["Unknown"].total_calls == 1
+ assert rows["Other"].total_calls == 15
+ assert sum(row.total_calls for row in rows.values()) == expected_total
+ assert len([model for model in rows if model not in {"Other", "Unknown"}]) == MODEL_SERIES_LIMIT - 1
diff --git a/products/mcp_analytics/frontend/MCPAnalyticsDashboardOverview.tsx b/products/mcp_analytics/frontend/MCPAnalyticsDashboardOverview.tsx
index 074dafeb54b0..ff01a7f8d976 100644
--- a/products/mcp_analytics/frontend/MCPAnalyticsDashboardOverview.tsx
+++ b/products/mcp_analytics/frontend/MCPAnalyticsDashboardOverview.tsx
@@ -7,12 +7,14 @@ import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
import { TestAccountFilterSwitch } from 'lib/components/TestAccountFiltersSwitch'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
+import { cn } from 'lib/utils/css-classes'
import { teamLogic } from 'scenes/teamLogic'
import { McpDateFilter } from './components/McpDateFilter'
import { ActivityChart } from './dashboard/ActivityChart'
import { HarnessDonut } from './dashboard/HarnessDonut'
import { KpiTiles } from './dashboard/KpiTiles'
+import { ModelBarChart } from './dashboard/ModelBarChart'
import { NotableSessionsTable } from './dashboard/NotableSessionsTable'
import { ToolErrorRateChart } from './dashboard/ToolErrorRateChart'
import { ToolUsageChart } from './dashboard/ToolUsageChart'
@@ -30,6 +32,8 @@ export function MCPAnalyticsDashboardOverview(): JSX.Element {
sessionRowsLoading,
harnessRows,
harnessRowsLoading,
+ modelRows,
+ hasKnownModelData,
dailyActivity,
activityRowsLoading,
activityIncompleteTail,
@@ -102,7 +106,12 @@ export function MCPAnalyticsDashboardOverview(): JSX.Element {
<section data-quill>
<h2 className="mb-4 text-xl font-semibold text-primary">Usage</h2>
<div className="flex flex-col gap-[22px]">
- <div className="grid grid-cols-1 gap-[22px] lg:grid-cols-3">
+ <div
+ className={cn(
+ 'grid grid-cols-1 gap-[22px]',
+ hasKnownModelData ? 'lg:grid-cols-4' : 'lg:grid-cols-3'
+ )}
+ >
<div className="flex lg:col-span-2">
<ActivityChart
daily={dailyActivity}
@@ -114,6 +123,7 @@ export function MCPAnalyticsDashboardOverview(): JSX.Element {
/>
</div>
<HarnessDonut rows={harnessRows} loading={harnessRowsLoading} theme={theme} />
+ {hasKnownModelData ? <ModelBarChart rows={modelRows} theme={theme} /> : null}
</div>
<div className="grid grid-cols-1 gap-[22px] lg:grid-cols-2">
<ToolErrorRateChart rows={toolRows} loading={toolRowsLoading} theme={theme} />
diff --git a/products/mcp_analytics/frontend/dashboard/DashboardCards.stories.tsx b/products/mcp_analytics/frontend/dashboard/DashboardCards.stories.tsx
index c3257d562f4e..42052098b29d 100644
--- a/products/mcp_analytics/frontend/dashboard/DashboardCards.stories.tsx
+++ b/products/mcp_analytics/frontend/dashboard/DashboardCards.stories.tsx
@@ -9,6 +9,7 @@ import {
type HarnessRow,
type KPIData,
type KPIMetric,
+ type ModelRow,
type NotableSession,
type ToolDailySeries,
type ToolRow,
@@ -16,6 +17,7 @@ import {
import { ActivityChart } from './ActivityChart'
import { HarnessDonut } from './HarnessDonut'
import { KpiTiles } from './KpiTiles'
+import { ModelBarChart } from './ModelBarChart'
import { NotableSessionsTable } from './NotableSessionsTable'
import { ToolErrorRateChart } from './ToolErrorRateChart'
import { ToolUsageChart } from './ToolUsageChart'
@@ -63,6 +65,17 @@ const HARNESS_ROWS: HarnessRow[] = [
{ category: 'VS Code', total_calls: 540, errors: 12, error_rate_pct: 2.2, sessions: 120 },
]
+const MODEL_ROWS: ModelRow[] = [
+ { model: 'claude-sonnet-5', total_calls: 4200 },
+ { model: 'gpt-5.6-sol', total_calls: 3100 },
+ { model: 'claude-opus-4', total_calls: 2200 },
+ { model: 'Unknown', total_calls: 1400 },
+ { model: 'gemini-2.5-pro', total_calls: 900 },
+ { model: 'gpt-4o', total_calls: 750 },
+ { model: 'Other', total_calls: 580 },
+ { model: 'grok-3', total_calls: 320 },
+]
+
const NOTABLE_SESSIONS: NotableSession[] = [
{
rule: 'worst_error_rate',
@@ -211,6 +224,30 @@ export const ShareByHarness: Story = {
render: withTheme((theme) => <HarnessDonut rows={HARNESS_ROWS} loading={false} theme={theme} />),
}
+export const ShareByModel: Story = {
+ render: withTheme((theme) => <ModelBarChart rows={MODEL_ROWS} theme={theme} />),
+}
+
+export const ShareByModelNarrow: Story = {
+ render: () => (
+ <div className="w-80">
+ <ModelBarChart
+ rows={[
+ { model: 'Other', total_calls: 30 },
+ { model: 'example-provider/model-with-a-long-version-name', total_calls: 4200 },
+ { model: 'gpt-5.6-sol', total_calls: 3100 },
+ { model: 'Unknown', total_calls: 1400 },
+ { model: 'example-model-c', total_calls: 800 },
+ { model: 'example-model-d', total_calls: 600 },
+ { model: 'example-model-e', total_calls: 400 },
+ { model: 'example-model-f', total_calls: 1 },
+ ]}
+ theme={buildTheme()}
+ />
+ </div>
+ ),
+}
+
export const ErrorRateByTool: Story = {
render: withTheme((theme) => <ToolErrorRateChart rows={TOOL_ROWS} loading={false} theme={theme} />),
}
diff --git a/products/mcp_analytics/frontend/dashboard/ModelBarChart.tsx b/products/mcp_analytics/frontend/dashboard/ModelBarChart.tsx
new file mode 100644
index 000000000000..e9699a5ece5d
--- /dev/null
+++ b/products/mcp_analytics/frontend/dashboard/ModelBarChart.tsx
@@ -0,0 +1,109 @@
+import { useMemo } from 'react'
+
+import {
+ BarChart,
+ type BarChartConfig,
+ type ChartTheme,
+ type Series,
+ type TooltipContext,
+ useChartLayout,
+} from '@posthog/quill-charts'
+
+import { useChartConfig } from 'lib/charts/hooks'
+import { formatPercentage } from 'lib/utils/numbers'
+
+import { type ModelRow } from '../mcpDashboardOverviewLogic'
+import { Card } from './Card'
+import { ChartTooltip } from './ChartTooltip'
+import { formatNumber } from './formatters'
+import { modelColor } from './modelColors'
+
+function ModelBarLabels({ rows, totalCalls }: { rows: ModelRow[]; totalCalls: number }): JSX.Element {
+ const { scales } = useChartLayout()
+ return (
+ <>
+ {rows.map((row) => (
+ <div
+ key={row.model}
+ className="absolute left-0 right-0 flex items-center justify-between gap-2 text-xs"
+ style={{ top: (scales.x(row.model) ?? 0) - 26 }}
+ >
+ <span className="truncate" title={row.model}>
+ {row.model}
+ </span>
+ <span className="shrink-0 text-secondary tabular-nums">
+ {formatPercentage(totalCalls > 0 ? (row.total_calls / totalCalls) * 100 : 0, { compact: true })}{' '}
+ · {formatNumber(row.total_calls)} {row.total_calls === 1 ? 'call' : 'calls'}
+ </span>
+ </div>
+ ))}
+ </>
+ )
+}
+
+function renderTooltip(ctx: TooltipContext<ModelRow & { share: number }>): JSX.Element | null {
+ const entry = ctx.seriesData[0]
+ const row = entry?.series.meta
+ if (!row) {
+ return null
+ }
+ return (
+ <ChartTooltip
+ title={row.model}
+ rows={[
+ ['Calls', formatNumber(row.total_calls)],
+ ['Share', formatPercentage(row.share, { compact: true })],
+ ]}
+ />
+ )
+}
+
+export function ModelBarChart({ rows, theme }: { rows: ModelRow[]; theme: ChartTheme }): JSX.Element {
+ const totalCalls = rows.reduce((total, row) => total + row.total_calls, 0)
+ const sortedRows = useMemo(() => [...rows].sort((a, b) => b.total_calls - a.total_calls), [rows])
+ const labels = useMemo(() => sortedRows.map((row) => row.model), [sortedRows])
+ const series = useMemo<Series<ModelRow & { share: number }>[]>(
+ () => [
+ {
+ key: 'calls',
+ label: 'Calls',
+ data: sortedRows.map((row) => row.total_calls),
+ bars: sortedRows.map((row) => ({
+ label: row.model,
+ color: modelColor(theme, row.model),
+ meta: { ...row, share: totalCalls > 0 ? (row.total_calls / totalCalls) * 100 : 0 },
+ })),
+ },
+ ],
+ [sortedRows, theme, totalCalls]
+ )
+ const identifiedCalls = totalCalls - (rows.find((row) => row.model === 'Unknown')?.total_calls ?? 0)
+ const identifiedShare = totalCalls > 0 ? (identifiedCalls / totalCalls) * 100 : 0
+ const config = useChartConfig<BarChartConfig>(
+ () => ({
+ axisOrientation: 'horizontal',
+ hideXAxis: true,
+ hideYAxis: true,
+ showGrid: false,
+ showAxisLines: false,
+ showTickMarks: false,
+ margins: { left: 0, right: 0, top: 20, bottom: 0 },
+ barCornerRadius: 4,
+ bars: { bandPadding: 0.65, maxBandRange: rows.length * 40 },
+ }),
+ [rows.length]
+ )
+
+ return (
+ <Card className="flex flex-1 flex-col" title="Share of calls by model">
+ <div className="text-xs text-secondary" translate="no">
+ {formatPercentage(identifiedShare, { compact: true })} identified
+ </div>
+ <div className="flex h-80 flex-col" translate="no">
+ <BarChart series={series} labels={labels} theme={theme} config={config} tooltip={renderTooltip}>
+ <ModelBarLabels rows={sortedRows} totalCalls={totalCalls} />
+ </BarChart>
+ </div>
+ </Card>
+ )
+}
diff --git a/products/mcp_analytics/frontend/dashboard/modelColors.test.ts b/products/mcp_analytics/frontend/dashboard/modelColors.test.ts
new file mode 100644
index 000000000000..b7c90f88c8e7
--- /dev/null
+++ b/products/mcp_analytics/frontend/dashboard/modelColors.test.ts
@@ -0,0 +1,27 @@
+import { DEFAULT_CHART_COLORS } from '@posthog/quill-charts'
+
+import { modelColor } from './modelColors'
+
+const theme = { colors: [...DEFAULT_CHART_COLORS], axisColor: '#888888' }
+
+describe('modelColor', () => {
+ it.each([
+ ['gpt-4o', 'openai/gpt-4o'],
+ ['gpt-4o', 'openrouter/openai/gpt-4o'],
+ ['gpt-4o', 'openai.gpt-4o'],
+ ['claude-sonnet-4', 'us.anthropic.claude-sonnet-4'],
+ ['gemini-2.5-pro', 'google/gemini-2.5-pro'],
+ ['grok-3', 'cursor-grok-3'],
+ ['grok-3', ' Cursor Grok 3 '],
+ ['glm-4', 'z-ai/glm-4'],
+ ['o3-mini', 'openai/o3-mini'],
+ ])('keeps %s the same color as %s', (model, alias) => {
+ expect(modelColor(theme, alias)).toEqual(modelColor(theme, model))
+ })
+
+ it('keeps neutral buckets separate from models without a recognized family', () => {
+ expect(modelColor(theme, 'Unknown')).toBe(theme.axisColor)
+ expect(modelColor(theme, 'Other')).toBe(theme.axisColor)
+ expect(modelColor(theme, 'example-custom-model')).not.toBe(theme.axisColor)
+ })
+})
diff --git a/products/mcp_analytics/frontend/dashboard/modelColors.ts b/products/mcp_analytics/frontend/dashboard/modelColors.ts
new file mode 100644
index 000000000000..f4ce66a329e7
--- /dev/null
+++ b/products/mcp_analytics/frontend/dashboard/modelColors.ts
@@ -0,0 +1,45 @@
+import type { ChartTheme } from '@posthog/quill-charts'
+
+import { lightenDarkenColor, toOpaqueHex } from 'lib/utils/colors'
+import { hashCodeForString } from 'lib/utils/strings'
+
+const FAMILY_COLOR_INDEX: Record<string, number> = {
+ claude: 11,
+ gpt: 0,
+ chatgpt: 0,
+ o1: 0,
+ o3: 0,
+ o4: 0,
+ gemini: 2,
+ grok: 1,
+ glm: 3,
+ composer: 5,
+ deepseek: 7,
+ kimi: 6,
+ llama: 10,
+ mistral: 12,
+ qwen: 14,
+}
+
+const FAMILY_PATTERN = new RegExp(`(?:^|[/.:-])(${Object.keys(FAMILY_COLOR_INDEX).join('|')})(?=$|[-.0-9])`)
+
+export function modelColor(theme: ChartTheme, model: string): string | undefined {
+ const normalized = model
+ .trim()
+ .toLowerCase()
+ .replace(/[\s_]+/g, '-')
+ if (normalized === 'unknown' || normalized === 'other') {
+ return theme.axisColor
+ }
+
+ const match = FAMILY_PATTERN.exec(normalized)
+ const name = match ? normalized.slice(match.index + match[0].length - match[1].length) : normalized
+ const hash = hashCodeForString(name)
+ const index = match ? FAMILY_COLOR_INDEX[match[1]] : hash
+ const base = theme.colors[index % theme.colors.length]
+ if (!base) {
+ return theme.axisColor
+ }
+ const hex = toOpaqueHex(base)
+ return /^#[\da-f]{3}([\da-f]{3})?$/i.test(hex) ? lightenDarkenColor(hex, (hash % 5) * 8) : base
+}
diff --git a/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.test.ts b/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.test.ts
index 6c46acadbd61..5fa2640d2bcd 100644
--- a/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.test.ts
+++ b/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.test.ts
@@ -387,6 +387,32 @@ describe('mcpDashboardOverviewLogic', () => {
})
})
+ describe('model visibility', () => {
+ beforeEach(() => {
+ jest.clearAllMocks()
+ initKeaTests()
+ jest.spyOn(mockApi, 'query').mockResolvedValue({ results: [] } as any)
+ })
+
+ it('shows model data only when at least one identified model has calls', async () => {
+ const logic = mcpDashboardOverviewLogic()
+ logic.mount()
+ await expectLogic(logic).toFinishAllListeners()
+
+ logic.actions.loadModelRowsSuccess([{ model: 'Unknown', total_calls: 12 }])
+ expect(logic.values.hasKnownModelData).toBe(false)
+
+ logic.actions.loadModelRowsSuccess([{ model: 'gpt-5.6-sol', total_calls: 1 }])
+ expect(logic.values.hasKnownModelData).toBe(true)
+
+ logic.actions.loadModelRowsSuccess([
+ { model: 'Unknown', total_calls: 12 },
+ { model: 'claude-sonnet-5', total_calls: 0 },
+ ])
+ expect(logic.values.hasKnownModelData).toBe(false)
+ })
+ })
+
describe('filter wiring', () => {
beforeEach(() => {
jest.clearAllMocks()
@@ -399,8 +425,8 @@ describe('mcpDashboardOverviewLogic', () => {
}
// HogQL query nodes carry filters under `.filters`; the typed
- // MCPHarnessBreakdownQuery node carries dateRange/properties/filterTestAccounts
- // at the top level. This reads whichever shape a reload used.
+ // Typed MCP breakdown nodes carry dateRange/properties/filterTestAccounts at the
+ // top level. This reads whichever shape a reload used.
const filtersOf = (call: any): Record<string, any> => call.filters ?? call
// The users query returns a single [current_users, prior_users] row; loadUsers maps
@@ -454,11 +480,11 @@ describe('mcpDashboardOverviewLogic', () => {
}).toFinishAllListeners()
const reloads = reloadCallsSince(callsBefore)
- // Seven tiles: KPI + users + the five breakdown queries.
- expect(reloads.length).toBe(7)
- // The five breakdowns pass the raw selected range straight through.
+ // Eight tiles: KPI + users + the six breakdown queries.
+ expect(reloads.length).toBe(8)
+ // The six breakdowns pass the raw selected range straight through.
const breakdowns = reloads.filter((call) => filtersOf(call).dateRange?.date_from === '-30d')
- expect(breakdowns).toHaveLength(5)
+ expect(breakdowns).toHaveLength(6)
// The KPI and users tiles widen to an absolute doubled window so they can compare against the prior period.
const kpi = reloads.find((call) => call.query?.includes('AS bucket'))
expect(kpi?.filters.dateRange.date_from).not.toBe('-30d')
@@ -482,7 +508,7 @@ describe('mcpDashboardOverviewLogic', () => {
}
const reloads = reloadCallsSince(callsBefore)
- expect(reloads.length).toBe(7)
+ expect(reloads.length).toBe(8)
expect(reloads.every((call) => filtersOf(call).filterTestAccounts === enabled)).toBe(true)
})
@@ -495,7 +521,7 @@ describe('mcpDashboardOverviewLogic', () => {
// No explicit toggle, yet every tile filters internal users because the team default is on.
const reloads = mockApi.query.mock.calls.map((call) => call[0] as any)
- expect(reloads.length).toBeGreaterThanOrEqual(7)
+ expect(reloads.length).toBeGreaterThanOrEqual(8)
expect(reloads.every((call) => filtersOf(call).filterTestAccounts === true)).toBe(true)
})
@@ -527,7 +553,7 @@ describe('mcpDashboardOverviewLogic', () => {
}).toFinishAllListeners()
const reloads = reloadCallsSince(callsBefore)
- expect(reloads.length).toBe(7)
+ expect(reloads.length).toBe(8)
expect(
reloads.every((call) => JSON.stringify(filtersOf(call).properties) === JSON.stringify([filter]))
).toBe(true)
diff --git a/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.ts b/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.ts
index 424e5029a8c5..93afb904283f 100644
--- a/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.ts
+++ b/products/mcp_analytics/frontend/mcpDashboardOverviewLogic.ts
@@ -19,6 +19,7 @@ import {
HogQLFilters,
HogQLQueryResponse,
MCPHarnessBreakdownItem,
+ MCPModelBreakdownItem,
MCPToolCallBreakdownItem,
MCPToolCallsAndErrorsItem,
NodeKind,
@@ -193,6 +194,11 @@ export interface HarnessRow {
sessions: number
}
+export interface ModelRow {
+ model: string
+ total_calls: number
+}
+
export interface SessionRow {
session_id: string
tool_calls: number
@@ -385,11 +391,14 @@ export interface mcpDashboardOverviewLogicValues {
filterTestAccountsOverride: boolean | null
harnessRows: HarnessRow[]
harnessRowsLoading: boolean
+ hasKnownModelData: boolean
intentClusterCount: KPIMetric
interval: IntervalType
kpiIncompleteTail: boolean
kpis: KPIData
kpisLoading: boolean
+ modelRows: ModelRow[]
+ modelRowsLoading: boolean
notableSessions: NotableSession[]
propertyFilters: AnyPropertyFilter[]
queryFilters: HogQLFilters
@@ -463,6 +472,21 @@ export interface mcpDashboardOverviewLogicActions {
kpis: KPIData
payload?: void
}
+ loadModelRows: (_: void) => void
+ loadModelRowsFailure: (
+ error: string,
+ errorObject?: any
+ ) => {
+ error: string
+ errorObject?: any
+ }
+ loadModelRowsSuccess: (
+ modelRows: ModelRow[],
+ payload?: void
+ ) => {
+ modelRows: ModelRow[]
+ payload?: void
+ }
loadSessionRows: (_: void) => void
loadSessionRowsFailure: (
error: string,
@@ -588,6 +612,7 @@ export interface mcpDashboardOverviewLogicMeta {
dailyActivity: (activityRows: ActivityRow[], bucketKeys: string[]) => DailyActivity
toolDailySeries: (toolDailyRows: ToolDailyRow[], bucketKeys: string[]) => ToolDailySeries
notableSessions: (sessionRows: SessionRow[]) => NotableSession[]
+ hasKnownModelData: (modelRows: ModelRow[]) => boolean
intentClusterCount: (totalClusterCount: number) => KPIMetric
}
}
@@ -766,6 +791,22 @@ export const mcpDashboardOverviewLogic = kea<mcpDashboardOverviewLogicType>([
},
},
],
+ modelRows: [
+ [] as ModelRow[],
+ {
+ loadModelRows: async (_: void, breakpoint): Promise<ModelRow[]> => {
+ const { dateRange, properties, filterTestAccounts } = values.queryFilters
+ const response = (await api.query({
+ kind: NodeKind.MCPModelBreakdownQuery,
+ dateRange,
+ properties,
+ filterTestAccounts,
+ })) as { results?: MCPModelBreakdownItem[] }
+ breakpoint()
+ return response?.results ?? []
+ },
+ },
+ ],
activityRows: [
[] as ActivityRow[],
{
@@ -864,6 +905,10 @@ export const mcpDashboardOverviewLogic = kea<mcpDashboardOverviewLogicType>([
(s) => [s.sessionRows],
(sessionRows: SessionRow[]): NotableSession[] => pickNotableSessions(sessionRows),
],
+ hasKnownModelData: [
+ (s) => [s.modelRows],
+ (modelRows: ModelRow[]): boolean => modelRows.some((row) => row.model !== 'Unknown' && row.total_calls > 0),
+ ],
intentClusterCount: [
// The snapshot only stores the top clusters by call volume — report
// the run's true count, not the length of the truncated list.
@@ -894,6 +939,7 @@ export const mcpDashboardOverviewLogic = kea<mcpDashboardOverviewLogicType>([
actions.loadToolRows()
actions.loadSessionRows()
actions.loadHarnessRows()
+ actions.loadModelRows()
actions.loadActivityRows()
actions.loadToolDailyRows()
},
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 71eb5af5cc07..41cd67266e25 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -46540,6 +46540,46 @@ export namespace Schemas {
version?: number | null;
}
+ export interface MCPModelBreakdownItem {
+ model: string;
+ total_calls: number;
+ }
+
+ export interface MCPModelBreakdownQueryResponse {
+ /** 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: MCPModelBreakdownItem[];
+ /** Measured timings for different parts of the query generation process */
+ timings?: QueryTiming[] | null;
+ /** Connector-synced data warehouse sources referenced by this query, if any. */
+ used_data_warehouse_sources?: DataWarehouseSourceUsage[] | 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 MCPModelBreakdownQuery {
+ dateRange?: DateRange | null;
+ filterTestAccounts?: boolean | null;
+ kind?: 'MCPModelBreakdownQuery';
+ /** Modifiers used when performing the query */
+ modifiers?: HogQLQueryModifiers | null;
+ properties?: (EventPropertyFilter | PersonPropertyFilter | PersonMetadataPropertyFilter | ElementPropertyFilter | EventMetadataPropertyFilter | SessionPropertyFilter | CohortPropertyFilter | RecordingPropertyFilter | LogEntryPropertyFilter | GroupPropertyFilter | FeaturePropertyFilter | FlagPropertyFilter | HogQLPropertyFilter | EmptyPropertyFilter | DataWarehousePropertyFilter | DataWarehousePersonPropertyFilter | ErrorTrackingIssueFilter | LogPropertyFilter | MetricPropertyFilter | SpanPropertyFilter | RevenueAnalyticsPropertyFilter | AccountCustomPropertyFilter | WorkflowVariablePropertyFilter | BehavioralPropertyFilter)[] | null;
+ response?: MCPModelBreakdownQueryResponse | null;
+ tags?: QueryLogTags | null;
+ /** version of the node, used for schema migrations */
+ version?: number | null;
+ }
+
export interface MCPToolTopUserItem {
calls: number;
distinct_id: string;
@@ -47245,7 +47285,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 | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | null;
+ sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPModelBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | null;
tags?: QueryLogTags | null;
/** Variables to be subsituted into the query */
variables?: HogQLMetadataVariables;
@@ -47271,7 +47311,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 | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | null;
+ sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | CalendarHeatmapQuery | RecordingsQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPModelBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | null;
/** Start position of the editor word */
startPosition: number;
tags?: QueryLogTags | null;
@@ -73746,7 +73786,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 | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | PathsV2Query | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | PropertyValuesQuery;
+ query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | PathsV2Query | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPModelBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | 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
@@ -76012,7 +76052,7 @@ export namespace Schemas {
resolved_compare_date_range?: ResolvedDateRangeResponse | null;
/** The date range used for the query */
resolved_date_range?: ResolvedDateRangeResponse | null;
- results: MCPToolTopUserItem[];
+ results: MCPModelBreakdownItem[];
/** Measured timings for different parts of the query generation process */
timings?: QueryTiming[] | null;
/** Connector-synced data warehouse sources referenced by this query, if any. */
@@ -76034,7 +76074,7 @@ export namespace Schemas {
resolved_compare_date_range?: ResolvedDateRangeResponse | null;
/** The date range used for the query */
resolved_date_range?: ResolvedDateRangeResponse | null;
- results: MCPToolFailureItem[];
+ results: MCPToolTopUserItem[];
/** Measured timings for different parts of the query generation process */
timings?: QueryTiming[] | null;
/** Connector-synced data warehouse sources referenced by this query, if any. */
@@ -76056,7 +76096,7 @@ export namespace Schemas {
resolved_compare_date_range?: ResolvedDateRangeResponse | null;
/** The date range used for the query */
resolved_date_range?: ResolvedDateRangeResponse | null;
- results: MCPToolFailureOccurrenceItem[];
+ results: MCPToolFailureItem[];
/** Measured timings for different parts of the query generation process */
timings?: QueryTiming[] | null;
/** Connector-synced data warehouse sources referenced by this query, if any. */
@@ -76066,6 +76106,28 @@ export namespace Schemas {
}
export interface QueryResponseAlternative100 {
+ /** 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: MCPToolFailureOccurrenceItem[];
+ /** Measured timings for different parts of the query generation process */
+ timings?: QueryTiming[] | null;
+ /** Connector-synced data warehouse sources referenced by this query, if any. */
+ used_data_warehouse_sources?: DataWarehouseSourceUsage[] | 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 QueryResponseAlternative101 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76088,7 +76150,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative101 {
+ export interface QueryResponseAlternative102 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76110,7 +76172,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative102 {
+ export interface QueryResponseAlternative103 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76134,7 +76196,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative103 {
+ export interface QueryResponseAlternative104 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76156,7 +76218,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative104 {
+ export interface QueryResponseAlternative105 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76178,7 +76240,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative105 {
+ export interface QueryResponseAlternative106 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76200,7 +76262,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative106 {
+ export interface QueryResponseAlternative107 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76222,7 +76284,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative107 {
+ export interface QueryResponseAlternative108 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76244,7 +76306,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative108 {
+ export interface QueryResponseAlternative109 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76266,7 +76328,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative109 {
+ export interface QueryResponseAlternative110 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76288,7 +76350,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative110 {
+ export interface QueryResponseAlternative111 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Whether more reports exist past this page. */
@@ -76312,7 +76374,7 @@ export namespace Schemas {
warnings?: (DataWarehouseSyncWarning | AccessControlFilterWarning)[] | null;
}
- export interface QueryResponseAlternative111 {
+ export interface QueryResponseAlternative112 {
/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */
error?: string | null;
/** Generated HogQL query. */
@@ -76334,18 +76396,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 | QueryResponseAlternative12 | QueryResponseAlternative13 | QueryResponseAlternative14 | QueryResponseAlternative15 | QueryResponseAlternative16 | QueryResponseAlternative17 | QueryResponseAlternative18 | QueryResponseAlternative19 | QueryResponseAlternative20 | QueryResponseAlternative21 | QueryResponseAlternative22 | QueryResponseAlternative23 | QueryResponseAlternative24 | QueryResponseAlternative25 | QueryResponseAlternative26 | QueryResponseAlternative28 | QueryResponseAlternative29 | QueryResponseAlternative30 | QueryResponseAlternative31 | QueryResponseAlternative32 | QueryResponseAlternative33 | QueryResponseAlternative34 | QueryResponseAlternative35 | QueryResponseAlternative36 | QueryResponseAlternative37 | unknown | QueryResponseAlternative38 | QueryResponseAlternative39 | QueryResponseAlternative40 | QueryResponseAlternative41 | QueryResponseAlternative42 | QueryResponseAlternative43 | QueryResponseAlternative44 | QueryResponseAlternative45 | QueryResponseAlternative46 | QueryResponseAlternative47 | QueryResponseAlternative48 | QueryResponseAlternative49 | QueryResponseAlternative50 | QueryResponseAlternative51 | QueryResponseAlternative52 | QueryResponseAlternative54 | QueryResponseAlternative55 | QueryResponseAlternative56 | QueryResponseAlternative58 | QueryResponseAlternative59 | QueryResponseAlternative60 | QueryResponseAlternative61 | QueryResponseAlternative62 | QueryResponseAlternative63 | QueryResponseAlternative64 | QueryResponseAlternative65 | QueryResponseAlternative66 | QueryResponseAlternative68 | QueryResponseAlternative69 | QueryResponseAlternative70 | QueryResponseAlternative71 | QueryResponseAlternative72 | QueryResponseAlternative73 | QueryResponseAlternative74 | QueryResponseAlternative75 | QueryResponseAlternative76 | QueryResponseAlternative77 | QueryResponseAlternative78 | QueryResponseAlternative79 | QueryResponseAlternative80 | QueryResponseAlternative81 | QueryResponseAlternative82 | QueryResponseAlternative83 | QueryResponseAlternative86 | QueryResponseAlternative87 | QueryResponseAlternative88 | QueryResponseAlternative89 | QueryResponseAlternative90 | QueryResponseAlternative91 | QueryResponseAlternative92 | QueryResponseAlternative93 | QueryResponseAlternative94 | QueryResponseAlternative95 | QueryResponseAlternative96 | QueryResponseAlternative97 | QueryResponseAlternative98 | QueryResponseAlternative99 | QueryResponseAlternative100 | QueryResponseAlternative101 | QueryResponseAlternative102 | QueryResponseAlternative103 | QueryResponseAlternative104 | QueryResponseAlternative105 | QueryResponseAlternative106 | QueryResponseAlternative107 | QueryResponseAlternative108 | QueryResponseAlternative109 | QueryResponseAlternative110 | QueryResponseAlternative111;
+ export type QueryResponseAlternative = { [key: string]: unknown } | QueryResponseAlternative1 | QueryResponseAlternative2 | QueryResponseAlternative3 | QueryResponseAlternative4 | QueryResponseAlternative5 | QueryResponseAlternative6 | QueryResponseAlternative7 | QueryResponseAlternative8 | QueryResponseAlternative9 | QueryResponseAlternative10 | QueryResponseAlternative11 | QueryResponseAlternative12 | QueryResponseAlternative13 | QueryResponseAlternative14 | QueryResponseAlternative15 | QueryResponseAlternative16 | QueryResponseAlternative17 | QueryResponseAlternative18 | QueryResponseAlternative19 | QueryResponseAlternative20 | QueryResponseAlternative21 | QueryResponseAlternative22 | QueryResponseAlternative23 | QueryResponseAlternative24 | QueryResponseAlternative25 | QueryResponseAlternative26 | QueryResponseAlternative28 | QueryResponseAlternative29 | QueryResponseAlternative30 | QueryResponseAlternative31 | QueryResponseAlternative32 | QueryResponseAlternative33 | QueryResponseAlternative34 | QueryResponseAlternative35 | QueryResponseAlternative36 | QueryResponseAlternative37 | unknown | QueryResponseAlternative38 | QueryResponseAlternative39 | QueryResponseAlternative40 | QueryResponseAlternative41 | QueryResponseAlternative42 | QueryResponseAlternative43 | QueryResponseAlternative44 | QueryResponseAlternative45 | QueryResponseAlternative46 | QueryResponseAlternative47 | QueryResponseAlternative48 | QueryResponseAlternative49 | QueryResponseAlternative50 | QueryResponseAlternative51 | QueryResponseAlternative52 | QueryResponseAlternative54 | QueryResponseAlternative55 | QueryResponseAlternative56 | QueryResponseAlternative58 | QueryResponseAlternative59 | QueryResponseAlternative60 | QueryResponseAlternative61 | QueryResponseAlternative62 | QueryResponseAlternative63 | QueryResponseAlternative64 | QueryResponseAlternative65 | QueryResponseAlternative66 | QueryResponseAlternative68 | QueryResponseAlternative69 | QueryResponseAlternative70 | QueryResponseAlternative71 | QueryResponseAlternative72 | QueryResponseAlternative73 | QueryResponseAlternative74 | QueryResponseAlternative75 | QueryResponseAlternative76 | QueryResponseAlternative77 | QueryResponseAlternative78 | QueryResponseAlternative79 | QueryResponseAlternative80 | QueryResponseAlternative81 | QueryResponseAlternative82 | QueryResponseAlternative83 | QueryResponseAlternative86 | QueryResponseAlternative87 | QueryResponseAlternative88 | QueryResponseAlternative89 | QueryResponseAlternative90 | QueryResponseAlternative91 | QueryResponseAlternative92 | QueryResponseAlternative93 | QueryResponseAlternative94 | QueryResponseAlternative95 | QueryResponseAlternative96 | QueryResponseAlternative97 | QueryResponseAlternative98 | QueryResponseAlternative99 | QueryResponseAlternative100 | QueryResponseAlternative101 | QueryResponseAlternative102 | QueryResponseAlternative103 | QueryResponseAlternative104 | QueryResponseAlternative105 | QueryResponseAlternative106 | QueryResponseAlternative107 | QueryResponseAlternative108 | QueryResponseAlternative109 | QueryResponseAlternative110 | QueryResponseAlternative111 | QueryResponseAlternative112;
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 | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | PathsV2Query | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | PropertyValuesQuery;
+ query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | PathsV2Query | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPModelBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | PropertyValuesQuery;
}
export interface QueryUpgradeResponse {
- query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | PathsV2Query | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | PropertyValuesQuery;
+ query: EventsNode | ActionsNode | PersonsNode | DataWarehouseNode | FunnelsDataWarehouseNode | LifecycleDataWarehouseNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | SessionAttributionExplorerQuery | ErrorTrackingQuery | ErrorTrackingSimilarIssuesQuery | ErrorTrackingFingerprintProjectionQuery | ErrorTrackingBreakdownsQuery | ErrorTrackingReleasesQuery | ErrorTrackingIssueCorrelationQuery | ExperimentFunnelsQuery | ExperimentTrendsQuery | ExperimentQuery | ExperimentExposureQuery | DocumentSimilarityQuery | WebOverviewQuery | WebStatsTableQuery | WebExternalClicksTableQuery | WebBotsTableQuery | WebAgentAnalyticsQuery | WebGoalsQuery | WebVitalsQuery | WebVitalsPathBreakdownQuery | WebPageURLSearchQuery | WebAnalyticsExternalSummaryQuery | WebNotableChangesQuery | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | DataVisualizationNode | DataTableNode | SavedInsightNode | InsightVizNode | TrendsQuery | FunnelsQuery | RetentionQuery | PathsQuery | PathsV2Query | StickinessQuery | LifecycleQuery | FunnelCorrelationQuery | DatabaseSchemaQuery | RecordingsQuery | LogsQuery | LogAttributesQuery | LogValuesQuery | MetricsQuery | TraceSpansQuery | TraceSpansAggregationQuery | TraceSpansTreeQuery | TraceSpansAttributeBreakdownQuery | SuggestedQuestionsQuery | TeamTaxonomyQuery | EventTaxonomyQuery | ActorsPropertyTaxonomyQuery | TracesQuery | TraceQuery | SessionQuery | TraceNeighborsQuery | VectorSearchQuery | UsageMetricsQuery | AccountsQuery | AccountsTableQuery | EndpointsUsageOverviewQuery | EndpointsUsageTableQuery | EndpointsUsageTrendsQuery | MCPToolCallBreakdownQuery | MCPToolCallsAndErrorsQuery | MCPHarnessBreakdownQuery | MCPModelBreakdownQuery | MCPToolTopUsersQuery | MCPToolFailuresQuery | MCPToolFailureOccurrencesQuery | MCPToolStatsQuery | MCPToolDailyStatsQuery | MCPToolQualityRowsQuery | MCPToolQualityDailyStatsQuery | MCPToolCategoryCountsQuery | MCPToolCategoriesQuery | MCPToolCategoryMapQuery | MCPToolDescriptionsQuery | MCPToolSampleIntentsQuery | MCPToolNeighborsQuery | MCPMissingCapabilitiesQuery | PropertyValuesQuery;
}
export interface QuotaResourceLimit {