Skip to content

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

feat(paths): clarify wildcard groups require a paid plan (#65904)

Steven Shultsf5e125607d0b
diff --git a/ee/hogai/tools/create_insight.py b/ee/hogai/tools/create_insight.py
index ca1bf5bc98b4..f63d7a18999d 100644
--- a/ee/hogai/tools/create_insight.py
+++ b/ee/hogai/tools/create_insight.py
@@ -29,6 +29,7 @@ Follow these guidelines when retrieving data:
- If the retrieved data and any data earlier in the conversations allow for conclusions, answer the user's question and provide actionable feedback.
- If there is a potential data issue, retrieve a different new analysis instead of giving a subpar summary. Note: empty data is NOT a potential data issue.
- If the query cannot be answered with a UI-built insight type - trends, funnels, retention - choose the SQL type to answer the question (e.g. for listing events or aggregating in ways that aren't supported in trends/funnels/retention).
+- Paths insights (user journey/path visualizations, including wildcard groups and other Advanced paths controls) cannot be created or edited with this tool, and you should not attempt to edit a paths insight as a trends/funnel/retention insight. If a user asks to add wildcard groups - whether in path groupings or in exclusions - to a paths insight, know that wildcard groups are part of "Advanced paths", a paid feature. If the user is on a free plan this control is disabled in the UI, so tell them it requires upgrading to a paid plan rather than suggesting workarounds.
Remember: do NOT retrieve data for the same query more than 3 times in a row.
Important: If the user request is about analysis of entities that are not collected data (events, properties, etc) like data warehouse entities, use SQL.
diff --git a/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.test.tsx b/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.test.tsx
index f51b81f187ab..a3a6b9027afc 100644
--- a/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.test.tsx
+++ b/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.test.tsx
@@ -12,6 +12,7 @@ import { mockEventDefinitions } from '~/test/mocks'
import { AppContext } from '~/types'
import { infiniteListLogic } from './infiniteListLogic'
+import { getCategoryPillDisabledReason } from './InfiniteSelectResults'
import { taxonomicFilterLogic } from './taxonomicFilterLogic'
window.POSTHOG_APP_CONTEXT = {
@@ -122,4 +123,33 @@ describe('InfiniteSelectResults - CategoryPill logic mounting', () => {
expect(eventsLogic.pathString).toContain('events')
expect(actionsLogic.pathString).toContain('actions')
})
+
+ describe('getCategoryPillDisabledReason', () => {
+ it.each<[string, boolean, TaxonomicFilterGroupType, boolean, string | null]>([
+ ['interactive pill has no disabled reason', true, TaxonomicFilterGroupType.Wildcards, false, null],
+ [
+ 'empty Wildcards on free plan shows the paygate copy',
+ false,
+ TaxonomicFilterGroupType.Wildcards,
+ false,
+ 'Wildcard groups are only available on paid plans',
+ ],
+ [
+ 'empty Wildcards on a paid plan falls back to "No results"',
+ false,
+ TaxonomicFilterGroupType.Wildcards,
+ true,
+ 'No results',
+ ],
+ [
+ 'empty non-Wildcards group always shows "No results"',
+ false,
+ TaxonomicFilterGroupType.Events,
+ false,
+ 'No results',
+ ],
+ ])('%s', (_name, canInteract, groupType, hasPathsAdvanced, expected) => {
+ expect(getCategoryPillDisabledReason(canInteract, groupType, hasPathsAdvanced)).toBe(expected)
+ })
+ })
})
diff --git a/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsx b/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsx
index 69cdb7cd62fa..2e0e402d426b 100644
--- a/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsx
+++ b/frontend/src/lib/components/TaxonomicFilter/InfiniteSelectResults.tsx
@@ -1,7 +1,7 @@
import { BindLogic, useActions, useValues } from 'kea'
import { useRef } from 'react'
-import { LemonTag } from '@posthog/lemon-ui'
+import { LemonTag, Tooltip } from '@posthog/lemon-ui'
import { InfiniteList } from 'lib/components/TaxonomicFilter/InfiniteList'
import { infiniteListLogic } from 'lib/components/TaxonomicFilter/infiniteListLogic'
@@ -14,6 +14,9 @@ import {
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
import { cn } from 'lib/utils/css-classes'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
+import { userLogic } from 'scenes/userLogic'
+
+import { AvailableFeature } from '~/types'
import { TaxonomicFilterEmptyState, taxonomicFilterGroupTypesWithEmptyStates } from './TaxonomicFilterEmptyState'
import { taxonomicFilterLogic } from './taxonomicFilterLogic'
@@ -26,6 +29,22 @@ export interface InfiniteSelectResultsProps {
categoryDropdownVariant?: CategoryDropdownVariant
}
+export function getCategoryPillDisabledReason(
+ canInteract: boolean,
+ groupType: TaxonomicFilterGroupType,
+ hasPathsAdvanced: boolean
+): string | null {
+ if (canInteract) {
+ return null
+ }
+ // Wildcard groups (paths) are gated behind Advanced paths — explain the paygate rather than a generic "No results".
+ // Paid users with no wildcards defined still see "No results" since they can add them.
+ if (groupType === TaxonomicFilterGroupType.Wildcards && !hasPathsAdvanced) {
+ return 'Wildcard groups are only available on paid plans'
+ }
+ return 'No results'
+}
+
// CategoryPillContent uses useValues(infiniteListLogic) without props, relying on BindLogic context
// This ensures proper logic mounting and prevents "Can not find path" KEA errors
function CategoryPillContent({
@@ -38,6 +57,7 @@ function CategoryPillContent({
onClick: () => void
}): JSX.Element {
const { taxonomicGroups } = useValues(taxonomicFilterLogic)
+ const { hasAvailableFeature } = useValues(userLogic)
const {
totalResultCount,
totalListCount,
@@ -57,13 +77,24 @@ function CategoryPillContent({
groupType === TaxonomicFilterGroupType.SuggestedFilters
const showLoading = (isLoading && hasRemoteDataSource) || isLocalDataLoading
- return (
+ const hasPathsAdvanced = hasAvailableFeature(AvailableFeature.PATHS_ADVANCED)
+ const disabledReason = getCategoryPillDisabledReason(canInteract, groupType, hasPathsAdvanced)
+ // Wildcard groups are gated behind Advanced paths. LemonTag's `disabledReason` only renders as a slow
+ // native `title`, so surface the upgrade hint via a proper Tooltip (below) instead. Other groups keep the
+ // existing `disabledReason` ("No results") behavior.
+ const isGatedWildcards = !canInteract && groupType === TaxonomicFilterGroupType.Wildcards && !hasPathsAdvanced
+
+ const tag = (
<LemonTag
type={isActive ? 'primary' : canInteract ? 'option' : 'muted'}
data-attr={`taxonomic-tab-${groupType}`}
onClick={canInteract ? onClick : undefined}
- disabledReason={!canInteract ? 'No results' : null}
+ disabledReason={disabledReason}
className="font-normal"
+ // For the gated case the reason is shown via the Tooltip below, so suppress LemonTag's native `title`
+ // to avoid a duplicate tooltip while keeping its disabled semantics (aria-disabled, cursor, styling).
+ // aria-label keeps the reason screen-reader-accessible since the suppressed title no longer can.
+ {...(isGatedWildcards ? { title: '', 'aria-label': disabledReason ?? undefined } : {})}
>
{group?.categoryLabel ? (
group.categoryLabel(totalResultCount)
@@ -88,6 +119,8 @@ function CategoryPillContent({
)}
</LemonTag>
)
+
+ return isGatedWildcards && disabledReason ? <Tooltip title={disabledReason}>{tag}</Tooltip> : tag
}
// CategoryPill wraps CategoryPillContent with BindLogic to ensure infiniteListLogic is properly mounted
diff --git a/frontend/src/queries/nodes/InsightViz/EditorFilters.tsx b/frontend/src/queries/nodes/InsightViz/EditorFilters.tsx
index f17b82f87eb2..f7c2d27bd3e0 100644
--- a/frontend/src/queries/nodes/InsightViz/EditorFilters.tsx
+++ b/frontend/src/queries/nodes/InsightViz/EditorFilters.tsx
@@ -339,7 +339,10 @@ export function EditorFilters({ query, showing, embedded }: EditorFiltersProps):
key: 'paths-exclusions',
label: 'Exclusions',
tooltip: (
- <>Exclude events from Paths visualisation. You can use wildcard groups in exclusions as well.</>
+ <>
+ Exclude events from Paths visualization. You can also use wildcard groups in exclusions if
+ you are on a paid plan.
+ </>
),
component: PathsExclusions,
show: isPaths,
diff --git a/products/posthog_ai/skills/querying-posthog-data/references/example-paths.md.j2 b/products/posthog_ai/skills/querying-posthog-data/references/example-paths.md.j2
index 377447c1249f..2bf68f7fbd42 100644
--- a/products/posthog_ai/skills/querying-posthog-data/references/example-paths.md.j2
+++ b/products/posthog_ai/skills/querying-posthog-data/references/example-paths.md.j2
@@ -3,3 +3,5 @@
```sql
{{ render_hogql_example({"kind": "PathsQuery", "filterTestAccounts": false, "dateRange": {"date_from": "-7d"}, "pathsFilter": {"includeEventTypes": ["$pageview"], "stepLimit": 3, "localPathCleaningFilters": [{"regex": "^https:\\/\\/[a-z-]+\\.posthog\\.com", "alias": "https://<region>.posthog.com"}, {"regex": "\\/project\\/\\d+", "alias": "/project/<team_id>"}, {"regex": "\\/ai-observability\\/traces\\/[0-9a-f\\-]+", "alias": "/ai-observability/traces/<trace_id>"}, {"regex": "\\/ai-observability\\/sessions\\/[0-9a-f\\-]+", "alias": "/ai-observability/sessions/<session_id>"}, {"regex": "\\/ai-evals\\/evaluations\\/[0-9a-f\\-]+", "alias": "/ai-evals/evaluations/<evaluation_id>"}, {"regex": "\\/ai-evals\\/datasets\\/[0-9a-f\\-]+", "alias": "/ai-evals/datasets/<dataset_id>"}]}, "properties": [{"type": "event", "key": "$pathname", "operator": "icontains", "value": "ai-"}, {"type": "event", "key": "$pathname", "operator": "not_icontains", "value": "docs"}]}) }}
```
+
+**Wildcard groups are a paid feature.** Wildcard groups (`pathGroupings`) — glob-like patterns using `*` to collapse similar paths into a single node, also usable in exclusions — are part of "Advanced paths", which is only available on paid plans. On the free plan these controls are hidden or disabled in the paths UI. If a user on the free plan asks to add wildcard groups (including in exclusions), explain that this requires upgrading to a paid plan rather than suggesting workarounds.
diff --git a/services/mcp/definitions/prompts/query-paths.md b/services/mcp/definitions/prompts/query-paths.md
index 46ba3a9eff07..4c93f08e9b39 100644
--- a/services/mcp/definitions/prompts/query-paths.md
+++ b/services/mcp/definitions/prompts/query-paths.md
@@ -100,6 +100,8 @@ Use `localPathCleaningFilters` to normalize dynamic URLs. Each filter has a `reg
Use `pathGroupings` for simpler glob-like grouping of paths into single nodes. Use `*` as a wildcard — the patterns are auto-escaped so only `*` has special meaning. For example, `/product/*` groups all product sub-pages into one node.
+Note: `pathGroupings` (wildcard groups) are part of "Advanced paths", which is only available on paid plans. On the free plan this option — including using wildcard groups in exclusions — is hidden or disabled in the paths UI. If a user is on the free plan, explain that wildcard groups require upgrading to a paid plan rather than suggesting workarounds.
+
## Exclusions
Use `excludeEvents` to remove specific path items that clutter the visualization. The values must match path item values, not event types: for `$pageview` paths these must match your stored `$current_url` format (e.g., `/health-check` or `https://example.com/health-check`), for `custom_event` paths these are event names (e.g., `heartbeat`). To control which event types are included, use `includeEventTypes` instead.
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index fef669b12ee6..7ea5a0b464b3 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -5736,7 +5736,7 @@
"system_prompt_hint": "Server/infrastructure metrics (OTel/Prometheus) — time series, rates, quantiles, formulas"
},
"query-paths": {
- "description": "Run a paths query to analyze the most common sequences of events or pages that users navigate through. Paths insights visualize user flows as a directed graph, showing how users move between steps and where they drop off.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What do users do after signing up?\n- What pages do users visit before making a purchase?\n- What are the most common navigation flows on your website?\n- Where do users drop off in a particular flow?\n- What custom events lead to a conversion?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Paths guidelines\n\n## Event types\n\nPaths analyze sequences of events. Specify which event types to include using `includeEventTypes`. If omitted, all events are included without type filtering.\n\n- `$pageview` - web page views. Path values come from `$current_url`, with trailing slashes stripped, so they must match your stored URL format. This is often a path like `/login`, but may also be a full URL like `https://example.com/login`. Best for analyzing website navigation flows. This is the most common choice.\n- `$screen` - mobile screen views. Path values are screen names (from `$screen_name`). Use for mobile app navigation analysis.\n- `custom_event` - custom events (any event whose name does not start with `$`). Path values are event names. Use for analyzing flows of custom-tracked events like button clicks, form submissions, or feature usage.\n- `hogql` - custom HogQL expression. Use with `pathsHogQLExpression` for advanced path definitions.\n\nYou can combine multiple types. For example, include both `$pageview` and `custom_event` to see how page views and custom events interleave.\n\n## Start and end points\n\nUse `startPoint` to filter paths that begin at a specific step, or `endPoint` to filter paths that end at a specific step. The value format depends on the event type:\n\n- For `$pageview`: use the same URL format as your `$current_url` values, often paths like `/login`, `/dashboard`, `/settings`, but sometimes full URLs\n- For `$screen`: use screen names\n- For `custom_event`: use event names like `user signed up`, `purchase completed`\n\n## Path cleaning\n\nUse `localPathCleaningFilters` to normalize dynamic URLs. Each filter has a `regex` pattern (ClickHouse regex syntax) and an `alias` replacement. Filters are applied in sequence using `replaceRegexpAll(path, regex, alias)`. For example, to normalize product URLs: `{ \"regex\": \"\\\\/product\\\\/\\\\d+\", \"alias\": \"/product/:id\" }`.\n\nUse `pathGroupings` for simpler glob-like grouping of paths into single nodes. Use `*` as a wildcard — the patterns are auto-escaped so only `*` has special meaning. For example, `/product/*` groups all product sub-pages into one node.\n\n## Exclusions\n\nUse `excludeEvents` to remove specific path items that clutter the visualization. The values must match path item values, not event types: for `$pageview` paths these must match your stored `$current_url` format (e.g., `/health-check` or `https://example.com/health-check`), for `custom_event` paths these are event names (e.g., `heartbeat`). To control which event types are included, use `includeEventTypes` instead.\n\n# Examples\n\n## What pages do users visit after the homepage?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"startPoint\": \"/\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What do users do after signing up?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"startPoint\": \"user signed up\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Navigation paths excluding noisy URLs\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"excludeEvents\": [\"/health-check\", \"/ping\"],\n \"stepLimit\": 5,\n \"edgeLimit\": 30\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Custom event paths excluding noisy events\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"excludeEvents\": [\"heartbeat\"],\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Paths with URL cleaning for dynamic segments\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"stepLimit\": 5,\n \"localPathCleaningFilters\": [\n { \"regex\": \"\\\\/user\\\\/\\\\d+\", \"alias\": \"/user/:id\" },\n { \"regex\": \"\\\\/project\\\\/[a-f0-9-]+\", \"alias\": \"/project/:id\" }\n ]\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What paths lead to the pricing page for mobile users?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"endPoint\": \"/pricing\",\n \"stepLimit\": 5\n },\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.\n- Always specify `includeEventTypes` to scope the analysis to relevant event types. If omitted, all events are included which may produce noisy results.\n- Use `$pageview` as the default event type for web navigation questions.\n- Path cleaning filters (`localPathCleaningFilters`) use ClickHouse regex and are only needed when dynamic URL segments would fragment the visualization. Path groupings (`pathGroupings`) use glob-like patterns with `*` wildcards for simpler cases.\n- Paths group events into sessions with a 30-minute inactivity threshold — events more than 30 minutes apart start a new path session.",
+ "description": "Run a paths query to analyze the most common sequences of events or pages that users navigate through. Paths insights visualize user flows as a directed graph, showing how users move between steps and where they drop off.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What do users do after signing up?\n- What pages do users visit before making a purchase?\n- What are the most common navigation flows on your website?\n- Where do users drop off in a particular flow?\n- What custom events lead to a conversion?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Paths guidelines\n\n## Event types\n\nPaths analyze sequences of events. Specify which event types to include using `includeEventTypes`. If omitted, all events are included without type filtering.\n\n- `$pageview` - web page views. Path values come from `$current_url`, with trailing slashes stripped, so they must match your stored URL format. This is often a path like `/login`, but may also be a full URL like `https://example.com/login`. Best for analyzing website navigation flows. This is the most common choice.\n- `$screen` - mobile screen views. Path values are screen names (from `$screen_name`). Use for mobile app navigation analysis.\n- `custom_event` - custom events (any event whose name does not start with `$`). Path values are event names. Use for analyzing flows of custom-tracked events like button clicks, form submissions, or feature usage.\n- `hogql` - custom HogQL expression. Use with `pathsHogQLExpression` for advanced path definitions.\n\nYou can combine multiple types. For example, include both `$pageview` and `custom_event` to see how page views and custom events interleave.\n\n## Start and end points\n\nUse `startPoint` to filter paths that begin at a specific step, or `endPoint` to filter paths that end at a specific step. The value format depends on the event type:\n\n- For `$pageview`: use the same URL format as your `$current_url` values, often paths like `/login`, `/dashboard`, `/settings`, but sometimes full URLs\n- For `$screen`: use screen names\n- For `custom_event`: use event names like `user signed up`, `purchase completed`\n\n## Path cleaning\n\nUse `localPathCleaningFilters` to normalize dynamic URLs. Each filter has a `regex` pattern (ClickHouse regex syntax) and an `alias` replacement. Filters are applied in sequence using `replaceRegexpAll(path, regex, alias)`. For example, to normalize product URLs: `{ \"regex\": \"\\\\/product\\\\/\\\\d+\", \"alias\": \"/product/:id\" }`.\n\nUse `pathGroupings` for simpler glob-like grouping of paths into single nodes. Use `*` as a wildcard — the patterns are auto-escaped so only `*` has special meaning. For example, `/product/*` groups all product sub-pages into one node.\n\nNote: `pathGroupings` (wildcard groups) are part of \"Advanced paths\", which is only available on paid plans. On the free plan this option — including using wildcard groups in exclusions — is hidden or disabled in the paths UI. If a user is on the free plan, explain that wildcard groups require upgrading to a paid plan rather than suggesting workarounds.\n\n## Exclusions\n\nUse `excludeEvents` to remove specific path items that clutter the visualization. The values must match path item values, not event types: for `$pageview` paths these must match your stored `$current_url` format (e.g., `/health-check` or `https://example.com/health-check`), for `custom_event` paths these are event names (e.g., `heartbeat`). To control which event types are included, use `includeEventTypes` instead.\n\n# Examples\n\n## What pages do users visit after the homepage?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"startPoint\": \"/\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What do users do after signing up?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"startPoint\": \"user signed up\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Navigation paths excluding noisy URLs\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"excludeEvents\": [\"/health-check\", \"/ping\"],\n \"stepLimit\": 5,\n \"edgeLimit\": 30\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Custom event paths excluding noisy events\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"excludeEvents\": [\"heartbeat\"],\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Paths with URL cleaning for dynamic segments\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"stepLimit\": 5,\n \"localPathCleaningFilters\": [\n { \"regex\": \"\\\\/user\\\\/\\\\d+\", \"alias\": \"/user/:id\" },\n { \"regex\": \"\\\\/project\\\\/[a-f0-9-]+\", \"alias\": \"/project/:id\" }\n ]\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What paths lead to the pricing page for mobile users?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"endPoint\": \"/pricing\",\n \"stepLimit\": 5\n },\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.\n- Always specify `includeEventTypes` to scope the analysis to relevant event types. If omitted, all events are included which may produce noisy results.\n- Use `$pageview` as the default event type for web navigation questions.\n- Path cleaning filters (`localPathCleaningFilters`) use ClickHouse regex and are only needed when dynamic URL segments would fragment the visualization. Path groupings (`pathGroupings`) use glob-like patterns with `*` wildcards for simpler cases.\n- Paths group events into sessions with a 30-minute inactivity threshold — events more than 30 minutes apart start a new path session.",
"category": "Query wrappers",
"feature": "insights",
"summary": "Run a paths query",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index dddfb10e1958..422815618b05 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -6201,7 +6201,7 @@
"system_prompt_hint": "Server/infrastructure metrics (OTel/Prometheus) — time series, rates, quantiles, formulas"
},
"query-paths": {
- "description": "Run a paths query to analyze the most common sequences of events or pages that users navigate through. Paths insights visualize user flows as a directed graph, showing how users move between steps and where they drop off.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What do users do after signing up?\n- What pages do users visit before making a purchase?\n- What are the most common navigation flows on your website?\n- Where do users drop off in a particular flow?\n- What custom events lead to a conversion?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Paths guidelines\n\n## Event types\n\nPaths analyze sequences of events. Specify which event types to include using `includeEventTypes`. If omitted, all events are included without type filtering.\n\n- `$pageview` - web page views. Path values come from `$current_url`, with trailing slashes stripped, so they must match your stored URL format. This is often a path like `/login`, but may also be a full URL like `https://example.com/login`. Best for analyzing website navigation flows. This is the most common choice.\n- `$screen` - mobile screen views. Path values are screen names (from `$screen_name`). Use for mobile app navigation analysis.\n- `custom_event` - custom events (any event whose name does not start with `$`). Path values are event names. Use for analyzing flows of custom-tracked events like button clicks, form submissions, or feature usage.\n- `hogql` - custom HogQL expression. Use with `pathsHogQLExpression` for advanced path definitions.\n\nYou can combine multiple types. For example, include both `$pageview` and `custom_event` to see how page views and custom events interleave.\n\n## Start and end points\n\nUse `startPoint` to filter paths that begin at a specific step, or `endPoint` to filter paths that end at a specific step. The value format depends on the event type:\n\n- For `$pageview`: use the same URL format as your `$current_url` values, often paths like `/login`, `/dashboard`, `/settings`, but sometimes full URLs\n- For `$screen`: use screen names\n- For `custom_event`: use event names like `user signed up`, `purchase completed`\n\n## Path cleaning\n\nUse `localPathCleaningFilters` to normalize dynamic URLs. Each filter has a `regex` pattern (ClickHouse regex syntax) and an `alias` replacement. Filters are applied in sequence using `replaceRegexpAll(path, regex, alias)`. For example, to normalize product URLs: `{ \"regex\": \"\\\\/product\\\\/\\\\d+\", \"alias\": \"/product/:id\" }`.\n\nUse `pathGroupings` for simpler glob-like grouping of paths into single nodes. Use `*` as a wildcard — the patterns are auto-escaped so only `*` has special meaning. For example, `/product/*` groups all product sub-pages into one node.\n\n## Exclusions\n\nUse `excludeEvents` to remove specific path items that clutter the visualization. The values must match path item values, not event types: for `$pageview` paths these must match your stored `$current_url` format (e.g., `/health-check` or `https://example.com/health-check`), for `custom_event` paths these are event names (e.g., `heartbeat`). To control which event types are included, use `includeEventTypes` instead.\n\n# Examples\n\n## What pages do users visit after the homepage?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"startPoint\": \"/\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What do users do after signing up?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"startPoint\": \"user signed up\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Navigation paths excluding noisy URLs\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"excludeEvents\": [\"/health-check\", \"/ping\"],\n \"stepLimit\": 5,\n \"edgeLimit\": 30\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Custom event paths excluding noisy events\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"excludeEvents\": [\"heartbeat\"],\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Paths with URL cleaning for dynamic segments\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"stepLimit\": 5,\n \"localPathCleaningFilters\": [\n { \"regex\": \"\\\\/user\\\\/\\\\d+\", \"alias\": \"/user/:id\" },\n { \"regex\": \"\\\\/project\\\\/[a-f0-9-]+\", \"alias\": \"/project/:id\" }\n ]\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What paths lead to the pricing page for mobile users?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"endPoint\": \"/pricing\",\n \"stepLimit\": 5\n },\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.\n- Always specify `includeEventTypes` to scope the analysis to relevant event types. If omitted, all events are included which may produce noisy results.\n- Use `$pageview` as the default event type for web navigation questions.\n- Path cleaning filters (`localPathCleaningFilters`) use ClickHouse regex and are only needed when dynamic URL segments would fragment the visualization. Path groupings (`pathGroupings`) use glob-like patterns with `*` wildcards for simpler cases.\n- Paths group events into sessions with a 30-minute inactivity threshold — events more than 30 minutes apart start a new path session.",
+ "description": "Run a paths query to analyze the most common sequences of events or pages that users navigate through. Paths insights visualize user flows as a directed graph, showing how users move between steps and where they drop off.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters.\n\nExamples of use cases include:\n\n- What do users do after signing up?\n- What pages do users visit before making a purchase?\n- What are the most common navigation flows on your website?\n- Where do users drop off in a particular flow?\n- What custom events lead to a conversion?\n\nCRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.\n\n# Data narrowing\n\n## Property filters\n\nUse property filters to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional segmentation and always use the minimum set of property filters needed.\n\nIMPORTANT: Do not check if a property is set unless the user explicitly asks for it.\n\nWhen using a property filter, you should:\n\n- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `paidCustomer` or `icp_score`.\n- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.\n- After selecting a property, **validate that the property value accurately reflects the intended criteria**.\n- **Find the suitable operator for type** (e.g., `contains`, `is set`).\n- If the operator requires a value, use the `read-data-schema` tool to find the property values.\n- You set logical operators to combine multiple properties of a single series: AND or OR.\n\nInfer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.\n\nSupported operators for the String type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- contains (icontains)\n- doesn't contain (not_icontains)\n- matches regex (regex)\n- doesn't match regex (not_regex)\n- is set\n- is not set\n\nSupported operators for the Numeric type are:\n\n- equals (exact)\n- doesn't equal (is_not)\n- greater than (gt)\n- less than (lt)\n- is set\n- is not set\n\nSupported operators for the DateTime type are:\n\n- equals (is_date_exact)\n- doesn't equal (is_not for existence check)\n- before (is_date_before)\n- after (is_date_after)\n- is set\n- is not set\n\nSupported operators for the Boolean type are:\n\n- equals\n- doesn't equal\n- is set\n- is not set\n\nAll operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).\n\n## Time period\n\nYou should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, use last 30 days as a default time period.\n\n# Paths guidelines\n\n## Event types\n\nPaths analyze sequences of events. Specify which event types to include using `includeEventTypes`. If omitted, all events are included without type filtering.\n\n- `$pageview` - web page views. Path values come from `$current_url`, with trailing slashes stripped, so they must match your stored URL format. This is often a path like `/login`, but may also be a full URL like `https://example.com/login`. Best for analyzing website navigation flows. This is the most common choice.\n- `$screen` - mobile screen views. Path values are screen names (from `$screen_name`). Use for mobile app navigation analysis.\n- `custom_event` - custom events (any event whose name does not start with `$`). Path values are event names. Use for analyzing flows of custom-tracked events like button clicks, form submissions, or feature usage.\n- `hogql` - custom HogQL expression. Use with `pathsHogQLExpression` for advanced path definitions.\n\nYou can combine multiple types. For example, include both `$pageview` and `custom_event` to see how page views and custom events interleave.\n\n## Start and end points\n\nUse `startPoint` to filter paths that begin at a specific step, or `endPoint` to filter paths that end at a specific step. The value format depends on the event type:\n\n- For `$pageview`: use the same URL format as your `$current_url` values, often paths like `/login`, `/dashboard`, `/settings`, but sometimes full URLs\n- For `$screen`: use screen names\n- For `custom_event`: use event names like `user signed up`, `purchase completed`\n\n## Path cleaning\n\nUse `localPathCleaningFilters` to normalize dynamic URLs. Each filter has a `regex` pattern (ClickHouse regex syntax) and an `alias` replacement. Filters are applied in sequence using `replaceRegexpAll(path, regex, alias)`. For example, to normalize product URLs: `{ \"regex\": \"\\\\/product\\\\/\\\\d+\", \"alias\": \"/product/:id\" }`.\n\nUse `pathGroupings` for simpler glob-like grouping of paths into single nodes. Use `*` as a wildcard — the patterns are auto-escaped so only `*` has special meaning. For example, `/product/*` groups all product sub-pages into one node.\n\nNote: `pathGroupings` (wildcard groups) are part of \"Advanced paths\", which is only available on paid plans. On the free plan this option — including using wildcard groups in exclusions — is hidden or disabled in the paths UI. If a user is on the free plan, explain that wildcard groups require upgrading to a paid plan rather than suggesting workarounds.\n\n## Exclusions\n\nUse `excludeEvents` to remove specific path items that clutter the visualization. The values must match path item values, not event types: for `$pageview` paths these must match your stored `$current_url` format (e.g., `/health-check` or `https://example.com/health-check`), for `custom_event` paths these are event names (e.g., `heartbeat`). To control which event types are included, use `includeEventTypes` instead.\n\n# Examples\n\n## What pages do users visit after the homepage?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"startPoint\": \"/\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What do users do after signing up?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"startPoint\": \"user signed up\",\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Navigation paths excluding noisy URLs\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"excludeEvents\": [\"/health-check\", \"/ping\"],\n \"stepLimit\": 5,\n \"edgeLimit\": 30\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Custom event paths excluding noisy events\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"custom_event\"],\n \"excludeEvents\": [\"heartbeat\"],\n \"stepLimit\": 5\n },\n \"dateRange\": { \"date_from\": \"-14d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Paths with URL cleaning for dynamic segments\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"stepLimit\": 5,\n \"localPathCleaningFilters\": [\n { \"regex\": \"\\\\/user\\\\/\\\\d+\", \"alias\": \"/user/:id\" },\n { \"regex\": \"\\\\/project\\\\/[a-f0-9-]+\", \"alias\": \"/project/:id\" }\n ]\n },\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n## What paths lead to the pricing page for mobile users?\n\n```json\n{\n \"kind\": \"PathsQuery\",\n \"pathsFilter\": {\n \"includeEventTypes\": [\"$pageview\"],\n \"endPoint\": \"/pricing\",\n \"stepLimit\": 5\n },\n \"properties\": [{ \"key\": \"$os\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"iOS\", \"Android\"] }],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.\n- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.\n- Always specify `includeEventTypes` to scope the analysis to relevant event types. If omitted, all events are included which may produce noisy results.\n- Use `$pageview` as the default event type for web navigation questions.\n- Path cleaning filters (`localPathCleaningFilters`) use ClickHouse regex and are only needed when dynamic URL segments would fragment the visualization. Path groupings (`pathGroupings`) use glob-like patterns with `*` wildcards for simpler cases.\n- Paths group events into sessions with a 30-minute inactivity threshold — events more than 30 minutes apart start a new path session.",
"category": "Query wrappers",
"feature": "insights",
"summary": "Run a paths query",