:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(mcp-analytics): surface missing capability reports (#79181)
Lucas Fariac76630d1c9e5
diff --git a/docs/published/docs/mcp-analytics/missing-capability.mdx b/docs/published/docs/mcp-analytics/missing-capability.mdxnew file mode 100644index 000000000000..c206bdd2dae0--- /dev/null+++ b/docs/published/docs/mcp-analytics/missing-capability.mdx@@ -0,0 +1,31 @@+---+title: MCP missing capability reports+sidebar: Docs+showTitle: true+---++Missing capability reports show what agents tried to do when your MCP server did not expose a suitable tool.+Each report keeps the agent's own description, the MCP client, the person, and the time it was filed.++## Enable reports++From your MCP server's project root, run the MCP analytics Wizard command shown on the **Missing capabilities** tab.+The setup agent enables missing capability reporting for you.++To configure it manually, set `reportMissing: true` when you initialize the PostHog MCP SDK.+This adds a virtual `get_more_tools` tool that agents can call when the available tools cannot complete a task.+The agent's description is captured as a `$mcp_missing_capability` event.++Enabling the setting does not create reports by itself.+A report appears only after an agent calls `get_more_tools`.++## Review reports++Open **MCP analytics** and select **Missing capabilities**.+Reports appear newest first, with the agent's request, client, person, and timestamp.++Use the date range to focus on a period, or search the request text for a capability or workflow.+Use the results to decide which tools, actions, or parameters would remove the most important gaps in your server.++Reports can omit the client name when the SDK cannot identify it.+Those rows appear as **Unknown client** instead of being grouped with a known client.diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 0107ffd203d4..18a71f65065f 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -7405,9 +7405,9 @@ snapshots:scenes-app-max-ai-replay-vision-scan-widget--with-skipped--light:hash: v1.k794b7964.c543228b0f31abb2aae3b274819abdee4ba6a89fb3324fc6aaa2b18aefee5815.S9etTEY8oT2JhOgLO5hdc6VqvbvYhD-nU4P1WKh24ygscenes-app-mcp-analytics--activity--dark:- hash: v1.k794b7964.0b4955189ddc9ad0cf917b5e0e3c22ae7b2c4cdfc6873dfbbee30ef73e8f92e5.2jq_QHK0JmQFsnlPwxz2530q8kG3gBm-3TLdefrRIGk+ hash: v1.k794b7964.e43f01115e658ff2fea09722ea5cb300bbbf69c2103208d69804d34502a35f62.aQyYxy1CZmD1iLTeyjuJ_6k3g1rmepel-hBO4QH_5AIscenes-app-mcp-analytics--activity--light:- hash: v1.k794b7964.e15fa47e36d13e91df35f120207505907b20dfa6292cf5ded5ac7ab60772cd56.h7NkyFvlZKnQFvFk5fmltWi25sVeipMcoZt7THbqxGg+ hash: v1.k794b7964.dd75d6391ed61626117b8663455371f781bf194a29d0ebf20fb6c34d82703447.81TtCF9h-4bTKpiXUIAGV_qvAspkri9Ro014hr9uTIAscenes-app-mcp-analytics--dashboard--dark:hash: v1.k794b7964.28e8830f28c77c1815afd94747a5f8633a0ff6dff72e7e8a104a84e3d131730c.-r295uHlJ_mpxJzjEHlMP9iM4FsOwaWVrRcfaW-Q4zMscenes-app-mcp-analytics--dashboard--light:@@ -7417,9 +7417,9 @@ snapshots:scenes-app-mcp-analytics--dashboard-with-menu-bar--light:hash: v1.k794b7964.fed2fab63229808ff080f6fbaba0ac2b62a142115aef7cabf7cf76e9b76df4c1.3RjkxSUK0AH36KxmtfENWCEu7H3bwvKzz0kyYQYcjGEscenes-app-mcp-analytics--intent-clustering--dark:- hash: v1.k794b7964.e56c2b8b08a970df9e0fe9d6d618092c631d23d7c72a22b32bf571a663fcf9e9.84fphIJJ3z1hojod_YDTvqtsP_PexYwYUmbFcqCw-xQ+ hash: v1.k794b7964.9549b853f80d754b9d6ccf17ab144d24218143200c90df7af687e184e7de5329.Er1_HM8avmrqmulj2hCLnkp98-HeuRvF5ed3j-_jS2Ascenes-app-mcp-analytics--intent-clustering--light:- hash: v1.k794b7964.0496d3f05595d775c03763449254e74d495aeafee448579dae3a3a7e6cc57410.VRPMdh1JoIxzB79GzZM8yPe4SA9YW_02HQJNJxEHtL0+ hash: v1.k794b7964.82fd6a9108a34ff8808b23b9c1e9255dcbe4f38562bb9e99333877dd303c08b2.qjDLxTHFZT3vcTHmPeG35-orU88GSS277RR2DdXxBdwscenes-app-mcp-analytics--sessions--dark:hash: v1.k794b7964.3864a51ed4b403ac8a9751359ab61a33acd096fc6a6f5c7ee3c505030d7edeab.pAAJhar-K5LVT9KVYZty1go-I28ts3keaKKIshB2HGYscenes-app-mcp-analytics--sessions--light:@@ -7460,6 +7460,10 @@ snapshots:hash: v1.k794b7964.a4f65ae92d92d3600674689dc61f5ba834aac470154fb26b82821cb17b12cada.vAYLkto1-GBp1WeHETUeB5R0Pljn-RwHDW9h3bib1KQscenes-app-mcp-analytics-dashboard-cards--share-by-harness--light:hash: v1.k794b7964.c5eae070d2b0728ce676a8248650123f9a153ec8a9b9052f119d28b82e112e75.CdS-40DZGyT0t1Th9qh7g6Cc9Dgt__lEEujO7OXp4IM+ 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:+ hash: v1.k794b7964.428de360c05be96069166fcf43a1b02ae48d7dea500d8f9caf9371fbc7ab8bac.LfbPCIHegnJwRBMnkSmipZH3IutsBu1DYRFH3tQGNRUscenes-app-mcp-analytics-tool-quality-charts--in-progress-bucket--dark:hash: v1.k794b7964.fa9478dce4b4db3cfdcb27cb2b14f0abd96aedc05e187d1d0774522ab3679289.SpD3JWHUFWdb1rpxDfYK9S1_26MTfdpbZSgud5ECVH8scenes-app-mcp-analytics-tool-quality-charts--in-progress-bucket--light:diff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex 5aeead600dc3..2d060b63e76f 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -196,6 +196,7 @@ export const productRoutes: Record<string, [string, string]> = {'/mcp-analytics/tool-quality': ['MCPAnalytics', 'mcpAnalyticsToolQuality'],'/mcp-analytics/tool-quality/:toolName': ['MCPAnalyticsToolDetail', 'mcpAnalyticsTool'],'/mcp-analytics/intent-clustering': ['MCPAnalytics', 'mcpAnalyticsIntentClustering'],+ '/mcp-analytics/missing-capabilities': ['MCPAnalytics', 'mcpAnalyticsMissingCapabilities'],'/mcp-analytics/notifications': ['MCPAnalytics', 'mcpAnalyticsNotifications'],'/mcp-servers/server/:id': ['McpGatewayServer', 'mcpGatewayServer'],'/mcp-servers/agent/:id': ['McpGatewayAgent', 'mcpGatewayAgent'],@@ -1333,6 +1334,7 @@ export const productUrls = {mcpAnalyticsToolQuality: (): string => '/mcp-analytics/tool-quality',mcpAnalyticsTool: (toolName: string): string => `/mcp-analytics/tool-quality/${encodeURIComponent(toolName)}`,mcpAnalyticsIntentClustering: (): string => '/mcp-analytics/intent-clustering',+ mcpAnalyticsMissingCapabilities: (): string => '/mcp-analytics/missing-capabilities',mcpAnalyticsNotifications: (): string => '/mcp-analytics/notifications',mcpGateway: (): string => '/mcp-servers',mcpGatewayTab: (tab: string): string => `/mcp-servers/${tab}`,diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex f2b4871eea61..e49ad75d7259 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -1776,6 +1776,9 @@},{"$ref": "#/definitions/MCPToolNeighborsQuery"+ },+ {+ "$ref": "#/definitions/MCPMissingCapabilitiesQuery"}],"required": ["kind"],@@ -9833,6 +9836,111 @@],"type": "object"},+ "CachedMCPMissingCapabilitiesQueryResponse": {+ "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"+ },+ "has_next": {+ "description": "Whether more reports exist past this page.",+ "type": "boolean"+ },+ "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/MCPMissingCapabilitiesItem"+ },+ "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",+ "has_next",+ "is_cached",+ "last_refresh",+ "next_allowed_client_refresh",+ "results",+ "timezone"+ ],+ "type": "object"+ },"CachedMCPToolCallBreakdownQueryResponse": {"additionalProperties": false,"properties": {@@ -32151,6 +32259,146 @@"required": ["results"],"type": "object"},+ "MCPMissingCapabilitiesItem": {+ "additionalProperties": false,+ "description": "One missing-capability report: a capability an agent asked for and could not get.",+ "properties": {+ "distinct_id": {+ "type": "string"+ },+ "harness": {+ "description": "Resolved client label, the client's own self-reported name when unrecognized, or \"Unidentified client\" when the report carried no client identity at all.",+ "type": "string"+ },+ "intent": {+ "description": "The agent's own words for the capability it wanted, from $mcp_intent.",+ "type": "string"+ },+ "person_properties": {+ "description": "JSON-encoded person email/name for display; \"{}\" when neither resolved.",+ "type": "string"+ },+ "session_id": {+ "description": "Conversation id: $mcp_session_id, falling back to $session_id; empty when neither is set.",+ "type": "string"+ },+ "timestamp": {+ "type": "string"+ }+ },+ "required": ["timestamp", "intent", "harness", "session_id", "distinct_id", "person_properties"],+ "type": "object"+ },+ "MCPMissingCapabilitiesQuery": {+ "additionalProperties": false,+ "description": "Chronological feed of capabilities that agents asked for but could not access.",+ "properties": {+ "dateRange": {+ "$ref": "#/definitions/DateRange"+ },+ "kind": {+ "const": "MCPMissingCapabilitiesQuery",+ "type": "string"+ },+ "limit": {+ "$ref": "#/definitions/integer",+ "description": "Page size; defaults to 100, capped at 500."+ },+ "modifiers": {+ "$ref": "#/definitions/HogQLQueryModifiers",+ "description": "Modifiers used when performing the query"+ },+ "offset": {+ "$ref": "#/definitions/integer",+ "description": "Reports to skip before returning results. Combine with limit to page through them; the response's has_next flag indicates whether more remain."+ },+ "response": {+ "$ref": "#/definitions/MCPMissingCapabilitiesQueryResponse"+ },+ "search": {+ "description": "Case-insensitive substring match over the report text.",+ "type": "string"+ },+ "tags": {+ "$ref": "#/definitions/QueryLogTags"+ },+ "version": {+ "description": "version of the node, used for schema migrations",+ "type": "number"+ }+ },+ "required": ["kind"],+ "type": "object"+ },+ "MCPMissingCapabilitiesQueryResponse": {+ "additionalProperties": false,+ "properties": {+ "error": {+ "description": "Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.",+ "type": "string"+ },+ "has_next": {+ "description": "Whether more reports exist past this page.",+ "type": "boolean"+ },+ "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/MCPMissingCapabilitiesItem"+ },+ "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": ["has_next", "results"],+ "type": "object"+ },"MCPToolCallBreakdownItem": {"additionalProperties": false,"description": "One tool's call count within one interval bucket.",@@ -37987,6 +38235,7 @@"MCPToolDescriptionsQuery","MCPToolSampleIntentsQuery","MCPToolNeighborsQuery",+ "MCPMissingCapabilitiesQuery","PropertyValuesQuery"],"type": "string"@@ -48324,6 +48573,75 @@"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"+ },+ "has_next": {+ "description": "Whether more reports exist past this page.",+ "type": "boolean"+ },+ "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/MCPMissingCapabilitiesItem"+ },+ "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": ["has_next", "results"],+ "type": "object"+ },{"additionalProperties": false,"properties": {@@ -48693,6 +49011,9 @@{"$ref": "#/definitions/MCPToolNeighborsQuery"},+ {+ "$ref": "#/definitions/MCPMissingCapabilitiesQuery"+ },{"$ref": "#/definitions/PropertyValuesQuery"}diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex 56b15ca341aa..da0c7ca4295c 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -212,6 +212,7 @@ export enum NodeKind {MCPToolDescriptionsQuery = 'MCPToolDescriptionsQuery',MCPToolSampleIntentsQuery = 'MCPToolSampleIntentsQuery',MCPToolNeighborsQuery = 'MCPToolNeighborsQuery',+ MCPMissingCapabilitiesQuery = 'MCPMissingCapabilitiesQuery',// Property valuesPropertyValuesQuery = 'PropertyValuesQuery',@@ -298,6 +299,7 @@ export type AnyDataNode =| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery/*** @discriminator kind@@ -431,6 +433,7 @@ export type QuerySchema =| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery// Property values| PropertyValuesQuery@@ -3710,6 +3713,42 @@ export interface MCPToolNeighborsQuery extends DataNode<MCPToolNeighborsQueryResexport type CachedMCPToolNeighborsQueryResponse = CachedQueryResponse<MCPToolNeighborsQueryResponse>+/** One missing-capability report: a capability an agent asked for and could not get. */+export interface MCPMissingCapabilitiesItem {+ timestamp: string+ /** The agent's own words for the capability it wanted, from $mcp_intent. */+ intent: string+ /** Resolved client label, the client's own self-reported name when unrecognized, or+ * "Unidentified client" when the report carried no client identity at all. */+ harness: string+ /** Conversation id: $mcp_session_id, falling back to $session_id; empty when neither is set. */+ session_id: string+ distinct_id: string+ /** JSON-encoded person email/name for display; "{}" when neither resolved. */+ person_properties: string+}++export interface MCPMissingCapabilitiesQueryResponse extends AnalyticsQueryResponseBase {+ results: MCPMissingCapabilitiesItem[]+ /** Whether more reports exist past this page. */+ has_next: boolean+}++/** Chronological feed of capabilities that agents asked for but could not access. */+export interface MCPMissingCapabilitiesQuery extends DataNode<MCPMissingCapabilitiesQueryResponse> {+ kind: NodeKind.MCPMissingCapabilitiesQuery+ dateRange?: DateRange+ /** Case-insensitive substring match over the report text. */+ search?: string+ /** Page size; defaults to 100, capped at 500. */+ limit?: integer+ /** Reports to skip before returning results. Combine with limit to page through them;+ * the response's has_next flag indicates whether more remain. */+ offset?: integer+}++export type CachedMCPMissingCapabilitiesQueryResponse = CachedQueryResponse<MCPMissingCapabilitiesQueryResponse>+export enum WebStatsBreakdown {Page = 'Page',InitialPage = 'InitialPage',diff --git a/frontend/src/scenes/saved-insights/insightTypesMetadata.tsx b/frontend/src/scenes/saved-insights/insightTypesMetadata.tsxindex c6ca67b533d4..e316cabaaa5c 100644--- a/frontend/src/scenes/saved-insights/insightTypesMetadata.tsx+++ b/frontend/src/scenes/saved-insights/insightTypesMetadata.tsx@@ -639,6 +639,12 @@ export const QUERY_TYPES_METADATA: Record<NodeKind, InsightTypeMetadata> = {icon: IconPieChart,inMenu: false,},+ [NodeKind.MCPMissingCapabilitiesQuery]: {+ name: 'MCP missing capabilities',+ description: 'Capabilities agents asked an MCP server for and could not get.',+ icon: IconPieChart,+ inMenu: false,+ },[NodeKind.MCPToolStatsQuery]: {name: 'MCP tool stats',description: 'Summary stats for a single MCP tool.',diff --git a/posthog/api/query.py b/posthog/api/query.pyindex 96dcdb06c59a..ee364811c3d8 100644--- a/posthog/api/query.py+++ b/posthog/api/query.py@@ -178,6 +178,7 @@ _QUERY_KIND_SCOPES: dict[str, list[str]] = {"MetricsQuery": ["metrics:read"],# Both scopes listed: this result replaces the view's default query:read# rather than adding to it, and a token must hold every listed scope.+ "MCPMissingCapabilitiesQuery": ["query:read", "mcp_analytics:read"],"MCPToolFailureOccurrencesQuery": ["query:read", "mcp_analytics:read"],"MCPToolCallsAndErrorsQuery": ["query:read", "mcp_analytics:read"],"MCPToolCallBreakdownQuery": ["query:read", "mcp_analytics:read"],diff --git a/posthog/clickhouse/query_tagging.py b/posthog/clickhouse/query_tagging.pyindex bb16ef09faa6..74172561f230 100644--- a/posthog/clickhouse/query_tagging.py+++ b/posthog/clickhouse/query_tagging.py@@ -298,6 +298,7 @@ def kind_fallback_tags(kind: NodeKind) -> FallbackTags | None:| NodeKind.MCP_TOOL_DESCRIPTIONS_QUERY| NodeKind.MCP_TOOL_SAMPLE_INTENTS_QUERY| NodeKind.MCP_TOOL_NEIGHBORS_QUERY+ | NodeKind.MCP_MISSING_CAPABILITIES_QUERY):return {"product": Product.MCP_ANALYTICS}case (diff --git a/posthog/clickhouse/test/test_query_tagging.py b/posthog/clickhouse/test/test_query_tagging.pyindex 62ede1f91fce..9908fcac4d33 100644--- a/posthog/clickhouse/test/test_query_tagging.py+++ b/posthog/clickhouse/test/test_query_tagging.py@@ -590,6 +590,11 @@ class TestAddFallbackQueryTags(BaseTest):assert tags.product == Product.PRODUCT_ANALYTICSassert tags.feature is None+ def test_missing_capabilities_kind_attributes_to_mcp_analytics(self):+ tags = QueryTags(query_type="MCPMissingCapabilitiesQuery")+ add_fallback_query_tags(tags)+ assert tags.product == Product.MCP_ANALYTICS+def test_mcp_source_fills_product_only(self):tags = QueryTags(source="mcp")add_fallback_query_tags(tags)diff --git a/posthog/hogql_queries/query_runner.py b/posthog/hogql_queries/query_runner.pyindex 1d442d734fb3..c6c16de22321 100644--- a/posthog/hogql_queries/query_runner.py+++ b/posthog/hogql_queries/query_runner.py@@ -52,6 +52,7 @@ from posthog.schema import (MarketingAnalyticsAggregatedQuery,MarketingAnalyticsTableQuery,MCPHarnessBreakdownQuery,+ MCPMissingCapabilitiesQuery,MCPToolCallBreakdownQuery,MCPToolCallsAndErrorsQuery,MCPToolCategoriesQuery,@@ -474,6 +475,7 @@ RunnableQueryNode = Union[MCPToolDescriptionsQuery,MCPToolSampleIntentsQuery,MCPToolNeighborsQuery,+ MCPMissingCapabilitiesQuery,]@@ -1166,6 +1168,17 @@ def get_query_runner(modifiers=modifiers,user=user,)+ if kind == "MCPMissingCapabilitiesQuery":+ from products.mcp_analytics.backend.facade.queries import MCPMissingCapabilitiesQueryRunner++ return MCPMissingCapabilitiesQueryRunner(+ query=cast(MCPMissingCapabilitiesQuery | dict[str, Any], query),+ team=team,+ timings=timings,+ limit_context=limit_context,+ modifiers=modifiers,+ user=user,+ )if kind == "MCPToolCallBreakdownQuery":from products.mcp_analytics.backend.facade.queries import MCPToolCallBreakdownQueryRunnerdiff --git a/posthog/schema.py b/posthog/schema.pyindex 8bbaf0a0d574..1cd86cd6cfa2 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -1760,6 +1760,34 @@ class LogAttributeResult(BaseModel):propertyFilterType: str = Field(..., description="Either 'log_attribute' or 'log_resource_attribute'.")+class MCPMissingCapabilitiesItem(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ distinct_id: str+ harness: str = Field(+ ...,+ description=(+ "Resolved client label, the client's own self-reported name when"+ ' unrecognized, or "Unidentified client" when the report carried no client'+ " identity at all."+ ),+ )+ intent: str = Field(+ ...,+ description=("The agent's own words for the capability it wanted, from $mcp_intent."),+ )+ person_properties: str = Field(+ ...,+ description=('JSON-encoded person email/name for display; "{}" when neither resolved.'),+ )+ session_id: str = Field(+ ...,+ description=("Conversation id: $mcp_session_id, falling back to $session_id; empty when neither is set."),+ )+ timestamp: str++class MCPToolCategoryItem(BaseModel):model_config = ConfigDict(extra="forbid",@@ -12034,6 +12062,65 @@ class CachedMCPHarnessBreakdownQueryResponse(BaseModel):)+class CachedMCPMissingCapabilitiesQueryResponse(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."+ ),+ )+ has_next: bool = Field(..., description="Whether more reports exist past this page.")+ 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[MCPMissingCapabilitiesItem]+ 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",@@ -17702,6 +17789,54 @@ class MCPHarnessBreakdownQueryResponse(BaseModel):)+class MCPMissingCapabilitiesQueryResponse(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."+ ),+ )+ has_next: bool = Field(..., description="Whether more reports exist past this page.")+ 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[MCPMissingCapabilitiesItem]+ 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",@@ -23663,6 +23798,54 @@ class QueryResponseAlternative111(BaseModel):class QueryResponseAlternative112(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."+ ),+ )+ has_next: bool = Field(..., description="Whether more reports exist past this page.")+ 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[MCPMissingCapabilitiesItem]+ 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 QueryResponseAlternative113(BaseModel):model_config = ConfigDict(extra="forbid",)@@ -26428,6 +26611,30 @@ class MCPHarnessBreakdownQuery(BaseModel):version: float | None = Field(default=None, description="version of the node, used for schema migrations")+class MCPMissingCapabilitiesQuery(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ dateRange: DateRange | None = None+ kind: Literal["MCPMissingCapabilitiesQuery"] = "MCPMissingCapabilitiesQuery"+ limit: int | None = Field(default=None, description="Page size; defaults to 100, capped at 500.")+ modifiers: HogQLQueryModifiers | None = Field(default=None, description="Modifiers used when performing the query")+ offset: int | None = Field(+ default=None,+ description=(+ "Reports to skip before returning results. Combine with limit to page"+ " through them; the response's has_next flag indicates whether more remain."+ ),+ )+ response: MCPMissingCapabilitiesQueryResponse | None = None+ search: str | None = Field(+ default=None,+ description="Case-insensitive substring match over the report text.",+ )+ 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",@@ -29871,6 +30078,7 @@ class QueryResponseAlternative(| QueryResponseAlternative110| QueryResponseAlternative111| QueryResponseAlternative112+ | QueryResponseAlternative113]):root: (@@ -29982,6 +30190,7 @@ class QueryResponseAlternative(| QueryResponseAlternative110| QueryResponseAlternative111| QueryResponseAlternative112+ | QueryResponseAlternative113)@@ -30958,6 +31167,7 @@ class HogQLAutocomplete(BaseModel):| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| None) = Field(default=None,@@ -31083,6 +31293,7 @@ class HogQLMetadata(BaseModel):| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| None) = Field(default=None,@@ -31228,6 +31439,7 @@ class MaxInsightContext(BaseModel):| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| PropertyValuesQuery) = Field(..., discriminator="kind")type: Literal["insight"] = "insight"@@ -31369,6 +31581,7 @@ class QueryRequest(BaseModel):| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| PropertyValuesQuery) = Field(...,@@ -31502,6 +31715,7 @@ class QuerySchemaRoot(| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| PropertyValuesQuery]):@@ -31605,6 +31819,7 @@ class QuerySchemaRoot(| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| PropertyValuesQuery) = Field(..., discriminator="kind")@@ -31713,6 +31928,7 @@ class QueryUpgradeRequest(BaseModel):| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| PropertyValuesQuery) = Field(..., discriminator="kind")@@ -31821,6 +32037,7 @@ class QueryUpgradeResponse(BaseModel):| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| PropertyValuesQuery) = Field(..., discriminator="kind")@@ -32115,6 +32332,7 @@ class VisualizationArtifactContent(BaseModel):| MCPToolDescriptionsQuery| MCPToolSampleIntentsQuery| MCPToolNeighborsQuery+ | MCPMissingCapabilitiesQuery| PropertyValuesQuery)diff --git a/posthog/schema_enums.py b/posthog/schema_enums.pyindex 63224a616668..b29e801e2052 100644--- a/posthog/schema_enums.py+++ b/posthog/schema_enums.py@@ -3444,6 +3444,7 @@ class NodeKind(StrEnum):MCP_TOOL_DESCRIPTIONS_QUERY = "MCPToolDescriptionsQuery"MCP_TOOL_SAMPLE_INTENTS_QUERY = "MCPToolSampleIntentsQuery"MCP_TOOL_NEIGHBORS_QUERY = "MCPToolNeighborsQuery"+ MCP_MISSING_CAPABILITIES_QUERY = "MCPMissingCapabilitiesQuery"PROPERTY_VALUES_QUERY = "PropertyValuesQuery"diff --git a/products/mcp_analytics/backend/facade/queries.py b/products/mcp_analytics/backend/facade/queries.pyindex 0010a76399bd..4a1cccdc5696 100644--- a/products/mcp_analytics/backend/facade/queries.py+++ b/products/mcp_analytics/backend/facade/queries.py@@ -10,6 +10,7 @@ from products.mcp_analytics.backend.hogql_queries.dashboard_series import (MCPToolCallsAndErrorsQueryRunner,)from products.mcp_analytics.backend.hogql_queries.harness_breakdown import MCPHarnessBreakdownQueryRunner+from products.mcp_analytics.backend.hogql_queries.missing_capabilities import MCPMissingCapabilitiesQueryRunnerfrom products.mcp_analytics.backend.hogql_queries.tool_quality_tables import (MCPToolCategoriesQueryRunner,MCPToolCategoryCountsQueryRunner,@@ -45,4 +46,5 @@ __all__ = ["MCPToolSampleIntentsQueryRunner","MCPToolStatsQueryRunner","MCPToolTopUsersQueryRunner",+ "MCPMissingCapabilitiesQueryRunner",]diff --git a/products/mcp_analytics/backend/hogql_queries/base.py b/products/mcp_analytics/backend/hogql_queries/base.pyindex 426261ef518a..bf247b65a802 100644--- a/products/mcp_analytics/backend/hogql_queries/base.py+++ b/products/mcp_analytics/backend/hogql_queries/base.py@@ -5,6 +5,7 @@ analytics runner; keeping them here means a runner is just its query shape plusits harness-label SQL."""+import jsonfrom datetime import datetimefrom typing import TYPE_CHECKING@@ -60,6 +61,15 @@ def tool_scope_exprs(tool: str) -> list[ast.Expr]:]+def display_person_properties(*, email: str, name: str) -> str:+ """JSON of only the person fields a row's person cell renders, omitting blanks.++ Shared by every runner that returns a person alongside a row, so none of them+ ships the whole ``person.properties`` blob to the client.+ """+ return json.dumps({k: v for k, v in (("email", email), ("name", name)) if v})++def validate_mcp_analytics_access(team: "Team", user: "User") -> bool:org_id = str(team.organization_id)enabled = posthoganalytics.feature_enabled(diff --git a/products/mcp_analytics/backend/hogql_queries/missing_capabilities.py b/products/mcp_analytics/backend/hogql_queries/missing_capabilities.pynew file mode 100644index 000000000000..fc37b8b8e5ac--- /dev/null+++ b/products/mcp_analytics/backend/hogql_queries/missing_capabilities.py@@ -0,0 +1,181 @@+"""The missing-capabilities feed: every `$mcp_missing_capability` report, newest first.++When a server enables `reportMissing`, the SDK registers a virtual `get_more_tools`+tool; an agent that calls it says, in its own words, what it wanted and could not+get. That text lands in `$mcp_intent` and records the capability the agent needed.++The feed stays chronological because exact-text grouping would split similar free-form+requests. Semantic clustering is a separate job.+"""++from functools import cached_property+from typing import TYPE_CHECKING++from posthog.schema import (+ CachedMCPMissingCapabilitiesQueryResponse,+ MCPMissingCapabilitiesItem,+ MCPMissingCapabilitiesQuery,+ MCPMissingCapabilitiesQueryResponse,+)++from posthog.hogql import ast+from posthog.hogql.parser import parse_expr, parse_select+from posthog.hogql.query import execute_hogql_query++from posthog.clickhouse.query_tagging import Feature, Product, tags_context+from posthog.hogql_queries.query_runner import AnalyticsQueryRunner+from posthog.hogql_queries.utils.query_date_range import QueryDateRange++from products.mcp_analytics.backend import mcp_harness+from products.mcp_analytics.backend.constants import MCP_MISSING_CAPABILITY_EVENT+from products.mcp_analytics.backend.hogql_queries.base import (+ display_person_properties,+ mcp_query_date_range,+ validate_mcp_analytics_access,+)++if TYPE_CHECKING:+ from posthog.models.user import User++# Matches the session-list bounds so both feeds page the same way.+DEFAULT_LIMIT = 100+MAX_LIMIT = 500++# Both the result column and search expression use this property so they cannot drift.+_REPORT_TEXT = "toString(properties.$mcp_intent)"++# Conversation id, same resolution as the tool-call surfaces: the SDK's own+# $mcp_session_id when set, else the ambient $session_id.+_CONVERSATION_ID = "coalesce(nullIf(toString(properties.$mcp_session_id), ''), toString(properties.$session_id))"+++class MCPMissingCapabilitiesQueryRunner(AnalyticsQueryRunner[MCPMissingCapabilitiesQueryResponse]):+ """Chronological feed of the capabilities agents asked for and could not get.++ Powers the "Missing capabilities" tab and the `query-mcp-missing-capabilities` MCP+ tool from one path. The client label is resolved server-side by `mcp_harness`; unlike the+ aggregating runners this one uses `harness_label_or_token_sql`, because a report+ row is a single event, not a grouping key. An unrecognized client keeps its+ self-reported name, while an event without client identity gets a distinct label.+ """++ query: MCPMissingCapabilitiesQuery+ cached_response: CachedMCPMissingCapabilitiesQueryResponse++ 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)++ @cached_property+ def limit(self) -> int:+ return min(max(self.query.limit or DEFAULT_LIMIT, 1), MAX_LIMIT)++ @cached_property+ def offset(self) -> int:+ return max(self.query.offset or 0, 0)++ def _where(self) -> ast.Expr:+ exprs: list[ast.Expr] = [+ parse_expr("event = {event}", placeholders={"event": ast.Constant(value=MCP_MISSING_CAPABILITY_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()}),+ ]+ term = (self.query.search or "").strip()+ if term:+ exprs.append(+ parse_expr(+ "positionCaseInsensitive({report_text}, {search}) > 0",+ placeholders={+ "report_text": parse_expr(_REPORT_TEXT),+ "search": ast.Constant(value=term),+ },+ )+ )+ return ast.And(exprs=exprs)++ def to_query(self) -> ast.SelectQuery | ast.SelectSetQuery:+ # The harness fragments are HogQL text from mcp_harness; parse them to AST and inject+ # as placeholders so nothing is string-interpolated. The token is computed once as a+ # column in the inner query and the label buckets that column, per mcp_harness's contract.+ return parse_select(+ """+ SELECT+ toString(timestamp) AS timestamp,+ intent,+ {harness_label} AS harness,+ session_id,+ distinct_id,+ person_email,+ person_name+ FROM (+ SELECT+ timestamp,+ uuid,+ {report_text} AS intent,+ {conversation_id} AS session_id,+ distinct_id,+ toString(person.properties.email) AS person_email,+ toString(person.properties.name) AS person_name,+ {token} AS h,+ {display_name} AS client_display+ FROM events+ WHERE {where}+ )+ ORDER BY timestamp DESC, uuid DESC+ LIMIT {limit} OFFSET {offset}+ """,+ placeholders={+ "harness_label": parse_expr(mcp_harness.harness_label_or_token_sql("h", "client_display")),+ "token": parse_expr(mcp_harness.HARNESS_TOKEN_SQL),+ "display_name": parse_expr(mcp_harness.HARNESS_DISPLAY_NAME_SQL),+ "report_text": parse_expr(_REPORT_TEXT),+ "conversation_id": parse_expr(_CONVERSATION_ID),+ "where": self._where(),+ # Over-fetch one row to detect the next page without a separate count query.+ "limit": ast.Constant(value=self.limit + 1),+ "offset": ast.Constant(value=self.offset),+ },+ )++ def _calculate(self) -> MCPMissingCapabilitiesQueryResponse:+ with tags_context(+ product=Product.MCP_ANALYTICS,+ feature=Feature.QUERY,+ team_id=self.team.id,+ name="mcp_missing_capabilities_query",+ ):+ response = execute_hogql_query(+ query=self.to_query(),+ team=self.team,+ query_type="mcp_missing_capabilities_query",+ timings=self.timings,+ modifiers=self.modifiers,+ limit_context=self.limit_context,+ )++ rows = response.results or []+ has_next = len(rows) > self.limit+ results = [+ MCPMissingCapabilitiesItem(+ timestamp=str(row[0] or ""),+ intent=str(row[1] or ""),+ harness=str(row[2] or ""),+ session_id=str(row[3] or ""),+ distinct_id=str(row[4] or ""),+ # Only the fields the person cell renders, not the whole properties blob.+ person_properties=display_person_properties(email=str(row[5] or ""), name=str(row[6] or "")),+ )+ for row in rows[: self.limit]+ ]+ return MCPMissingCapabilitiesQueryResponse(+ results=results,+ has_next=has_next,+ timings=response.timings,+ hogql=response.hogql,+ modifiers=self.modifiers,+ )diff --git a/products/mcp_analytics/backend/hogql_queries/tool_tables.py b/products/mcp_analytics/backend/hogql_queries/tool_tables.pyindex 14eade6c9328..448d054a8500 100644--- a/products/mcp_analytics/backend/hogql_queries/tool_tables.py+++ b/products/mcp_analytics/backend/hogql_queries/tool_tables.py@@ -5,7 +5,6 @@ Both resolve the client harness to a customer label server-side via `mcp_harnessthe dashboard donut — the frontend only maps a resolved label to its logo."""-import jsonfrom functools import cached_propertyfrom typing import TYPE_CHECKING@@ -59,6 +58,7 @@ from products.mcp_analytics.backend.hogql_queries.base import (EFFECTIVE_DESCRIPTION_SQL,EFFECTIVE_TOOL_SQL,NEW_SDK_SOURCE,+ display_person_properties,mcp_query_date_range,tool_scope_exprs,validate_mcp_analytics_access,@@ -89,11 +89,6 @@ _RAW_ERROR_STATUS = "substring(coalesce(toString(properties.$mcp_error_status),_COMPOSED_FAILURE_LABEL = "concat(error_type, if(empty(error_status), '', concat(' (HTTP ', error_status, ')')))"-def _display_properties(*, email: str, name: str) -> str:- """JSON of only the person fields the Top-users cell renders, omitting blanks."""- return json.dumps({k: v for k, v in (("email", email), ("name", name)) if v})--def _tool_call_where(tool: str, date_range: QueryDateRange, *, extra: list[ast.Expr] | None = None) -> ast.Expr:"""WHERE for new-SDK $mcp_tool_call events scoped to one effective tool and window.@@ -180,7 +175,7 @@ class MCPToolTopUsersQueryRunner(AnalyticsQueryRunner[MCPToolTopUsersQueryRespondistinct_id=str(row[0]),# Only the fields the Top-users cell renders (display name + email), not the# whole person.properties blob — keeps the runner to least person-data exposure.- person_properties=_display_properties(email=str(row[1] or ""), name=str(row[2] or "")),+ person_properties=display_person_properties(email=str(row[1] or ""), name=str(row[2] or "")),calls=int(row[3] or 0),errors=int(row[4] or 0),error_rate_pct=float(row[5] or 0),diff --git a/products/mcp_analytics/backend/tests/test_dashboard_series.py b/products/mcp_analytics/backend/tests/test_dashboard_series.pyindex f9d42e75a75b..d32bbfa90764 100644--- a/products/mcp_analytics/backend/tests/test_dashboard_series.py+++ b/products/mcp_analytics/backend/tests/test_dashboard_series.py@@ -240,6 +240,7 @@ class TestMCPDashboardSeriesGate(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTes[(kind, scopes, expected_status)for kind in (+ "MCPMissingCapabilitiesQuery","MCPToolCallsAndErrorsQuery","MCPToolCallBreakdownQuery","MCPToolCategoryMapQuery",diff --git a/products/mcp_analytics/backend/tests/test_missing_capabilities.py b/products/mcp_analytics/backend/tests/test_missing_capabilities.pynew file mode 100644index 000000000000..50374850afa6--- /dev/null+++ b/products/mcp_analytics/backend/tests/test_missing_capabilities.py@@ -0,0 +1,128 @@+from datetime import UTC, datetime, timedelta+from typing import Any+from uuid import UUID++from posthog.test.base import APIBaseTest, ClickhouseTestMixin, _create_event, _create_person, flush_persons_and_events+from unittest.mock import patch++from parameterized import parameterized++from posthog.schema import DateRange, MCPMissingCapabilitiesItem, MCPMissingCapabilitiesQuery++from products.access_control.backend.facade.user_access_control import UserAccessControlError+from products.mcp_analytics.backend.hogql_queries.missing_capabilities import MCPMissingCapabilitiesQueryRunner+from products.mcp_analytics.backend.tests import _MCPAnalyticsTeamScopedTestMixin+++class TestMCPMissingCapabilitiesQueryRunner(_MCPAnalyticsTeamScopedTestMixin, ClickhouseTestMixin, APIBaseTest):+ def _emit(+ self,+ *,+ intent: str = "export a dashboard as a PDF",+ event: str = "$mcp_missing_capability",+ client_name: str | None = "claude-ai",+ session_id: str = "s1",+ distinct_id: str = "d1",+ timestamp: datetime | None = None,+ event_uuid: UUID | None = None,+ ) -> None:+ properties: dict[str, Any] = {"$session_id": session_id, "$mcp_intent": intent}+ if client_name is not None:+ properties["$mcp_client_name"] = client_name+ _create_event(+ team=self.team,+ event=event,+ distinct_id=distinct_id,+ timestamp=timestamp or datetime.now(tz=UTC),+ properties=properties,+ event_uuid=event_uuid,+ )++ def _run(self, **kwargs: Any) -> list[MCPMissingCapabilitiesItem]:+ return self._response(**kwargs).results++ def _response(self, *, date_from: str = "-30d", **kwargs: Any) -> Any:+ runner = MCPMissingCapabilitiesQueryRunner(+ query=MCPMissingCapabilitiesQuery(dateRange=DateRange(date_from=date_from), **kwargs),+ team=self.team,+ )+ return runner.calculate()++ def test_returns_reports_newest_first_with_their_text(self) -> None:+ now = datetime.now(tz=UTC)+ self._emit(intent="older ask", timestamp=now - timedelta(hours=2))+ self._emit(intent="newer ask", timestamp=now - timedelta(hours=1))+ # Only $mcp_missing_capability is the unmet-demand signal; a tool call carrying an+ # intent is what the agent *did*, not what it couldn't do.+ self._emit(intent="a tool call intent", event="$mcp_tool_call")+ flush_persons_and_events()++ rows = self._run()++ assert [row.intent for row in rows] == ["newer ask", "older ask"]+ assert rows[0].session_id == "s1"+ assert rows[0].distinct_id == "d1"+ assert rows[0].harness == "Claude.ai"++ def test_date_range_excludes_older_reports(self) -> None:+ now = datetime.now(tz=UTC)+ self._emit(intent="last month", timestamp=now - timedelta(days=20))+ self._emit(intent="this week", timestamp=now - timedelta(days=1))+ flush_persons_and_events()++ assert [row.intent for row in self._run(date_from="-7d")] == ["this week"]++ @parameterized.expand(+ [+ ("mixed_case_substring", "DaShBoArD", ["export a dashboard as a PDF"]),+ ("wildcard_is_literal", "%", []),+ ]+ )+ def test_search_filters_reports(self, _name: str, term: str, expected: list[str]) -> None:+ self._emit(intent="export a dashboard as a PDF")+ self._emit(intent="rename a project")+ flush_persons_and_events()++ assert [row.intent for row in self._run(search=term)] == expected++ def test_labels_unidentified_and_self_reported_clients(self) -> None:+ self._emit(intent="no client identity", client_name=None)+ self._emit(intent="self-reported client", client_name="some-inhouse-agent")+ flush_persons_and_events()++ harness_by_intent = {row.intent: row.harness for row in self._run()}++ assert harness_by_intent == {+ "no client identity": "Unidentified client",+ "self-reported client": "some-inhouse-agent",+ }++ def test_pages_equal_timestamps_deterministically(self) -> None:+ now = datetime.now(tz=UTC)+ for index, intent in enumerate(["r1", "r2", "r3"]):+ self._emit(intent=intent, timestamp=now, event_uuid=UUID(int=index + 1))+ flush_persons_and_events()++ first_page = self._response(limit=2, offset=0)+ second_page = self._response(limit=2, offset=2)++ assert [row.intent for row in first_page.results] == ["r3", "r2"]+ assert first_page.has_next is True+ assert [row.intent for row in second_page.results] == ["r1"]+ assert second_page.has_next is False++ def test_carries_only_the_person_fields_the_row_renders(self) -> None:+ _create_person(team=self.team, distinct_ids=["d1"], properties={"email": "[email protected]", "plan": "enterprise"})+ self._emit()+ flush_persons_and_events()++ person_properties = self._run()[0].person_properties++ assert '"email":"[email protected]"' in person_properties.replace(" ", "")+ assert "enterprise" not in person_properties++ def test_blocks_access_when_flag_disabled(self) -> None:+ runner = MCPMissingCapabilitiesQueryRunner(query=MCPMissingCapabilitiesQuery(), team=self.team, user=self.user)+ with patch("posthoganalytics.feature_enabled", return_value=False):+ with self.assertRaises(UserAccessControlError):+ runner.validate_query_runner_access(self.user)diff --git a/products/mcp_analytics/frontend/MCPAnalyticsScene.tsx b/products/mcp_analytics/frontend/MCPAnalyticsScene.tsxindex 31135b77c889..58f92064c0c6 100644--- a/products/mcp_analytics/frontend/MCPAnalyticsScene.tsx+++ b/products/mcp_analytics/frontend/MCPAnalyticsScene.tsx@@ -24,6 +24,7 @@ import { mcpAnalyticsOnboardingLogic } from './mcpAnalyticsOnboardingLogic'import { MCPAnalyticsTab, TAB_DESCRIPTIONS, mcpAnalyticsSceneLogic } from './mcpAnalyticsSceneLogic'import { MCPAnalyticsSceneMenuBar } from './MCPAnalyticsSceneMenuBar'import { MCPAnalyticsToolQuality } from './MCPAnalyticsToolQuality'+import { MCPAnalyticsMissingCapabilities } from './missingCapabilities/MCPAnalyticsMissingCapabilities'import { MCPAnalyticsNotifications } from './notifications/MCPAnalyticsNotifications'import { mcpAnalyticsNotificationsLogic } from './notifications/mcpAnalyticsNotificationsLogic'import { MCPSessionsPlaylist } from './sessions/MCPSessionsPlaylist'@@ -58,7 +59,7 @@ function MCPAnalyticsSceneContent(): JSX.Element {return <NotFound object="page" />}- // landing is a one-shot redirect marker, while search is Sessions-only.+ // landing is a one-shot redirect marker, while search belongs to Sessions and Missing capabilities.// The date range stays shared across every tab.const { landing: _landing, ...tabParams } = searchParamsconst { search: _search, ...sharedParams } = tabParams@@ -106,6 +107,13 @@ function MCPAnalyticsSceneContent(): JSX.Element {},]: []),+ {+ key: 'missing-capabilities',+ label: 'Missing capabilities',+ content: <MCPAnalyticsMissingCapabilities />,+ link: combineUrl(urls.mcpAnalyticsMissingCapabilities(), tabParams).url,+ 'data-attr': 'mcp-analytics-missing-capabilities-tab',+ },{key: 'notifications',label: (diff --git a/products/mcp_analytics/frontend/earlyData/MCPAnalyticsEarlyData.tsx b/products/mcp_analytics/frontend/earlyData/MCPAnalyticsEarlyData.tsxindex 9f1b1080e361..6e6b34c1ea68 100644--- a/products/mcp_analytics/frontend/earlyData/MCPAnalyticsEarlyData.tsx+++ b/products/mcp_analytics/frontend/earlyData/MCPAnalyticsEarlyData.tsx@@ -280,7 +280,12 @@ function ChecklistCard(): JSX.Element {<div><div className="text-base font-medium">{item.title}</div><div className="text-muted text-sm">- {item.detail} {item.status !== 'ok' ? <Link to={item.docsUrl}>Learn more</Link> : null}+ {item.detail}{' '}+ {item.appLink ? (+ <Link to={item.appLink.to}>{item.appLink.label}</Link>+ ) : item.status !== 'ok' ? (+ <Link to={item.docsUrl}>Learn more</Link>+ ) : null}</div></div></div>diff --git a/products/mcp_analytics/frontend/earlyData/earlyData.test.ts b/products/mcp_analytics/frontend/earlyData/earlyData.test.tsindex d15afa7981fd..334987e424fc 100644--- a/products/mcp_analytics/frontend/earlyData/earlyData.test.ts+++ b/products/mcp_analytics/frontend/earlyData/earlyData.test.ts@@ -77,10 +77,15 @@ describe('early data derivations', () => {expect(checklist.find((i) => i.key === 'sessions')?.status).toBe(sessionsStatus)})- it('flips unmet-demand reporting to ok once any report exists', () => {- expect(buildChecklist(stats({})).find((i) => i.key === 'missing-capability')?.status).toBe('pending')- expect(- buildChecklist(stats({ missingCapabilityReports: 2 })).find((i) => i.key === 'missing-capability')?.status- ).toBe('ok')+ it.each([+ [0, 'pending', undefined],+ [2, 'ok', '/mcp-analytics/missing-capabilities'],+ ])('grades %i missing-capability reports as %s and links to %s', (reports, status, appLinkTo) => {+ const item = buildChecklist(stats({ missingCapabilityReports: reports })).find(+ (i) => i.key === 'missing-capability'+ )++ expect(item?.status).toBe(status)+ expect(item?.appLink?.to).toBe(appLinkTo)})})diff --git a/products/mcp_analytics/frontend/earlyData/earlyDataChecklist.ts b/products/mcp_analytics/frontend/earlyData/earlyDataChecklist.tsindex 061e7a257a51..3d797119c3f4 100644--- a/products/mcp_analytics/frontend/earlyData/earlyDataChecklist.ts+++ b/products/mcp_analytics/frontend/earlyData/earlyDataChecklist.ts@@ -1,3 +1,5 @@+import { urls } from 'scenes/urls'+export interface EarlyStats {totalCalls: numberdistinctTools: number@@ -16,6 +18,7 @@ export interface ChecklistItem {detail: stringstatus: ChecklistStatusdocsUrl: string+ appLink?: { to: string; label: string }}const DOCS = {@@ -66,13 +69,17 @@ export function buildChecklist(stats: EarlyStats): ChecklistItem[] {},{key: 'missing-capability',- title: 'Unmet demand reporting',+ title: 'Missing capability reporting',detail:stats.missingCapabilityReports > 0? `Agents have filed ${stats.missingCapabilityReports} missing-capability report${stats.missingCapabilityReports === 1 ? '' : 's'}.`: 'No missing-capability reports yet. Enable reportMissing so agents can tell you which tools they wish you had.',status: stats.missingCapabilityReports > 0 ? 'ok' : 'pending',docsUrl: DOCS.missingCapability,+ appLink:+ stats.missingCapabilityReports > 0+ ? { to: urls.mcpAnalyticsMissingCapabilities(), label: 'Read the reports' }+ : undefined,},]}diff --git a/products/mcp_analytics/frontend/mcpAnalyticsSceneLogic.ts b/products/mcp_analytics/frontend/mcpAnalyticsSceneLogic.tsindex cacf281a0674..636fb39f67bf 100644--- a/products/mcp_analytics/frontend/mcpAnalyticsSceneLogic.ts+++ b/products/mcp_analytics/frontend/mcpAnalyticsSceneLogic.ts@@ -13,6 +13,7 @@ export type MCPAnalyticsTab =| 'sessions'| 'tool-quality'| 'intent-clustering'+ | 'missing-capabilities'| 'notifications'export const TAB_DESCRIPTIONS: Record<MCPAnalyticsTab, string> = {@@ -22,6 +23,7 @@ export const TAB_DESCRIPTIONS: Record<MCPAnalyticsTab, string> = {'tool-quality': 'Understand how reliably your MCP tools support user workflows.','intent-clustering':'Cluster semantically similar user intents and see which tools each cluster routes to. Highlights inconsistent routing.',+ 'missing-capabilities': 'What agents asked your server for and could not get, in their own words, newest first.',notifications:'Recurring summaries of what agents are doing, plus instant alerts for the things you need to know about right away.',}@@ -32,6 +34,7 @@ const SCENE_KEY_TO_TAB: Record<string, MCPAnalyticsTab> = {mcpAnalyticsSessions: 'sessions',mcpAnalyticsToolQuality: 'tool-quality',mcpAnalyticsIntentClustering: 'intent-clustering',+ mcpAnalyticsMissingCapabilities: 'missing-capabilities',mcpAnalyticsNotifications: 'notifications',}diff --git a/products/mcp_analytics/frontend/missingCapabilities/MCPAnalyticsMissingCapabilities.tsx b/products/mcp_analytics/frontend/missingCapabilities/MCPAnalyticsMissingCapabilities.tsxnew file mode 100644index 000000000000..80bcab1a8483--- /dev/null+++ b/products/mcp_analytics/frontend/missingCapabilities/MCPAnalyticsMissingCapabilities.tsx@@ -0,0 +1,253 @@+import { useActions, useValues } from 'kea'++import * as puzzlePng from '@posthog/brand/hoggies/png/puzzle'+import { IconBook, IconMCP } from '@posthog/icons'+import { LemonBanner, LemonButton, LemonInput, LemonTable } from '@posthog/lemon-ui'++import { pngHoggie } from 'lib/brand/hoggies'+import { CommandBlock } from 'lib/components/CommandBlock/CommandBlock'+import { TZLabel } from 'lib/components/TZLabel'+import { PersonDisplay } from 'scenes/persons/PersonDisplay'++import { MCPMissingCapabilitiesItem } from '~/queries/schema/schema-general'++import { McpDateFilter } from '../components/McpDateFilter'+import { HarnessLogo } from '../dashboard/harness'+import { useMCPAnalyticsWizardCommand } from '../onboarding/MCPAnalyticsInstall'+import { isUnidentifiedClient, mcpMissingCapabilitiesLogic, parsePersonProperties } from './mcpMissingCapabilitiesLogic'+import { MissingCapabilitiesPreview } from './MissingCapabilitiesPreview'++const MISSING_CAPABILITY_DOCS_URL = 'https://posthog.com/docs/mcp-analytics/missing-capability'+const ACCENT_TEXT = 'text-[var(--empty-state-accent)] dark:text-[var(--empty-state-accent-dark)]'++const HedgehogPuzzle = pngHoggie(puzzlePng)++function FilterBar(): JSX.Element {+ const { search, dateFilter } = useValues(mcpMissingCapabilitiesLogic)+ const { setSearch, setDateFilter } = useActions(mcpMissingCapabilitiesLogic)++ return (+ <div className="flex flex-wrap items-center gap-2">+ <LemonInput+ type="search"+ placeholder="Search what agents asked for"+ value={search}+ onChange={setSearch}+ className="min-w-60 flex-1"+ data-attr="mcp-missing-capabilities-search"+ />+ <McpDateFilter+ dateFrom={dateFilter.dateFrom}+ dateTo={dateFilter.dateTo}+ onChange={(dateFrom, dateTo) => setDateFilter(dateFrom, dateTo)}+ dataAttr="mcp-missing-capabilities-date-filter"+ />+ </div>+ )+}++/**+ * This tab is already inside a configured product, so it cannot use the scene-level setup gate.+ * An empty date range keeps the filters visible and explains how to enable report collection.+ */+function NoReportsState(): JSX.Element {+ const { command, isCloudOrDev } = useMCPAnalyticsWizardCommand()++ return (+ <div+ className="grid w-full grid-cols-1 items-center gap-8 py-4 md:grid-cols-[minmax(0,1fr)_40%]"+ style={+ {+ '--empty-state-accent': 'var(--color-product-mcp-analytics-light)',+ '--empty-state-accent-dark': 'var(--color-product-mcp-analytics-dark)',+ } as React.CSSProperties+ }+ data-attr="mcp-missing-capabilities-empty"+ >+ <div className="flex min-w-0 flex-col gap-4">+ <div className="flex items-start gap-4">+ <HedgehogPuzzle className="hidden w-24 shrink-0 sm:block" />+ <div className="flex flex-col gap-1">+ <div className={`inline-flex items-center gap-1.5 text-sm font-semibold ${ACCENT_TEXT}`}>+ <IconMCP className="text-base" />+ Missing capabilities+ </div>+ <h3 className="m-0 text-xl font-semibold">No reports in this date range</h3>+ <p className="m-0 text-sm text-secondary">+ Agents can report a missing capability when the available tools cannot complete a task. Each+ report appears here with the most recent first.+ </p>+ </div>+ </div>++ {/* Wizard commands only work against cloud; self-hosted gets the manual path promoted instead. */}+ {isCloudOrDev ? (+ <div className="flex flex-col gap-2">+ <p className="m-0 text-xs text-tertiary">+ Run Wizard from your MCP server's project root. The setup agent enables reporting:+ </p>+ <CommandBlock+ command={command}+ copyLabel="MCP analytics Wizard command"+ ariaLabel="Copy MCP analytics Wizard command"+ size="md"+ decoration="rainbow"+ className="bg-bg-light border border-border hover:border-primary"+ />+ </div>+ ) : null}++ <p className="m-0 text-xs text-tertiary">+ {isCloudOrDev ? 'To configure reporting manually, set' : 'Set'} <code>reportMissing: true</code>{' '}+ when you initialize the PostHog MCP SDK, and agents get a <code>get_more_tools</code> tool they can+ call when they're stuck.+ </p>++ <LemonButton+ type={isCloudOrDev ? 'tertiary' : 'primary'}+ size={isCloudOrDev ? 'xsmall' : 'small'}+ icon={<IconBook />}+ to={MISSING_CAPABILITY_DOCS_URL}+ targetBlank+ className="self-start"+ >+ {isCloudOrDev ? 'Read the setup docs' : 'Set up missing-capability reports'}+ </LemonButton>+ </div>++ <div+ className="hidden min-w-0 flex-col justify-center gap-3 rounded-md border border-primary p-10 md:flex dark:[--empty-state-accent:var(--empty-state-accent-dark)]"+ style={{+ backgroundImage:+ 'linear-gradient(135deg, color-mix(in oklab, var(--empty-state-accent) 16%, transparent) 0%, color-mix(in oklab, var(--empty-state-accent) 5%, transparent) 45%, transparent 80%)',+ }}+ >+ <div className="flex items-center gap-2 text-xs font-semibold text-secondary">+ <span+ className="size-2 animate-pulse rounded-full bg-[var(--empty-state-accent)] motion-reduce:animate-none dark:bg-[var(--empty-state-accent-dark)]"+ aria-hidden="true"+ />+ Example reports+ </div>+ <MissingCapabilitiesPreview />+ </div>+ </div>+ )+}++function NoSearchResultsState({ search }: { search: string }): JSX.Element {+ return (+ <div className="p-6 text-center text-sm text-secondary">+ No reports match “{search}”. Try a broader term or a wider date range.+ </div>+ )+}++function ClientCell({ harness }: { harness: string }): JSX.Element {+ if (isUnidentifiedClient(harness)) {+ return (+ <span className="text-muted" title="This report didn't include which MCP client filed it.">+ Unknown client+ </span>+ )+ }+ return (+ <span className="flex items-center gap-1.5">+ <HarnessLogo category={harness} className="h-3.5 w-3.5" />+ <span className="truncate">{harness}</span>+ </span>+ )+}++export function MCPAnalyticsMissingCapabilities(): JSX.Element {+ const { reports, reportsError, reportsLoading, hasNext, search } = useValues(mcpMissingCapabilitiesLogic)+ const { loadReports, loadMoreReports } = useActions(mcpMissingCapabilitiesLogic)++ const initialLoadFailed = Boolean(reportsError) && reports.length === 0+ const noReports = !reportsLoading && !reportsError && reports.length === 0 && !search++ return (+ <div className="flex flex-col gap-4" data-attr="mcp-analytics-missing-capabilities">+ <FilterBar />+ {reportsError ? (+ <LemonBanner type="error">+ <div className="flex flex-wrap items-center justify-between gap-2">+ <span>Couldn't load missing-capability reports. Try again.</span>+ <LemonButton+ type="secondary"+ size="small"+ loading={reportsLoading}+ onClick={() => (reports.length > 0 ? loadMoreReports() : loadReports())}+ data-attr="mcp-missing-capabilities-retry"+ >+ Try again+ </LemonButton>+ </div>+ </LemonBanner>+ ) : null}+ {initialLoadFailed ? null : noReports ? (+ <NoReportsState />+ ) : (+ <LemonTable<MCPMissingCapabilitiesItem>+ dataSource={reports}+ loading={reportsLoading && reports.length === 0}+ rowKey={(row, index) => `${row.timestamp}-${index}`}+ emptyState={<NoSearchResultsState search={search} />}+ columns={[+ {+ title: 'When',+ key: 'timestamp',+ width: 130,+ render: (_, row) => <TZLabel time={row.timestamp} />,+ },+ {+ title: 'The ask',+ key: 'intent',+ render: (_, row) =>+ row.intent ? (+ <span className="text-base">{row.intent}</span>+ ) : (+ // The agent called get_more_tools without saying what it wanted.+ <span className="text-muted text-base">No description given</span>+ ),+ },+ {+ title: 'Client',+ key: 'harness',+ width: 170,+ render: (_, row) => <ClientCell harness={row.harness} />,+ },+ {+ title: 'Person',+ key: 'person',+ width: 200,+ render: (_, row) => (+ <PersonDisplay+ person={{+ distinct_id: row.distinct_id,+ properties: parsePersonProperties(row.person_properties),+ }}+ withIcon+ noPopover={false}+ />+ ),+ },+ ]}+ />+ )}+ {hasNext ? (+ <div className="flex justify-center">+ <LemonButton+ type="secondary"+ size="small"+ loading={reportsLoading}+ onClick={() => loadMoreReports()}+ data-attr="mcp-missing-capabilities-load-more"+ >+ Load more+ </LemonButton>+ </div>+ ) : null}+ </div>+ )+}diff --git a/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.scss b/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.scssnew file mode 100644index 000000000000..f62c89f9fcbb--- /dev/null+++ b/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.scss@@ -0,0 +1,154 @@+.MissingCapsPreview {+ overflow: hidden;+ background: var(--color-bg-surface-primary);+ border: 1px solid var(--color-border-primary);+ border-radius: var(--radius);++ &__head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 0.5rem 0.75rem;+ border-bottom: 1px solid var(--color-border-primary);+ }++ &__title {+ font-size: 0.75rem;+ font-weight: 600;+ }++ &__rows {+ display: flex;+ flex-direction: column;+ padding: 0.25rem 0.5rem 0.5rem;+ }++ &__row {+ display: flex;+ flex-direction: column;+ gap: 0.3125rem;+ padding: 0.5rem;++ // One settling fade, staggered below. `both` holds the from-state during the delay, so a+ // row is invisible until its turn and visible for good afterwards.+ animation: MissingCapsPreview__in 420ms ease both;+ }++ // Multi-line rows need a hairline to read as separate reports.+ &__row + &__row {+ border-top: 1px solid var(--color-border-primary);+ }++ &__row:hover {+ background: var(--color-bg-fill-highlight-50);+ }++ &__row:nth-child(2) {+ animation-delay: 90ms;+ }++ &__row:nth-child(3) {+ animation-delay: 180ms;+ }++ &__row:nth-child(4) {+ animation-delay: 270ms;+ }++ &__row:nth-child(5) {+ animation-delay: 360ms;+ }++ &__ask {+ font-size: 0.8125rem;+ line-height: 1.35;+ color: var(--color-text-primary);+ }++ &__meta {+ display: flex;+ gap: 0.5rem;+ align-items: center;+ font-size: 0.6875rem;+ color: var(--color-text-secondary);+ }++ &__client {+ display: inline-flex;+ gap: 0.375rem;+ align-items: center;+ min-width: 0;+ }++ &__client--unknown {+ font-style: italic;+ color: var(--color-text-tertiary);+ }++ &__logo {+ display: flex;+ flex-shrink: 0;+ align-items: center;+ justify-content: center;+ width: 16px;+ height: 16px;+ padding: 2px;+ background: var(--color-bg-surface-secondary);+ border: 1px solid var(--color-border-primary);+ border-radius: 4px;+ }++ &__logo img {+ width: 100%;+ height: 100%;+ object-fit: contain;+ }++ // Nothing to show for a report that never named its client, so the plate stays empty.+ &__logo--unknown {+ background: none;+ border-style: dashed;+ }++ &__time {+ flex-shrink: 0;+ margin-left: auto;+ font-family: var(--font-mono);+ color: var(--color-text-tertiary);+ }+}++// Third-party brand marks (Cursor, OpenAI) are near-black on transparent, so they vanish on the+// default dark surface plate. Same fix as the tool-call preview: back them with a light plate in+// dark mode. Light mode already is one.+[theme='dark'] .MissingCapsPreview__logo {+ background: var(--color-bg-surface-tooltip);+ border-color: color-mix(in oklab, var(--color-black) 12%, transparent);+}++[theme='dark'] .MissingCapsPreview__logo--unknown {+ background: none;+}++@keyframes MissingCapsPreview__in {+ from {+ opacity: 0;+ transform: translateY(6px);+ }++ to {+ opacity: 1;+ transform: none;+ }+}++@media (prefers-reduced-motion: reduce) {+ .MissingCapsPreview__row {+ animation: none;+ }+}++// Storybook (and its visual-regression runner) must not snapshot a half-faded row.+.MissingCapsPreview--static .MissingCapsPreview__row {+ animation: none;+}diff --git a/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.stories.tsx b/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.stories.tsxnew file mode 100644index 000000000000..dbe84623d3bc--- /dev/null+++ b/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.stories.tsx@@ -0,0 +1,21 @@+import { Meta, StoryObj } from '@storybook/react'++import { MissingCapabilitiesPreview } from './MissingCapabilitiesPreview'++const meta: Meta = {+ title: 'Scenes-App/MCP Analytics/Missing Capabilities Preview',+ parameters: { layout: 'padded' },+}+export default meta++type Story = StoryObj++// Snapshotted at the width the empty state's preview column gives it, so the asks wrap the way+// they do in the tab. The stagger animation is disabled under storybook, so this is stable.+export const ExampleReports: Story = {+ render: () => (+ <div className="w-[420px]">+ <MissingCapabilitiesPreview />+ </div>+ ),+}diff --git a/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.tsx b/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.tsxnew file mode 100644index 000000000000..1babb0aa9c5e--- /dev/null+++ b/products/mcp_analytics/frontend/missingCapabilities/MissingCapabilitiesPreview.tsx@@ -0,0 +1,94 @@+import './MissingCapabilitiesPreview.scss'++import { LemonTag } from 'lib/lemon-ui/LemonTag'+import { cn } from 'lib/utils/css-classes'+import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'++import claudeLogo from '../harness-logos/claude.svg'+import cursorLogo from '../harness-logos/cursor.svg'+import openaiLogo from '../harness-logos/openai.svg'+import windsurfLogo from '../harness-logos/windsurf.svg'++interface PreviewReport {+ /** The ask in the agent's own words. */+ ask: string+ client: string+ /** Omitted when the report arrived without a client. */+ logo?: string+ time: string+}++// These examples cover specific tool gaps and a report without client identity.+const REPORTS: PreviewReport[] = [+ {+ ask: 'Wanted to bulk-close 40 stale tickets but only single-ticket updates exist',+ client: 'Claude Code',+ logo: claudeLogo,+ time: '2m ago',+ },+ {+ ask: 'Tried to find issues by assignee, but search_issues only takes free text',+ client: 'Cursor',+ logo: cursorLogo,+ time: '18m ago',+ },+ {+ ask: "Needed to attach the failing build log to the incident, there's no upload tool",+ client: 'Unknown client',+ time: '1h ago',+ },+ {+ ask: "User asked for last month's invoice PDF. I can list invoices, not fetch one",+ client: 'Codex',+ logo: openaiLogo,+ time: '3h ago',+ },+ {+ ask: 'Had to roll back the bad deploy and only deploy and get_status are exposed',+ client: 'Windsurf',+ logo: windsurfLogo,+ time: 'Yesterday',+ },+]++/**+ * Example-data preview of the missing-capabilities feed, for the tab's empty state: what lands+ * here once agents start reporting. Static rows, no state, and the only motion is a CSS stagger+ * that settles after the initial render.+ */+export function MissingCapabilitiesPreview(): JSX.Element {+ const isStatic = inStorybook() || inStorybookTestRunner()++ return (+ <div className={cn('MissingCapsPreview', isStatic && 'MissingCapsPreview--static')}>+ <div className="MissingCapsPreview__head">+ <span className="MissingCapsPreview__title">Missing capabilities</span>+ <LemonTag size="small">example data</LemonTag>+ </div>++ <div className="MissingCapsPreview__rows">+ {REPORTS.map((report, i) => (+ <div key={i} className="MissingCapsPreview__row">+ <span className="MissingCapsPreview__ask">{report.ask}</span>+ <span className="MissingCapsPreview__meta">+ {report.logo ? (+ <span className="MissingCapsPreview__client">+ <span className="MissingCapsPreview__logo">+ <img src={report.logo} alt="" />+ </span>+ {report.client}+ </span>+ ) : (+ <span className="MissingCapsPreview__client MissingCapsPreview__client--unknown">+ <span className="MissingCapsPreview__logo MissingCapsPreview__logo--unknown" />+ {report.client}+ </span>+ )}+ <span className="MissingCapsPreview__time">{report.time}</span>+ </span>+ </div>+ ))}+ </div>+ </div>+ )+}diff --git a/products/mcp_analytics/frontend/missingCapabilities/mcpMissingCapabilitiesLogic.test.ts b/products/mcp_analytics/frontend/missingCapabilities/mcpMissingCapabilitiesLogic.test.tsnew file mode 100644index 000000000000..20f47c1bdfc6--- /dev/null+++ b/products/mcp_analytics/frontend/missingCapabilities/mcpMissingCapabilitiesLogic.test.ts@@ -0,0 +1,154 @@+import { expectLogic } from 'kea-test-utils'++import api from 'lib/api'++import { resumeKeaLoadersErrors, silenceKeaLoadersErrors } from '~/initKea'+import { MCPMissingCapabilitiesItem } from '~/queries/schema/schema-general'+import { initKeaTests } from '~/test/init'++import {+ MISSING_CAPABILITIES_PAGE_SIZE,+ isUnidentifiedClient,+ mcpMissingCapabilitiesLogic,+ parsePersonProperties,+} from './mcpMissingCapabilitiesLogic'++jest.mock('lib/api')++const mockApi = api as jest.Mocked<typeof api>++type MissingCapabilitiesLogic = ReturnType<typeof mcpMissingCapabilitiesLogic.build>++const report = (intent: string, overrides: Partial<MCPMissingCapabilitiesItem> = {}): MCPMissingCapabilitiesItem => ({+ timestamp: '2026-07-15 00:00:00',+ intent,+ harness: 'Claude Code',+ session_id: 's1',+ distinct_id: 'd1',+ person_properties: '{}',+ ...overrides,+})++describe('mcpMissingCapabilitiesLogic', () => {+ describe('row helpers', () => {+ it.each([+ ['an empty label', '', true],+ ['the backend placeholder', 'Unidentified client', true],+ ['a known harness', 'Claude Code', false],+ ['a self-reported client', 'some-inhouse-agent', false],+ ])('treats %s as unidentified: %s', (_label, harness, expected) => {+ expect(isUnidentifiedClient(harness)).toBe(expected)+ })++ it.each([+ ['a person blob', '{"email":"[email protected]"}', { email: '[email protected]' }],+ ['an empty blob', '{}', {}],+ ['a missing value', '', {}],+ ['malformed JSON', '{not json', {}],+ ['a non-object', '"[email protected]"', {}],+ ])('parses %s', (_label, raw, expected) => {+ expect(parsePersonProperties(raw)).toEqual(expected)+ })+ })++ let logic: MissingCapabilitiesLogic | null = null++ function mountLogic(): MissingCapabilitiesLogic {+ logic = mcpMissingCapabilitiesLogic()+ logic.mount()+ return logic+ }++ beforeEach(() => {+ initKeaTests()+ mockApi.query.mockResolvedValue({ results: [], has_next: false } as any)+ })++ afterEach(() => {+ logic?.unmount()+ logic = null+ resumeKeaLoadersErrors()+ jest.clearAllMocks()+ })++ it('loads the first page over a 30-day window on mount, matching the checklist count', async () => {+ await expectLogic(mountLogic()).toDispatchActions(['loadReports', 'loadReportsSuccess'])++ expect(mockApi.query).toHaveBeenCalledWith(+ expect.objectContaining({+ kind: 'MCPMissingCapabilitiesQuery',+ dateRange: { date_from: '-30d', date_to: null },+ limit: MISSING_CAPABILITIES_PAGE_SIZE,+ offset: 0,+ })+ )+ })++ it.each<[string, (logic: MissingCapabilitiesLogic) => void, Record<string, unknown>]>([+ ['a search term', (l) => l.actions.setSearch('pdf'), { search: 'pdf', offset: 0 }],+ [+ 'a date change',+ (l) => l.actions.setDateFilter('-7d', null),+ { dateRange: { date_from: '-7d', date_to: null }, offset: 0 },+ ],+ ])('reloads from the first page on %s', async (_label, act, expected) => {+ const mounted = mountLogic()+ await expectLogic(mounted).toDispatchActions(['loadReportsSuccess'])+ mockApi.query.mockClear()++ await expectLogic(mounted, () => act(mounted)).toDispatchActions(['loadReports', 'loadReportsSuccess'])++ expect(mockApi.query).toHaveBeenCalledWith(expect.objectContaining(expected))+ })++ it('appends the next page at the current offset and tracks whether more remain', async () => {+ mockApi.query.mockResolvedValueOnce({ results: [report('first ask')], has_next: true } as any)+ const mounted = mountLogic()+ await expectLogic(mounted).toDispatchActions(['loadReportsSuccess'])+ expect(mounted.values.hasNext).toBe(true)++ mockApi.query.mockResolvedValueOnce({ results: [report('second ask')], has_next: false } as any)+ await expectLogic(mounted, () => {+ mounted.actions.loadMoreReports()+ }).toDispatchActions(['loadMoreReportsSuccess'])++ expect(mockApi.query).toHaveBeenLastCalledWith(expect.objectContaining({ offset: 1 }))+ expect(mounted.values.reports.map((r) => r.intent)).toEqual(['first ask', 'second ask'])+ expect(mounted.values.hasNext).toBe(false)+ })++ it('keeps a load failure distinct from an empty result and clears it on retry', async () => {+ silenceKeaLoadersErrors()+ mockApi.query.mockRejectedValueOnce(new Error('query failed'))++ const mounted = mountLogic()+ await expectLogic(mounted).toDispatchActions(['loadReportsFailure'])+ expect(mounted.values.reportsError).toBe('query failed')++ mockApi.query.mockResolvedValueOnce({ results: [], has_next: false } as any)+ await expectLogic(mounted, () => mounted.actions.loadReports()).toDispatchActions(['loadReportsSuccess'])+ expect(mounted.values.reportsError).toBeNull()+ })++ it('discards a page whose query changed while it was in flight', async () => {+ mockApi.query.mockResolvedValueOnce({ results: [report('old ask')], has_next: true } as any)+ const mounted = mountLogic()+ await expectLogic(mounted).toDispatchActions(['loadReportsSuccess'])++ let resolveSlowPage: (value: unknown) => void = () => {}+ mockApi.query.mockImplementationOnce(() => new Promise((resolve) => (resolveSlowPage = resolve)) as any)+ await expectLogic(mounted, () => {+ mounted.actions.loadMoreReports()+ }).toDispatchActions(['loadMoreReports'])++ mockApi.query.mockResolvedValueOnce({ results: [report('new ask')], has_next: false } as any)+ await expectLogic(mounted, () => {+ mounted.actions.setSearch('new')+ }).toDispatchActions(['loadReportsSuccess'])++ resolveSlowPage({ results: [report('stale ask')], has_next: true })+ await expectLogic(mounted).toDispatchActions(['loadMoreReportsSuccess'])++ expect(mounted.values.reports.map((r) => r.intent)).toEqual(['new ask'])+ })+})diff --git a/products/mcp_analytics/frontend/missingCapabilities/mcpMissingCapabilitiesLogic.ts b/products/mcp_analytics/frontend/missingCapabilities/mcpMissingCapabilitiesLogic.tsnew file mode 100644index 000000000000..b9cb7dabbd0b--- /dev/null+++ b/products/mcp_analytics/frontend/missingCapabilities/mcpMissingCapabilitiesLogic.ts@@ -0,0 +1,272 @@+import { MakeLogicType, actions, afterMount, kea, listeners, path, reducers } from 'kea'+import { loaders } from 'kea-loaders'+import { actionToUrl, router, urlToAction } from 'kea-router'++import api from 'lib/api'+import { urls } from 'scenes/urls'++import { MCPMissingCapabilitiesItem, NodeKind } from '~/queries/schema/schema-general'++export interface MCPMissingCapabilitiesDateFilter {+ dateFrom: string | null+ dateTo: string | null+}++// 30 days, matching the window behind the Activity tab's report count (ACTIVITY_WINDOW),+// so following that checklist link never shows fewer reports than the count promised.+const DEFAULT_DATE_FILTER: MCPMissingCapabilitiesDateFilter = { dateFrom: '-30d', dateTo: null }++const SEARCH_DEBOUNCE_MS = 300++// One page of reports. Each "Load more" appends the next page.+export const MISSING_CAPABILITIES_PAGE_SIZE = 50++// This value mirrors mcp_harness.UNIDENTIFIED_HARNESS_LABEL. Keep the two in sync.+export const UNIDENTIFIED_HARNESS_LABEL = 'Unidentified client'++/** Whether a report tells us nothing about which client filed it.+ *+ * The SDK only stamps `$mcp_client_name` on `$mcp_initialize`, so a report may not+ * identify its client.+ */+export function isUnidentifiedClient(harness: string): boolean {+ return !harness || harness === UNIDENTIFIED_HARNESS_LABEL+}++/** Person email/name the backend packed into the row, for PersonDisplay. */+export function parsePersonProperties(raw: string): Record<string, unknown> {+ try {+ const parsed = JSON.parse(raw || '{}')+ return parsed && typeof parsed === 'object' ? parsed : {}+ } catch {+ return {}+ }+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface mcpMissingCapabilitiesLogicValues {+ dateFilter: MCPMissingCapabilitiesDateFilter+ hasNext: boolean+ reports: MCPMissingCapabilitiesItem[]+ reportsError: string | null+ reportsLoading: boolean+ search: string+}++// Generated by kea-typegen. Update if you're an agent, ignore if you're human.+export interface mcpMissingCapabilitiesLogicActions {+ loadMoreReports: () => {+ value: true+ }+ loadMoreReportsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadMoreReportsSuccess: (+ reports: MCPMissingCapabilitiesItem[],+ payload?: {+ value: true+ }+ ) => {+ reports: MCPMissingCapabilitiesItem[]+ payload?: {+ value: true+ }+ }+ loadReports: () => {+ value: true+ }+ loadReportsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ }+ loadReportsSuccess: (+ reports: MCPMissingCapabilitiesItem[],+ payload?: {+ value: true+ }+ ) => {+ reports: MCPMissingCapabilitiesItem[]+ payload?: {+ value: true+ }+ }+ setDateFilter: (+ dateFrom: string | null,+ dateTo: string | null+ ) => {+ dateFrom: string | null+ dateTo: string | null+ }+ setHasNext: (hasNext: boolean) => {+ hasNext: boolean+ }+ setSearch: (search: string) => {+ search: string+ }+}++export type mcpMissingCapabilitiesLogicType = MakeLogicType<+ mcpMissingCapabilitiesLogicValues,+ mcpMissingCapabilitiesLogicActions+>++/**+ * The Missing capabilities tab: every `$mcp_missing_capability` report an agent filed, newest+ * first. The feed stays chronological because exact-text grouping would split similar+ * free-form requests.+ */+export const mcpMissingCapabilitiesLogic = kea<mcpMissingCapabilitiesLogicType>([+ path(['products', 'mcp_analytics', 'frontend', 'missingCapabilities', 'mcpMissingCapabilitiesLogic']),++ actions({+ // These declarations keep the generated loader actions callable without placeholder arguments.+ loadReports: true,+ loadMoreReports: true,+ setSearch: (search: string) => ({ search }),+ setDateFilter: (dateFrom: string | null, dateTo: string | null) => ({ dateFrom, dateTo }),+ setHasNext: (hasNext: boolean) => ({ hasNext }),+ }),++ loaders(({ values, actions }) => ({+ reports: [+ [] as MCPMissingCapabilitiesItem[],+ {+ // First page / reset (a search or date change). Replaces the list.+ loadReports: async (_, breakpoint) => {+ if (values.search) {+ await breakpoint(SEARCH_DEBOUNCE_MS)+ }+ const response = (await api.query({+ kind: NodeKind.MCPMissingCapabilitiesQuery,+ dateRange: { date_from: values.dateFilter.dateFrom, date_to: values.dateFilter.dateTo },+ search: values.search || undefined,+ limit: MISSING_CAPABILITIES_PAGE_SIZE,+ offset: 0,+ })) as { results?: MCPMissingCapabilitiesItem[]; has_next?: boolean }+ breakpoint()+ actions.setHasNext(response.has_next ?? false)+ return response.results ?? []+ },+ // Load more: append the next page at offset = current length.+ loadMoreReports: async () => {+ // Snapshot the list and the query before the await: if a reset (search or+ // date change) lands while this page is in flight, merging against the+ // post-await list would corrupt it, so we both offset and merge from the+ // snapshot and drop the page entirely if the query moved underneath us.+ const baseReports = values.reports+ const { search, dateFilter } = values+ const response = (await api.query({+ kind: NodeKind.MCPMissingCapabilitiesQuery,+ dateRange: { date_from: dateFilter.dateFrom, date_to: dateFilter.dateTo },+ search: search || undefined,+ limit: MISSING_CAPABILITIES_PAGE_SIZE,+ offset: baseReports.length,+ })) as { results?: MCPMissingCapabilitiesItem[]; has_next?: boolean }+ if (+ search !== values.search ||+ dateFilter.dateFrom !== values.dateFilter.dateFrom ||+ dateFilter.dateTo !== values.dateFilter.dateTo+ ) {+ return values.reports+ }+ actions.setHasNext(response.has_next ?? false)+ return [...baseReports, ...(response.results ?? [])]+ },+ },+ ],+ })),++ reducers({+ search: [+ '',+ {+ setSearch: (_, { search }): string => search,+ },+ ],+ dateFilter: [+ DEFAULT_DATE_FILTER,+ {+ setDateFilter: (_, { dateFrom, dateTo }): MCPMissingCapabilitiesDateFilter => ({ dateFrom, dateTo }),+ },+ ],+ hasNext: [+ false,+ {+ setHasNext: (_, { hasNext }): boolean => hasNext,+ // Hide "Load more" the moment a reset starts, so it isn't shown (disabled,+ // spinning) during the reset; setHasNext restores it when the page resolves.+ loadReports: (): boolean => false,+ },+ ],+ reportsError: [+ null as string | null,+ {+ loadReports: (): null => null,+ loadMoreReports: (): null => null,+ loadReportsSuccess: (): null => null,+ loadMoreReportsSuccess: (): null => null,+ loadReportsFailure: (_, { error }): string => error,+ loadMoreReportsFailure: (_, { error }): string => error,+ },+ ],+ }),++ listeners(({ actions }) => ({+ // Both filters change the result set, so each reloads the first page.+ setSearch: () => {+ actions.loadReports()+ },+ setDateFilter: () => {+ actions.loadReports()+ },+ })),++ // Mirror the filters to the URL so they survive a refresh. date_from / date_to are the+ // product's shared window params; search is the same key the Sessions tab uses.+ actionToUrl(({ values }) => {+ const syncUrl = (): [string, Record<string, any>, Record<string, any>, { replace: boolean }] => {+ const { currentLocation } = router.values+ const searchParams = { ...currentLocation.searchParams }+ const params: Record<string, string | null> = {+ search: values.search || null,+ date_from: values.dateFilter.dateFrom,+ date_to: values.dateFilter.dateTo,+ }+ for (const [key, value] of Object.entries(params)) {+ if (value) {+ searchParams[key] = value+ } else {+ delete searchParams[key]+ }+ }+ return [currentLocation.pathname, searchParams, currentLocation.hashParams, { replace: true }]+ }+ return { setSearch: syncUrl, setDateFilter: syncUrl }+ }),++ urlToAction(({ actions, values }) => ({+ [urls.mcpAnalyticsMissingCapabilities()]: (_, searchParams) => {+ const search = typeof searchParams.search === 'string' ? searchParams.search : ''+ if (search !== values.search) {+ actions.setSearch(search)+ }+ const dateFrom =+ typeof searchParams.date_from === 'string' ? searchParams.date_from : values.dateFilter.dateFrom+ const dateTo = typeof searchParams.date_to === 'string' ? searchParams.date_to : null+ if (dateFrom !== values.dateFilter.dateFrom || dateTo !== values.dateFilter.dateTo) {+ actions.setDateFilter(dateFrom, dateTo)+ }+ },+ })),++ afterMount(({ actions }) => {+ actions.loadReports()+ }),+])diff --git a/products/mcp_analytics/frontend/notifications/recurringReportDefinitions.ts b/products/mcp_analytics/frontend/notifications/recurringReportDefinitions.tsindex b767b7753b84..0172ae35944c 100644--- a/products/mcp_analytics/frontend/notifications/recurringReportDefinitions.ts+++ b/products/mcp_analytics/frontend/notifications/recurringReportDefinitions.ts@@ -22,9 +22,8 @@ export const MCP_RECURRING_REPORTS: MCPRecurringReport[] = [lead: 'Their goals in their own words, grouped and ranked, with the ones that keep failing called out.',frequency: 'weekly',title: 'MCP intent roundup',- // Reads $mcp_intent on tool calls rather than $mcp_missing_capability: that event has never- // been emitted by any project, while $mcp_intent is set on ~88% of calls. "Couldn't do it"- // is inferred from the error flag on the same call, which is a signal that actually exists.+ // This report infers an unmet intent from the error flag on a tool call. Explicit+ // $mcp_missing_capability reports stay in the Missing capabilities tab.prompt: ['Summarize what AI agents were trying to do with our MCP server this week,','using the $mcp_intent property on $mcp_tool_call events.',diff --git a/products/mcp_analytics/manifest.tsx b/products/mcp_analytics/manifest.tsxindex fcd1a6856aee..58939329e1ae 100644--- a/products/mcp_analytics/manifest.tsx+++ b/products/mcp_analytics/manifest.tsx@@ -41,6 +41,7 @@ export const manifest: ProductManifest = {'/mcp-analytics/tool-quality': ['MCPAnalytics', 'mcpAnalyticsToolQuality'],'/mcp-analytics/tool-quality/:toolName': ['MCPAnalyticsToolDetail', 'mcpAnalyticsTool'],'/mcp-analytics/intent-clustering': ['MCPAnalytics', 'mcpAnalyticsIntentClustering'],+ '/mcp-analytics/missing-capabilities': ['MCPAnalytics', 'mcpAnalyticsMissingCapabilities'],'/mcp-analytics/notifications': ['MCPAnalytics', 'mcpAnalyticsNotifications'],},redirects: {@@ -58,6 +59,7 @@ export const manifest: ProductManifest = {mcpAnalyticsToolQuality: (): string => '/mcp-analytics/tool-quality',mcpAnalyticsTool: (toolName: string): string => `/mcp-analytics/tool-quality/${encodeURIComponent(toolName)}`,mcpAnalyticsIntentClustering: (): string => '/mcp-analytics/intent-clustering',+ mcpAnalyticsMissingCapabilities: (): string => '/mcp-analytics/missing-capabilities',mcpAnalyticsNotifications: (): string => '/mcp-analytics/notifications',},setupProbe: {diff --git a/products/mcp_analytics/mcp/tools.yaml b/products/mcp_analytics/mcp/tools.yamlindex f704098a1a9f..368c85f73377 100644--- a/products/mcp_analytics/mcp/tools.yaml+++ b/products/mcp_analytics/mcp/tools.yaml@@ -367,3 +367,28 @@ wrappers:- version- tagsfeature_flag: mcp-analytics+ query-mcp-missing-capabilities:+ schema_ref: MCPMissingCapabilitiesQuery+ enabled: true+ scopes:+ - query:read+ - mcp_analytics:read+ annotations:+ readOnly: true+ destructive: false+ idempotent: true+ title: List MCP missing-capability reports+ description: >+ Return capabilities that agents asked this MCP server for but could not access. Each row contains one+ $mcp_missing_capability report from the SDK's get_more_tools tool, including the report text, timestamp,+ client label, conversation id, and person. Results are chronological because exact-text grouping would split+ similar free-form requests. The query accepts a dateRange, case-insensitive text search, limit, and offset.+ The response's has_next field indicates whether more results remain. Use this tool to identify capabilities+ that agents need or to prioritize new MCP tools.+ system_prompt_hint: MCP missing capabilities that agents reported, newest first+ exclude_properties:+ - response+ - modifiers+ - version+ - tags+ feature_flag: mcp-analyticsdiff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex ef5e97b181eb..64265ec43350 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -8450,6 +8450,22 @@"feature_flag": "mcp-analytics","system_prompt_hint": "MCP client/harness breakdown — calls, error rate, sessions per harness"},+ "query-mcp-missing-capabilities": {+ "description": "Return capabilities that agents asked this MCP server for but could not access. Each row contains one $mcp_missing_capability report from the SDK's get_more_tools tool, including the report text, timestamp, client label, conversation id, and person. Results are chronological because exact-text grouping would split similar free-form requests. The query accepts a dateRange, case-insensitive text search, limit, and offset. The response's has_next field indicates whether more results remain. Use this tool to identify capabilities that agents need or to prioritize new MCP tools.",+ "category": "MCP analytics",+ "feature": "mcp_analytics",+ "summary": "List MCP missing-capability reports",+ "title": "List MCP missing-capability reports",+ "required_scopes": ["query:read", "mcp_analytics:read"],+ "annotations": {+ "destructiveHint": false,+ "idempotentHint": true,+ "openWorldHint": true,+ "readOnlyHint": true+ },+ "feature_flag": "mcp-analytics",+ "system_prompt_hint": "MCP missing capabilities that agents reported, newest first"+ },"query-mcp-tool-daily-stats": {"description": "Return a day-by-day time series for a single MCP tool: calls, errors, p50/p95 latency, unique users, and unique sessions per day. Pass toolName (effective tool name, resolved server-side) and a dateRange. Use to answer \"how has tool X trended?\" — spotting error spikes, latency regressions, or adoption changes over time.","category": "MCP analytics",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex e9bdbc82d42a..91e8b946c555 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -8991,6 +8991,22 @@"feature_flag": "mcp-analytics","system_prompt_hint": "MCP client/harness breakdown — calls, error rate, sessions per harness"},+ "query-mcp-missing-capabilities": {+ "description": "Return capabilities that agents asked this MCP server for but could not access. Each row contains one $mcp_missing_capability report from the SDK's get_more_tools tool, including the report text, timestamp, client label, conversation id, and person. Results are chronological because exact-text grouping would split similar free-form requests. The query accepts a dateRange, case-insensitive text search, limit, and offset. The response's has_next field indicates whether more results remain. Use this tool to identify capabilities that agents need or to prioritize new MCP tools.",+ "category": "MCP analytics",+ "feature": "mcp_analytics",+ "summary": "List MCP missing-capability reports",+ "title": "List MCP missing-capability reports",+ "required_scopes": ["query:read", "mcp_analytics:read"],+ "annotations": {+ "destructiveHint": false,+ "idempotentHint": true,+ "openWorldHint": true,+ "readOnlyHint": true+ },+ "feature_flag": "mcp-analytics",+ "system_prompt_hint": "MCP missing capabilities that agents reported, newest first"+ },"query-mcp-tool-daily-stats": {"description": "Return a day-by-day time series for a single MCP tool: calls, errors, p50/p95 latency, unique users, and unique sessions per day. Pass toolName (effective tool name, resolved server-side) and a dateRange. Use to answer \"how has tool X trended?\" — spotting error spikes, latency regressions, or adoption changes over time.","category": "MCP analytics",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 50936aee77f3..1a82f8fd2ffd 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -45172,6 +45172,60 @@ export namespace Schemas {version?: number | null;}+ export interface MCPMissingCapabilitiesItem {+ distinct_id: string;+ /** Resolved client label, the client's own self-reported name when unrecognized, or "Unidentified client" when the report carried no client identity at all. */+ harness: string;+ /** The agent's own words for the capability it wanted, from $mcp_intent. */+ intent: string;+ /** JSON-encoded person email/name for display; "{}" when neither resolved. */+ person_properties: string;+ /** Conversation id: $mcp_session_id, falling back to $session_id; empty when neither is set. */+ session_id: string;+ timestamp: string;+ }++ export interface MCPMissingCapabilitiesQueryResponse {+ /** 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. */+ has_next: boolean;+ /** 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: MCPMissingCapabilitiesItem[];+ /** 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 MCPMissingCapabilitiesQuery {+ dateRange?: DateRange | null;+ kind?: 'MCPMissingCapabilitiesQuery';+ /** Page size; defaults to 100, capped at 500. */+ limit?: number | null;+ /** Modifiers used when performing the query */+ modifiers?: HogQLQueryModifiers | null;+ /** Reports to skip before returning results. Combine with limit to page through them; the response's has_next flag indicates whether more remain. */+ offset?: number | null;+ response?: MCPMissingCapabilitiesQueryResponse | null;+ /** Case-insensitive substring match over the report text. */+ search?: string | null;+ tags?: QueryLogTags | null;+ /** version of the node, used for schema migrations */+ version?: number | null;+ }+/*** Extra globals for the query*/@@ -45202,7 +45256,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 | NonIntegratedConversionsTableQuery | 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 | null;+ sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | NonIntegratedConversionsTableQuery | 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;tags?: QueryLogTags | null;/** Variables to be subsituted into the query */variables?: HogQLMetadataVariables;@@ -45228,7 +45282,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 | NonIntegratedConversionsTableQuery | 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 | null;+ sourceQuery?: EventsNode | ActionsNode | PersonsNode | EventsQuery | SessionsQuery | ActorsQuery | GroupsQuery | InsightActorsQuery | InsightActorsQueryOptions | SessionsTimelineQuery | HogQuery | HogQLQuery | HogQLMetadata | HogQLAutocomplete | MarketingAnalyticsTableQuery | MarketingAnalyticsAggregatedQuery | MarketingAnalyticsAttributionQuery | MarketingAnalyticsAttributionPathsQuery | MarketingAnalyticsRetentionQuery | NonIntegratedConversionsTableQuery | 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;/** Start position of the editor word */startPosition: number;tags?: QueryLogTags | null;@@ -70745,7 +70799,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 | NonIntegratedConversionsTableQuery | 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 | 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 | NonIntegratedConversionsTableQuery | 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;/** 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@@ -73328,6 +73382,30 @@ export namespace Schemas {}export interface QueryResponseAlternative112 {+ /** 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. */+ has_next: boolean;+ /** 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: MCPMissingCapabilitiesItem[];+ /** 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 QueryResponseAlternative113 {/** Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise. */error?: string | null;/** Generated HogQL query. */@@ -73349,18 +73427,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 | QueryResponseAlternative38 | unknown | QueryResponseAlternative39 | QueryResponseAlternative40 | QueryResponseAlternative41 | QueryResponseAlternative42 | QueryResponseAlternative43 | QueryResponseAlternative44 | QueryResponseAlternative45 | QueryResponseAlternative46 | QueryResponseAlternative47 | QueryResponseAlternative48 | QueryResponseAlternative49 | QueryResponseAlternative50 | QueryResponseAlternative51 | QueryResponseAlternative52 | QueryResponseAlternative53 | QueryResponseAlternative54 | QueryResponseAlternative56 | QueryResponseAlternative57 | QueryResponseAlternative58 | QueryResponseAlternative60 | QueryResponseAlternative61 | QueryResponseAlternative62 | QueryResponseAlternative63 | QueryResponseAlternative64 | QueryResponseAlternative65 | QueryResponseAlternative66 | QueryResponseAlternative67 | QueryResponseAlternative68 | QueryResponseAlternative70 | QueryResponseAlternative71 | QueryResponseAlternative72 | QueryResponseAlternative73 | QueryResponseAlternative74 | QueryResponseAlternative75 | QueryResponseAlternative76 | QueryResponseAlternative77 | QueryResponseAlternative78 | QueryResponseAlternative79 | QueryResponseAlternative80 | QueryResponseAlternative81 | QueryResponseAlternative82 | QueryResponseAlternative83 | QueryResponseAlternative84 | QueryResponseAlternative85 | 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 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 | QueryResponseAlternative38 | unknown | QueryResponseAlternative39 | QueryResponseAlternative40 | QueryResponseAlternative41 | QueryResponseAlternative42 | QueryResponseAlternative43 | QueryResponseAlternative44 | QueryResponseAlternative45 | QueryResponseAlternative46 | QueryResponseAlternative47 | QueryResponseAlternative48 | QueryResponseAlternative49 | QueryResponseAlternative50 | QueryResponseAlternative51 | QueryResponseAlternative52 | QueryResponseAlternative53 | QueryResponseAlternative54 | QueryResponseAlternative56 | QueryResponseAlternative57 | QueryResponseAlternative58 | QueryResponseAlternative60 | QueryResponseAlternative61 | QueryResponseAlternative62 | QueryResponseAlternative63 | QueryResponseAlternative64 | QueryResponseAlternative65 | QueryResponseAlternative66 | QueryResponseAlternative67 | QueryResponseAlternative68 | QueryResponseAlternative70 | QueryResponseAlternative71 | QueryResponseAlternative72 | QueryResponseAlternative73 | QueryResponseAlternative74 | QueryResponseAlternative75 | QueryResponseAlternative76 | QueryResponseAlternative77 | QueryResponseAlternative78 | QueryResponseAlternative79 | QueryResponseAlternative80 | QueryResponseAlternative81 | QueryResponseAlternative82 | QueryResponseAlternative83 | QueryResponseAlternative84 | QueryResponseAlternative85 | 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 | QueryResponseAlternative113;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 | NonIntegratedConversionsTableQuery | 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 | 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 | NonIntegratedConversionsTableQuery | 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;}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 | NonIntegratedConversionsTableQuery | 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 | 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 | NonIntegratedConversionsTableQuery | 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;}export interface QuotaResourceLimit {diff --git a/services/mcp/src/tools/generated/mcp_analytics.ts b/services/mcp/src/tools/generated/mcp_analytics.tsindex cfe0c39b4c5b..57c3b0f961d7 100644--- a/services/mcp/src/tools/generated/mcp_analytics.ts+++ b/services/mcp/src/tools/generated/mcp_analytics.ts@@ -672,6 +672,20 @@ const MCPToolDescriptionsQuery = z.object({.describe('The effective tool name to scope to (matched against the single-exec-resolved tool name).'),})+const integer = z.coerce.number().int()++const MCPMissingCapabilitiesQuery = z.object({+ dateRange: DateRange.optional(),+ kind: z.literal('MCPMissingCapabilitiesQuery').default('MCPMissingCapabilitiesQuery'),+ limit: integer.describe('Page size; defaults to 100, capped at 500.').optional(),+ offset: integer+ .describe(+ "Reports to skip before returning results. Combine with limit to page through them; the response's has_next flag indicates whether more remain."+ )+ .optional(),+ search: z.string().describe('Case-insensitive substring match over the report text.').optional(),+})+export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {'mcp-analytics-intent-clusters-recompute': mcpAnalyticsIntentClustersRecompute,'mcp-analytics-intent-clusters-retrieve': mcpAnalyticsIntentClustersRetrieve,@@ -725,4 +739,9 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {schema: MCPToolDescriptionsQuery,kind: 'MCPToolDescriptionsQuery',}),+ 'query-mcp-missing-capabilities': createQueryWrapper({+ name: 'query-mcp-missing-capabilities',+ schema: MCPMissingCapabilitiesQuery,+ kind: 'MCPMissingCapabilitiesQuery',+ }),}diff --git a/services/mcp/src/tools/links/app-url-manifest.json b/services/mcp/src/tools/links/app-url-manifest.jsonindex ea4bdce29fb3..c54d50aa3287 100644--- a/services/mcp/src/tools/links/app-url-manifest.json+++ b/services/mcp/src/tools/links/app-url-manifest.json@@ -1074,6 +1074,11 @@"params": [],"scope": "project"},+ "mcpAnalyticsMissingCapabilities": {+ "template": "/mcp-analytics/missing-capabilities",+ "params": [],+ "scope": "project"+ },"mcpAnalyticsNotifications": {"template": "/mcp-analytics/notifications","params": [],diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.jsonindex 01ec499f2e07..9a74d9ab7bd4 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/generate-app-url.json@@ -13,7 +13,7 @@"type": "object"},"url": {- "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/billing/authorization_status\n/business-knowledge\n/canvas\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/button-tiles/{buttonTileId}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/text-tiles/{textTileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/comments\n/data-management/comments/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors/{handle}\n/engineering-analytics/health\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/test-health\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/error_tracking/{id}/fingerprints\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/link/{id}\n/links\n/live-debugger\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/actions/{actionId}\n/replay-vision/actions/{actionId}/edit\n/replay-vision/actions/{actionId}/runs/{runId}\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/self-driving\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay-vision/{scannerId}/actions/new\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/themes/custom-css\n/toolbar\n/tracing\n/unsubscribe\n/user_research\n/user_research/{id}\n/user_research/{topicId}/response/{responseId}\n/verify_email\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}",+ "description": "A path template copied verbatim from the catalog below (e.g. `/persons/{uuid}`). Its `{placeholders}` are filled from `params`. These slugs come from PostHog's canonical route table, so they are always correct — never pass a path that is not in this list.\n\n/account-connected/{kind}\n/account/credential-review\n/account/social-connected\n/activity-logs\n/activity/{tab}\n/agentic/account-mismatch\n/agentic/authorize\n/ai\n/ai-enrichment\n/ai-evals/datasets\n/ai-evals/datasets/{id}\n/ai-evals/evaluations\n/ai-evals/evaluations/offline/experiments\n/ai-evals/evaluations/offline/experiments/{experimentId}\n/ai-evals/evaluations/templates\n/ai-evals/evaluations/{id}\n/ai-evals/taggers\n/ai-evals/taggers/{id}\n/ai-gateway\n/ai-observability/clusters\n/ai-observability/clusters/{runId}/{clusterId}\n/ai-observability/dashboard\n/ai-observability/errors\n/ai-observability/generations\n/ai-observability/playground\n/ai-observability/reviews\n/ai-observability/self-driving\n/ai-observability/sentiment\n/ai-observability/sessions\n/ai-observability/sessions/{id}\n/ai-observability/tools\n/ai-observability/traces\n/ai-observability/traces/{id}\n/ai-observability/users\n/ai/history\n/alerts\n/approvals/{id}\n/billing/authorization_status\n/business-knowledge\n/canvas\n/cli/authorize\n/cli/live\n/code-review\n/code/canvas/{channelId}/{dashboardId}\n/code/channel/{channelId}\n/code/task/{taskId}\n/cohorts\n/cohorts/{id}\n/cohorts/{id}/calculation-history\n/connect/vercel/link\n/coupons/{campaign}\n/create-organization\n/customer_analytics\n/customer_analytics/accounts\n/customer_analytics/accounts/{accountId}\n/customer_analytics/announcements\n/customer_analytics/configuration\n/customer_analytics/dashboard\n/customer_analytics/feature-requests\n/customer_analytics/feed\n/customer_analytics/journeys\n/customer_analytics/journeys/new\n/customer_analytics/journeys/templates\n/customer_analytics/journeys/{id}/edit\n/customer_analytics/notes\n/dashboard\n/dashboard/templates/{templateId}/copy-to-project\n/dashboard/{id}\n/dashboard/{id}/button-tiles/{buttonTileId}\n/dashboard/{id}/sharing\n/dashboard/{id}/subscriptions\n/dashboard/{id}/subscriptions/{subscriptionId}\n/dashboard/{id}/text-tiles/{textTileId}\n/data-catalog\n/data-catalog/metrics/{name}\n/data-management/actions\n/data-management/actions/new\n/data-management/actions/new/\n/data-management/actions/{id}\n/data-management/annotations\n/data-management/annotations/{id}\n/data-management/comments\n/data-management/comments/{id}\n/data-management/core-events\n/data-management/database\n/data-management/destinations\n/data-management/event-filtering\n/data-management/events\n/data-management/events/{id}\n/data-management/events/{id}/edit\n/data-management/history\n/data-management/ingestion-warnings\n/data-management/ingestion-warnings-v2\n/data-management/managed-viewsets\n/data-management/materialized-columns\n/data-management/properties\n/data-management/properties/{id}\n/data-management/properties/{id}/edit\n/data-management/revenue\n/data-management/schema\n/data-management/sources\n/data-management/sources/{id}/schemas\n/data-management/sources/{sourceId}/schemas/{schemaId}\n/data-management/transformations\n/data-management/variables\n/data-management/variables/{id}\n/data-management/variables/{id}/edit\n/data-management/warehouse-properties\n/data-ops\n/data-warehouse/connect\n/data-warehouse/new-source\n/debug\n/debug/hog\n/early_access_features\n/early_access_features/{id}\n/embedded/{token}\n/endpoints\n/endpoints/{name}\n/engineering-analytics/authors/{handle}\n/engineering-analytics/health\n/engineering-analytics/overview\n/engineering-analytics/pull-requests\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/runs/{runId}\n/engineering-analytics/repos/{repoOwner}/{repoName}/actions/workflows/{workflowName}\n/engineering-analytics/repos/{repoOwner}/{repoName}/pull-requests/{number}\n/engineering-analytics/teams\n/engineering-analytics/teams/{ownerTeam}\n/engineering-analytics/test-health\n/engineering-analytics/workflows\n/error_tracking\n/error_tracking/alerts/new/{templateId}\n/error_tracking/alerts/{id}\n/error_tracking/fingerprint/{fingerprint}\n/error_tracking/{id}\n/error_tracking/{id}/fingerprints\n/events/{id}/{timestamp}\n/experiments\n/experiments/shared-metrics\n/experiments/shared-metrics/{id}\n/experiments/staff\n/experiments/{id}\n/exports\n/feature_flags\n/feature_flags/new\n/feature_flags/staff\n/feature_flags/staff/cohorts\n/feature_flags/templates\n/feature_flags/{id}\n/functions/new/{templateId}\n/functions/{id}\n/games/368hedgehogs\n/games/flappyhog\n/groups/{groupTypeIndex}\n/groups/{groupTypeIndex}/new\n/groups/{groupTypeIndex}/{groupKey}\n/health\n/health/alerts\n/health/pipeline-status\n/health/sdk-health\n/health/{category}\n/heatmaps\n/heatmaps/new\n/heatmaps/recording\n/heatmaps/{id}\n/home\n/identity-matching\n/inbox\n/inbox/reports/triage\n/inbox/scouts/findings\n/inbox/scouts/runs\n/inbox/scouts/scratchpad\n/inbox/scouts/{skillName}\n/inbox/{tab}/{reportId}\n/insights\n/insights/new\n/insights/quick-start\n/insights/{id}\n/insights/{id}/edit\n/insights/{id}/sharing\n/insights/{id}/subscriptions\n/insights/{id}/subscriptions/{subscriptionId}\n/insights/{insightShortId}/alerts\n/instance/async_migrations\n/instance/async_migrations/future\n/instance/async_migrations/settings\n/instance/dead_letter_queue\n/instance/kafka_inspector\n/instance/metrics\n/instance/settings\n/instance/staff_users\n/instance/status\n/integrations/stripe/confirm-install\n/integrations/vercel/link-error\n/integrations/{kind}/callback\n/integrations/{slug}\n/legal\n/legal/new/{type}\n/link/{id}\n/links\n/live-debugger\n/login\n/login/2fa\n/login/2fa_setup\n/logs\n/logs/alerts/{alertId}/notifications/{hogFunctionId}\n/logs/alerts/{id}\n/logs/drop-rules/new\n/logs/drop-rules/{id}\n/logs/retention-rules/new\n/logs/retention-rules/{id}\n/managed_migrations\n/managed_migrations/new\n/marketing\n/mcp-analytics\n/mcp-analytics/activity\n/mcp-analytics/dashboard\n/mcp-analytics/intent-clustering\n/mcp-analytics/missing-capabilities\n/mcp-analytics/notifications\n/mcp-analytics/sessions\n/mcp-analytics/tool-quality\n/mcp-analytics/tool-quality/{toolName}\n/mcp-servers\n/mcp-servers/agent/{id}\n/mcp-servers/member/{id}\n/mcp-servers/server/{id}\n/mcp-servers/{tab}\n/metrics\n/models\n/models/{id}\n/move-to-cloud\n/my-tickets\n/notebooks\n/notebooks/{shortId}\n/oauth/authorize\n/onboarding\n/organization-deactivated\n/organization-pending-deletion\n/organization/billing\n/organization/billing/overview\n/organization/confirm-creation\n/organization/create-project\n/person/{id}\n/persons\n/persons/{uuid}\n/pipeline/batch-exports/new/{service}\n/pipeline/batch-exports/{id}\n/pipeline/new/\n/pipeline/plugins/{id}\n/preflight\n/product_tours\n/product_tours/{id}\n/project-pending-deletion\n/prompt-management/prompts\n/prompt-management/prompts/{name}\n/pulse\n/replay-vision\n/replay-vision/actions/{actionId}\n/replay-vision/actions/{actionId}/edit\n/replay-vision/actions/{actionId}/runs/{runId}\n/replay-vision/new/template\n/replay-vision/observations/{observationId}\n/replay-vision/{id}/budget\n/replay-vision/{id}/configure\n/replay-vision/{id}/details\n/replay-vision/{id}/overview\n/replay-vision/{id}/self-driving\n/replay-vision/{id}/template\n/replay-vision/{id}/triggers\n/replay-vision/{scannerId}/actions/new\n/replay/file-playback\n/replay/home\n/replay/kiosk\n/replay/playlists/{id}\n/replay/settings\n/replay/{id}\n/reset\n/reset/{userUuid}/{token}\n/reset_2fa/{userUuid}/{token}\n/resource-transfer/{resourceKind}/{resourceId}\n/sessions/{id}\n/settings/environment-approvals\n/settings/project\n/settings/user-feature-previews\n/shared/{token}\n/shared_dashboard/{shareToken}\n/signup\n/signup/{id}\n/site/{url}\n/skills\n/skills/community\n/skills/{categoryTab}\n/skills/{name}\n/slack-task-context\n/sql\n/stamphog\n/stamphog/digests\n/stamphog/install/callback\n/stamphog/runs\n/startups\n/streamlit-apps\n/streamlit-apps/new\n/streamlit-apps/{id}\n/streamlit-apps/{id}/edit\n/subscriptions\n/subscriptions/new\n/subscriptions/{id}\n/subscriptions/{id}/edit\n/support\n/support/settings\n/support/tickets\n/support/tickets/{ticketId}\n/surveys\n/surveys/form/new\n/surveys/guided/new\n/surveys/{id}\n/tasks\n/tasks/new\n/tasks/{taskId}\n/themes/custom-css\n/toolbar\n/tracing\n/unsubscribe\n/user_research\n/user_research/{id}\n/user_research/{topicId}/response/{responseId}\n/verify_email\n/visual_review\n/visual_review/repos/{repoId}/flakiness\n/visual_review/repos/{repoId}/runs\n/visual_review/repos/{repoId}/snapshots\n/visual_review/repos/{repoId}/{runType}/snapshots/{identifier}\n/visual_review/runs/{runId}\n/visual_review/settings\n/web\n/web-scripts\n/web-scripts/new\n/web/agents\n/web/bots\n/web/health\n/web/live\n/web/marketing\n/web/page-performance\n/web/page-reports\n/web/recap\n/web/session-attribution-explorer\n/web/web-vitals\n/wizard\n/workflows\n/workflows/library/messages/{id}\n/workflows/library/templates/new\n/workflows/library/templates/{id}\n/workflows/new/workflow\n/workflows/{id}/{tab}","type": "string"}},