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.

fix(mcp): document inclusive date_to boundary on query tools (#101150)

posthog[bot]ff93e679eee3
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 84f052a79eaa..21671592d258 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -2589,14 +2589,14 @@
},
"AssistantDateRange": {
"additionalProperties": false,
- "description": "This filter only works with absolute dates.",
+ "description": "This filter only works with absolute dates. A bound without a UTC offset is read in the project timezone.",
"properties": {
"date_from": {
"description": "ISO8601 date string.",
"type": "string"
},
"date_to": {
- "description": "ISO8601 date string.",
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day.",
"type": ["string", "null"]
}
},
@@ -20653,7 +20653,7 @@
"type": ["string", "null"]
},
"date_to": {
- "description": "End of the date range. Same format as date_from. Omit or null for \"now\".",
+ "description": "End of the date range. Same format as date_from. Omit or null for \"now\". A calendar day without a time (2024-01-15) is inclusive: it rounds to the last moment of that day in the project timezone, unless explicitDate is set.",
"type": ["string", "null"]
},
"daysOfWeek": {
diff --git a/frontend/src/queries/schema/schema-assistant-queries.ts b/frontend/src/queries/schema/schema-assistant-queries.ts
index bc097a3a837a..8f75393d4ed8 100644
--- a/frontend/src/queries/schema/schema-assistant-queries.ts
+++ b/frontend/src/queries/schema/schema-assistant-queries.ts
@@ -37,7 +37,7 @@ import {
import { integer, positive_integer } from './type-utils'
/**
- * This filter only works with absolute dates.
+ * This filter only works with absolute dates. A bound without a UTC offset is read in the project timezone.
*/
export interface AssistantDateRange {
/**
@@ -45,7 +45,7 @@ export interface AssistantDateRange {
*/
date_from: string
/**
- * ISO8601 date string.
+ * ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day.
*/
date_to?: string | null
}
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index ce87b53a07f8..0b2c722b792a 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -6351,7 +6351,10 @@ export interface DateRange {
* -1h (1 hour ago), -1mStart (start of last month), -1yStart (start of last year).
*/
date_from?: string | null
- /** End of the date range. Same format as date_from. Omit or null for "now". */
+ /** End of the date range. Same format as date_from. Omit or null for "now".
+ * A calendar day without a time (2024-01-15) is inclusive: it rounds to the last moment
+ * of that day in the project timezone, unless explicitDate is set.
+ */
date_to?: string | null
/** Whether the date_from and date_to should be used verbatim. Disables
* rounding to the start and end of period.
diff --git a/posthog/hogql_queries/utils/test/test_query_date_range.py b/posthog/hogql_queries/utils/test/test_query_date_range.py
index 47541a816628..afc103faa5ec 100644
--- a/posthog/hogql_queries/utils/test/test_query_date_range.py
+++ b/posthog/hogql_queries/utils/test/test_query_date_range.py
@@ -305,6 +305,13 @@ class TestQueryDateRange(APIBaseTest):
self.assertEqual(query_date_range.date_from(), parser.isoparse("2021-02-25T12:25:23.000Z"))
self.assertEqual(query_date_range.date_to(), parser.isoparse("2021-04-25T10:59:23.000Z"))
+ def test_bare_calendar_date_to_is_inclusive(self):
+ now = parser.isoparse("2021-08-25T00:00:00.000Z")
+ date_range = DateRange(date_from="2021-04-01", date_to="2021-04-25")
+ query_date_range = QueryDateRange(team=self.team, date_range=date_range, interval=IntervalType.DAY, now=now)
+
+ self.assertEqual(query_date_range.date_to(), parser.isoparse("2021-04-25T23:59:59.999999Z"))
+
def test_yesterday(self):
now = parser.isoparse("2021-08-25T00:00:00.000Z")
date_range = DateRange(date_from="-1dStart", date_to="-1dEnd", explicitDate=False)
diff --git a/posthog/schema.py b/posthog/schema.py
index 80b61b575bd4..08e2754b682d 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -589,7 +589,13 @@ class AssistantDateRange(BaseModel):
extra="forbid",
)
date_from: str = Field(..., description="ISO8601 date string.")
- date_to: str | None = Field(default=None, description="ISO8601 date string.")
+ date_to: str | None = Field(
+ default=None,
+ description=(
+ "ISO8601 date string. A calendar day without a time (`2026-09-01`) is"
+ " inclusive to the last moment of that day."
+ ),
+ )
class AssistantDurationRange(BaseModel):
@@ -1183,7 +1189,12 @@ class DateRange(BaseModel):
)
date_to: str | None = Field(
default=None,
- description=('End of the date range. Same format as date_from. Omit or null for "now".'),
+ description=(
+ 'End of the date range. Same format as date_from. Omit or null for "now". A'
+ " calendar day without a time (2024-01-15) is inclusive: it rounds to the"
+ " last moment of that day in the project timezone, unless explicitDate is"
+ " set."
+ ),
)
daysOfWeek: list[DaysOfWeekEnum] | None = Field(
default=None,
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index 1f8cbc2fab36..0bc1e026aacc 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -1393,7 +1393,7 @@ export interface DateRangeApi {
/** Start of the date range. Accepts ISO 8601 timestamps (e.g., 2024-01-15T00:00:00Z) or relative formats: -7d (7 days ago), -2w (2 weeks ago), -1m (1 month ago),
* -1h (1 hour ago), -1mStart (start of last month), -1yStart (start of last year). */
date_from?: string | null
- /** End of the date range. Same format as date_from. Omit or null for "now". */
+ /** End of the date range. Same format as date_from. Omit or null for "now". A calendar day without a time (2024-01-15) is inclusive: it rounds to the last moment of that day in the project timezone, unless explicitDate is set. */
date_to?: string | null
/** Restrict the query to events occurring on these ISO days of week (1=Monday to 7=Sunday), evaluated in the project timezone. Omit or empty for all days. Only applied by insight queries. */
daysOfWeek?: DaysOfWeekEnumApi[] | null
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index 2ceebf161950..4ba3617e72eb 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -387,7 +387,7 @@ export interface DateRangeApi {
/** Start of the date range. Accepts ISO 8601 timestamps (e.g., 2024-01-15T00:00:00Z) or relative formats: -7d (7 days ago), -2w (2 weeks ago), -1m (1 month ago),
* -1h (1 hour ago), -1mStart (start of last month), -1yStart (start of last year). */
date_from?: string | null
- /** End of the date range. Same format as date_from. Omit or null for "now". */
+ /** End of the date range. Same format as date_from. Omit or null for "now". A calendar day without a time (2024-01-15) is inclusive: it rounds to the last moment of that day in the project timezone, unless explicitDate is set. */
date_to?: string | null
/** Restrict the query to events occurring on these ISO days of week (1=Monday to 7=Sunday), evaluated in the project timezone. Omit or empty for all days. Only applied by insight queries. */
daysOfWeek?: DaysOfWeekEnumApi[] | null
diff --git a/services/mcp/definitions/prompts/query-funnel.md b/services/mcp/definitions/prompts/query-funnel.md
index 7c1c836d1a58..787f124f74e8 100644
--- a/services/mcp/definitions/prompts/query-funnel.md
+++ b/services/mcp/definitions/prompts/query-funnel.md
@@ -86,6 +86,15 @@ All operators take a single value except for `equals` and `doesn't equal` which
You 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.
+### Date boundaries
+
+A `date_to` with no time is an inclusive calendar day.
+Give a full timestamp instead to end the window at an exact instant.
+Both forms below cover all of August and nothing in September.
+
+- `{ "date_from": "2026-08-01", "date_to": "2026-08-31" }`
+- `{ "date_from": "2026-08-01T00:00:00Z", "date_to": "2026-09-01T00:00:00Z" }`
+
# Funnel guidelines
## Exclusion steps
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 08492212ea0d..952aee969f20 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -9068,7 +9068,7 @@
"system_prompt_hint": "Error issue filtering and aggregation (error-tracking category)"
},
"query-funnel": {
- "description": "Run a funnel query to analyze conversion rates through a sequence of steps. Funnel insights help understand user behavior as users navigate through a product. A funnel consists of a sequence of at least two events or actions, where some users progress to the next step while others drop off. Funnels use percentages as the primary aggregation type.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters and breakdowns.\n\nIMPORTANT: Funnels REQUIRE AT LEAST TWO series (events or actions).\n\nThe funnel insights have the following features:\n\n- Various visualization types (steps, time-to-convert, historical trends).\n- Filter data and apply exclusion steps (events only, not actions).\n- Break down data using a single property.\n- Specify conversion windows (default 14 days), step order (strict/ordered/unordered), and attribution settings.\n- Aggregate by users, sessions, or specific group types.\n- Track first-time conversions with special math aggregations.\n\nExamples of use cases include:\n\n- Conversion rates between steps.\n- Drop off steps (which step loses most users).\n- Steps with the highest friction and time to convert.\n- If product changes are improving their funnel over time.\n- Average/median/histogram of time to convert.\n- Conversion trends over time (using trends visualization type).\n- First-time user conversions (using first_time_for_user math).\n\nCRITICAL: Be minimalist. Only include filters, breakdowns, 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# Funnel guidelines\n\n## Exclusion steps\n\nUsers may want to use exclusion events to filter out conversions in which a particular event occurred between specific steps. These events should not be included in the main sequence. You should include start and end indexes (0-based) for each exclusion where the minimum `funnelFromStep` is 0 (first step) and the maximum `funnelToStep` is the number of steps minus one. Exclusion events cannot be actions, only events.\n\nIMPORTANT: Exclusion steps filter out conversions where the exclusion event occurred BETWEEN the specified steps. This does NOT exclude users who completed the event before the funnel started or after it ended.\n\nFor example, there is a sequence with three steps: sign up (step 0), finish onboarding (step 1), purchase (step 2). If the user wants to exclude all conversions in which users navigated away between sign up and finishing onboarding, the exclusion step will be `$pageleave` with `funnelFromStep: 0` and `funnelToStep: 1`.\n\n## Breakdown\n\nA breakdown is used to segment data by a single property value. They divide all defined funnel series into multiple subseries based on the values of the property. Include a breakdown **only when it is essential to directly answer the user's question**. You should not add a breakdown if the question can be addressed without additional segmentation.\n\nWhen using breakdowns, you should:\n\n- **Identify the property group** and name for a breakdown.\n- **Provide the property name** for a breakdown.\n- **Validate that the property value accurately reflects the intended criteria**.\n\nExamples of using a breakdown:\n\n- page views to sign up funnel by country: you need to find a property such as `$geoip_country_code` and set it as a breakdown.\n- conversion rate of users who have completed onboarding after signing up by an organization: you need to find a property such as `organization name` and set it as a breakdown.\n\n## Combining multiple events into a single step (`GroupNode`)\n\n**Use a `GroupNode`** when the user wants a single funnel step to match any of several events — e.g. \"Pageview OR Pageleave counts as one step\", or \"the user signed up via any of these channels\". Different filters per event are fine — put them on the inner nodes. Use separate steps instead when the user wants the events to occur in sequence. Only `OR` is supported.\n\nFunnel math (`first_time_for_user` etc.), `optionalInFunnel`, and step-wide property filters are not supported on a grouped step — filters must live on the inner nodes, and any math / optional handling must use a regular non-grouped step.\n\n**Where things live:**\n\n- On the group: only `name` (display label).\n- On each inner node: `event` (or action `id`), `properties`, `name` — all respected normally; per-node `properties` apply only to that node.\n\n### Example — funnel with a grouped step\n\nA 3-step funnel where the middle step matches either `$pageview` on Safari or `$pageleave` on Chrome:\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"sign up\" },\n {\n \"kind\": \"GroupNode\",\n \"operator\": \"OR\",\n \"name\": \"Pageview on Safari, Pageleave on Chrome\",\n \"nodes\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"name\": \"Pageview\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Safari\"] }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageleave\",\n \"name\": \"Pageleave\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Chrome\"] }]\n }\n ]\n },\n { \"kind\": \"EventsNode\", \"event\": \"purchase\" }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" }\n}\n```\n\n# Examples\n\n## Conversion from first event ingested to insight saved for organizations over 6 months\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"first team event ingested\" },\n { \"kind\": \"EventsNode\", \"event\": \"insight saved\" }\n ],\n \"dateRange\": { \"date_from\": \"-6m\" },\n \"interval\": \"month\",\n \"aggregation_group_type_index\": 0,\n \"funnelsFilter\": {\n \"funnelOrderType\": \"ordered\",\n \"funnelVizType\": \"trends\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Signup page CTA click rate within one hour, excluding page leaves, broken down by OS\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"click subscribe button\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-180d\" },\n \"interval\": \"week\",\n \"funnelsFilter\": {\n \"funnelWindowInterval\": 1,\n \"funnelWindowIntervalUnit\": \"hour\",\n \"funnelOrderType\": \"ordered\",\n \"exclusions\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageleave\", \"funnelFromStep\": 0, \"funnelToStep\": 1 }]\n },\n \"breakdownFilter\": { \"breakdown_type\": \"event\", \"breakdown\": \"$os\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Credit card purchase rate from viewing a product with strict ordering (no events in between)\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"view product\" },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"purchase\",\n \"properties\": [{ \"key\": \"paymentMethod\", \"type\": \"event\", \"value\": \"credit_card\", \"operator\": \"exact\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"funnelsFilter\": {\n \"funnelOrderType\": \"strict\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## View product to buy button to purchase, using actions and events\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"ActionsNode\", \"id\": 8882, \"name\": \"view product\" },\n { \"kind\": \"EventsNode\", \"event\": \"click buy button\" },\n {\n \"kind\": \"ActionsNode\",\n \"id\": 573,\n \"name\": \"purchase\",\n \"properties\": [\n { \"key\": \"shipping_method\", \"value\": \"express_delivery\", \"operator\": \"icontains\", \"type\": \"event\" }\n ]\n }\n ],\n \"funnelsFilter\": { \"funnelVizType\": \"steps\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- You MUST ALWAYS use AT LEAST TWO series (events or actions) in the funnel.\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- The default funnel step order is `ordered` (events in sequence but with other events allowed in between). Use `strict` when events should happen consecutively with no events in between. Use `unordered` when order doesn't matter.\n- Exclusion events in funnels only exclude conversions where the event happened between the specified steps, not before or after the funnel.",
+ "description": "Run a funnel query to analyze conversion rates through a sequence of steps. Funnel insights help understand user behavior as users navigate through a product. A funnel consists of a sequence of at least two events or actions, where some users progress to the next step while others drop off. Funnels use percentages as the primary aggregation type.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters and breakdowns.\n\nIMPORTANT: Funnels REQUIRE AT LEAST TWO series (events or actions).\n\nThe funnel insights have the following features:\n\n- Various visualization types (steps, time-to-convert, historical trends).\n- Filter data and apply exclusion steps (events only, not actions).\n- Break down data using a single property.\n- Specify conversion windows (default 14 days), step order (strict/ordered/unordered), and attribution settings.\n- Aggregate by users, sessions, or specific group types.\n- Track first-time conversions with special math aggregations.\n\nExamples of use cases include:\n\n- Conversion rates between steps.\n- Drop off steps (which step loses most users).\n- Steps with the highest friction and time to convert.\n- If product changes are improving their funnel over time.\n- Average/median/histogram of time to convert.\n- Conversion trends over time (using trends visualization type).\n- First-time user conversions (using first_time_for_user math).\n\nCRITICAL: Be minimalist. Only include filters, breakdowns, 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### Date boundaries\n\nA `date_to` with no time is an inclusive calendar day.\nGive a full timestamp instead to end the window at an exact instant.\nBoth forms below cover all of August and nothing in September.\n\n- `{ \"date_from\": \"2026-08-01\", \"date_to\": \"2026-08-31\" }`\n- `{ \"date_from\": \"2026-08-01T00:00:00Z\", \"date_to\": \"2026-09-01T00:00:00Z\" }`\n\n# Funnel guidelines\n\n## Exclusion steps\n\nUsers may want to use exclusion events to filter out conversions in which a particular event occurred between specific steps. These events should not be included in the main sequence. You should include start and end indexes (0-based) for each exclusion where the minimum `funnelFromStep` is 0 (first step) and the maximum `funnelToStep` is the number of steps minus one. Exclusion events cannot be actions, only events.\n\nIMPORTANT: Exclusion steps filter out conversions where the exclusion event occurred BETWEEN the specified steps. This does NOT exclude users who completed the event before the funnel started or after it ended.\n\nFor example, there is a sequence with three steps: sign up (step 0), finish onboarding (step 1), purchase (step 2). If the user wants to exclude all conversions in which users navigated away between sign up and finishing onboarding, the exclusion step will be `$pageleave` with `funnelFromStep: 0` and `funnelToStep: 1`.\n\n## Breakdown\n\nA breakdown is used to segment data by a single property value. They divide all defined funnel series into multiple subseries based on the values of the property. Include a breakdown **only when it is essential to directly answer the user's question**. You should not add a breakdown if the question can be addressed without additional segmentation.\n\nWhen using breakdowns, you should:\n\n- **Identify the property group** and name for a breakdown.\n- **Provide the property name** for a breakdown.\n- **Validate that the property value accurately reflects the intended criteria**.\n\nExamples of using a breakdown:\n\n- page views to sign up funnel by country: you need to find a property such as `$geoip_country_code` and set it as a breakdown.\n- conversion rate of users who have completed onboarding after signing up by an organization: you need to find a property such as `organization name` and set it as a breakdown.\n\n## Combining multiple events into a single step (`GroupNode`)\n\n**Use a `GroupNode`** when the user wants a single funnel step to match any of several events — e.g. \"Pageview OR Pageleave counts as one step\", or \"the user signed up via any of these channels\". Different filters per event are fine — put them on the inner nodes. Use separate steps instead when the user wants the events to occur in sequence. Only `OR` is supported.\n\nFunnel math (`first_time_for_user` etc.), `optionalInFunnel`, and step-wide property filters are not supported on a grouped step — filters must live on the inner nodes, and any math / optional handling must use a regular non-grouped step.\n\n**Where things live:**\n\n- On the group: only `name` (display label).\n- On each inner node: `event` (or action `id`), `properties`, `name` — all respected normally; per-node `properties` apply only to that node.\n\n### Example — funnel with a grouped step\n\nA 3-step funnel where the middle step matches either `$pageview` on Safari or `$pageleave` on Chrome:\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"sign up\" },\n {\n \"kind\": \"GroupNode\",\n \"operator\": \"OR\",\n \"name\": \"Pageview on Safari, Pageleave on Chrome\",\n \"nodes\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"name\": \"Pageview\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Safari\"] }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageleave\",\n \"name\": \"Pageleave\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Chrome\"] }]\n }\n ]\n },\n { \"kind\": \"EventsNode\", \"event\": \"purchase\" }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" }\n}\n```\n\n# Examples\n\n## Conversion from first event ingested to insight saved for organizations over 6 months\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"first team event ingested\" },\n { \"kind\": \"EventsNode\", \"event\": \"insight saved\" }\n ],\n \"dateRange\": { \"date_from\": \"-6m\" },\n \"interval\": \"month\",\n \"aggregation_group_type_index\": 0,\n \"funnelsFilter\": {\n \"funnelOrderType\": \"ordered\",\n \"funnelVizType\": \"trends\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Signup page CTA click rate within one hour, excluding page leaves, broken down by OS\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"click subscribe button\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-180d\" },\n \"interval\": \"week\",\n \"funnelsFilter\": {\n \"funnelWindowInterval\": 1,\n \"funnelWindowIntervalUnit\": \"hour\",\n \"funnelOrderType\": \"ordered\",\n \"exclusions\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageleave\", \"funnelFromStep\": 0, \"funnelToStep\": 1 }]\n },\n \"breakdownFilter\": { \"breakdown_type\": \"event\", \"breakdown\": \"$os\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Credit card purchase rate from viewing a product with strict ordering (no events in between)\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"view product\" },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"purchase\",\n \"properties\": [{ \"key\": \"paymentMethod\", \"type\": \"event\", \"value\": \"credit_card\", \"operator\": \"exact\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"funnelsFilter\": {\n \"funnelOrderType\": \"strict\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## View product to buy button to purchase, using actions and events\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"ActionsNode\", \"id\": 8882, \"name\": \"view product\" },\n { \"kind\": \"EventsNode\", \"event\": \"click buy button\" },\n {\n \"kind\": \"ActionsNode\",\n \"id\": 573,\n \"name\": \"purchase\",\n \"properties\": [\n { \"key\": \"shipping_method\", \"value\": \"express_delivery\", \"operator\": \"icontains\", \"type\": \"event\" }\n ]\n }\n ],\n \"funnelsFilter\": { \"funnelVizType\": \"steps\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- You MUST ALWAYS use AT LEAST TWO series (events or actions) in the funnel.\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- The default funnel step order is `ordered` (events in sequence but with other events allowed in between). Use `strict` when events should happen consecutively with no events in between. Use `unordered` when order doesn't matter.\n- Exclusion events in funnels only exclude conversions where the event happened between the specified steps, not before or after the funnel.",
"category": "Query wrappers",
"feature": "insights",
"summary": "Run a funnel query",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 6d8cd661e61b..a9b6789e39a7 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -9626,7 +9626,7 @@
"system_prompt_hint": "Error issue filtering and aggregation (error-tracking category)"
},
"query-funnel": {
- "description": "Run a funnel query to analyze conversion rates through a sequence of steps. Funnel insights help understand user behavior as users navigate through a product. A funnel consists of a sequence of at least two events or actions, where some users progress to the next step while others drop off. Funnels use percentages as the primary aggregation type.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters and breakdowns.\n\nIMPORTANT: Funnels REQUIRE AT LEAST TWO series (events or actions).\n\nThe funnel insights have the following features:\n\n- Various visualization types (steps, time-to-convert, historical trends).\n- Filter data and apply exclusion steps (events only, not actions).\n- Break down data using a single property.\n- Specify conversion windows (default 14 days), step order (strict/ordered/unordered), and attribution settings.\n- Aggregate by users, sessions, or specific group types.\n- Track first-time conversions with special math aggregations.\n\nExamples of use cases include:\n\n- Conversion rates between steps.\n- Drop off steps (which step loses most users).\n- Steps with the highest friction and time to convert.\n- If product changes are improving their funnel over time.\n- Average/median/histogram of time to convert.\n- Conversion trends over time (using trends visualization type).\n- First-time user conversions (using first_time_for_user math).\n\nCRITICAL: Be minimalist. Only include filters, breakdowns, 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# Funnel guidelines\n\n## Exclusion steps\n\nUsers may want to use exclusion events to filter out conversions in which a particular event occurred between specific steps. These events should not be included in the main sequence. You should include start and end indexes (0-based) for each exclusion where the minimum `funnelFromStep` is 0 (first step) and the maximum `funnelToStep` is the number of steps minus one. Exclusion events cannot be actions, only events.\n\nIMPORTANT: Exclusion steps filter out conversions where the exclusion event occurred BETWEEN the specified steps. This does NOT exclude users who completed the event before the funnel started or after it ended.\n\nFor example, there is a sequence with three steps: sign up (step 0), finish onboarding (step 1), purchase (step 2). If the user wants to exclude all conversions in which users navigated away between sign up and finishing onboarding, the exclusion step will be `$pageleave` with `funnelFromStep: 0` and `funnelToStep: 1`.\n\n## Breakdown\n\nA breakdown is used to segment data by a single property value. They divide all defined funnel series into multiple subseries based on the values of the property. Include a breakdown **only when it is essential to directly answer the user's question**. You should not add a breakdown if the question can be addressed without additional segmentation.\n\nWhen using breakdowns, you should:\n\n- **Identify the property group** and name for a breakdown.\n- **Provide the property name** for a breakdown.\n- **Validate that the property value accurately reflects the intended criteria**.\n\nExamples of using a breakdown:\n\n- page views to sign up funnel by country: you need to find a property such as `$geoip_country_code` and set it as a breakdown.\n- conversion rate of users who have completed onboarding after signing up by an organization: you need to find a property such as `organization name` and set it as a breakdown.\n\n## Combining multiple events into a single step (`GroupNode`)\n\n**Use a `GroupNode`** when the user wants a single funnel step to match any of several events — e.g. \"Pageview OR Pageleave counts as one step\", or \"the user signed up via any of these channels\". Different filters per event are fine — put them on the inner nodes. Use separate steps instead when the user wants the events to occur in sequence. Only `OR` is supported.\n\nFunnel math (`first_time_for_user` etc.), `optionalInFunnel`, and step-wide property filters are not supported on a grouped step — filters must live on the inner nodes, and any math / optional handling must use a regular non-grouped step.\n\n**Where things live:**\n\n- On the group: only `name` (display label).\n- On each inner node: `event` (or action `id`), `properties`, `name` — all respected normally; per-node `properties` apply only to that node.\n\n### Example — funnel with a grouped step\n\nA 3-step funnel where the middle step matches either `$pageview` on Safari or `$pageleave` on Chrome:\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"sign up\" },\n {\n \"kind\": \"GroupNode\",\n \"operator\": \"OR\",\n \"name\": \"Pageview on Safari, Pageleave on Chrome\",\n \"nodes\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"name\": \"Pageview\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Safari\"] }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageleave\",\n \"name\": \"Pageleave\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Chrome\"] }]\n }\n ]\n },\n { \"kind\": \"EventsNode\", \"event\": \"purchase\" }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" }\n}\n```\n\n# Examples\n\n## Conversion from first event ingested to insight saved for organizations over 6 months\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"first team event ingested\" },\n { \"kind\": \"EventsNode\", \"event\": \"insight saved\" }\n ],\n \"dateRange\": { \"date_from\": \"-6m\" },\n \"interval\": \"month\",\n \"aggregation_group_type_index\": 0,\n \"funnelsFilter\": {\n \"funnelOrderType\": \"ordered\",\n \"funnelVizType\": \"trends\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Signup page CTA click rate within one hour, excluding page leaves, broken down by OS\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"click subscribe button\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-180d\" },\n \"interval\": \"week\",\n \"funnelsFilter\": {\n \"funnelWindowInterval\": 1,\n \"funnelWindowIntervalUnit\": \"hour\",\n \"funnelOrderType\": \"ordered\",\n \"exclusions\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageleave\", \"funnelFromStep\": 0, \"funnelToStep\": 1 }]\n },\n \"breakdownFilter\": { \"breakdown_type\": \"event\", \"breakdown\": \"$os\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Credit card purchase rate from viewing a product with strict ordering (no events in between)\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"view product\" },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"purchase\",\n \"properties\": [{ \"key\": \"paymentMethod\", \"type\": \"event\", \"value\": \"credit_card\", \"operator\": \"exact\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"funnelsFilter\": {\n \"funnelOrderType\": \"strict\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## View product to buy button to purchase, using actions and events\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"ActionsNode\", \"id\": 8882, \"name\": \"view product\" },\n { \"kind\": \"EventsNode\", \"event\": \"click buy button\" },\n {\n \"kind\": \"ActionsNode\",\n \"id\": 573,\n \"name\": \"purchase\",\n \"properties\": [\n { \"key\": \"shipping_method\", \"value\": \"express_delivery\", \"operator\": \"icontains\", \"type\": \"event\" }\n ]\n }\n ],\n \"funnelsFilter\": { \"funnelVizType\": \"steps\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- You MUST ALWAYS use AT LEAST TWO series (events or actions) in the funnel.\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- The default funnel step order is `ordered` (events in sequence but with other events allowed in between). Use `strict` when events should happen consecutively with no events in between. Use `unordered` when order doesn't matter.\n- Exclusion events in funnels only exclude conversions where the event happened between the specified steps, not before or after the funnel.",
+ "description": "Run a funnel query to analyze conversion rates through a sequence of steps. Funnel insights help understand user behavior as users navigate through a product. A funnel consists of a sequence of at least two events or actions, where some users progress to the next step while others drop off. Funnels use percentages as the primary aggregation type.\n\nUse 'read-data-schema' to discover available events, actions, and properties for filters and breakdowns.\n\nIMPORTANT: Funnels REQUIRE AT LEAST TWO series (events or actions).\n\nThe funnel insights have the following features:\n\n- Various visualization types (steps, time-to-convert, historical trends).\n- Filter data and apply exclusion steps (events only, not actions).\n- Break down data using a single property.\n- Specify conversion windows (default 14 days), step order (strict/ordered/unordered), and attribution settings.\n- Aggregate by users, sessions, or specific group types.\n- Track first-time conversions with special math aggregations.\n\nExamples of use cases include:\n\n- Conversion rates between steps.\n- Drop off steps (which step loses most users).\n- Steps with the highest friction and time to convert.\n- If product changes are improving their funnel over time.\n- Average/median/histogram of time to convert.\n- Conversion trends over time (using trends visualization type).\n- First-time user conversions (using first_time_for_user math).\n\nCRITICAL: Be minimalist. Only include filters, breakdowns, 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### Date boundaries\n\nA `date_to` with no time is an inclusive calendar day.\nGive a full timestamp instead to end the window at an exact instant.\nBoth forms below cover all of August and nothing in September.\n\n- `{ \"date_from\": \"2026-08-01\", \"date_to\": \"2026-08-31\" }`\n- `{ \"date_from\": \"2026-08-01T00:00:00Z\", \"date_to\": \"2026-09-01T00:00:00Z\" }`\n\n# Funnel guidelines\n\n## Exclusion steps\n\nUsers may want to use exclusion events to filter out conversions in which a particular event occurred between specific steps. These events should not be included in the main sequence. You should include start and end indexes (0-based) for each exclusion where the minimum `funnelFromStep` is 0 (first step) and the maximum `funnelToStep` is the number of steps minus one. Exclusion events cannot be actions, only events.\n\nIMPORTANT: Exclusion steps filter out conversions where the exclusion event occurred BETWEEN the specified steps. This does NOT exclude users who completed the event before the funnel started or after it ended.\n\nFor example, there is a sequence with three steps: sign up (step 0), finish onboarding (step 1), purchase (step 2). If the user wants to exclude all conversions in which users navigated away between sign up and finishing onboarding, the exclusion step will be `$pageleave` with `funnelFromStep: 0` and `funnelToStep: 1`.\n\n## Breakdown\n\nA breakdown is used to segment data by a single property value. They divide all defined funnel series into multiple subseries based on the values of the property. Include a breakdown **only when it is essential to directly answer the user's question**. You should not add a breakdown if the question can be addressed without additional segmentation.\n\nWhen using breakdowns, you should:\n\n- **Identify the property group** and name for a breakdown.\n- **Provide the property name** for a breakdown.\n- **Validate that the property value accurately reflects the intended criteria**.\n\nExamples of using a breakdown:\n\n- page views to sign up funnel by country: you need to find a property such as `$geoip_country_code` and set it as a breakdown.\n- conversion rate of users who have completed onboarding after signing up by an organization: you need to find a property such as `organization name` and set it as a breakdown.\n\n## Combining multiple events into a single step (`GroupNode`)\n\n**Use a `GroupNode`** when the user wants a single funnel step to match any of several events — e.g. \"Pageview OR Pageleave counts as one step\", or \"the user signed up via any of these channels\". Different filters per event are fine — put them on the inner nodes. Use separate steps instead when the user wants the events to occur in sequence. Only `OR` is supported.\n\nFunnel math (`first_time_for_user` etc.), `optionalInFunnel`, and step-wide property filters are not supported on a grouped step — filters must live on the inner nodes, and any math / optional handling must use a regular non-grouped step.\n\n**Where things live:**\n\n- On the group: only `name` (display label).\n- On each inner node: `event` (or action `id`), `properties`, `name` — all respected normally; per-node `properties` apply only to that node.\n\n### Example — funnel with a grouped step\n\nA 3-step funnel where the middle step matches either `$pageview` on Safari or `$pageleave` on Chrome:\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"sign up\" },\n {\n \"kind\": \"GroupNode\",\n \"operator\": \"OR\",\n \"name\": \"Pageview on Safari, Pageleave on Chrome\",\n \"nodes\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"name\": \"Pageview\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Safari\"] }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageleave\",\n \"name\": \"Pageleave\",\n \"properties\": [{ \"key\": \"$browser\", \"operator\": \"exact\", \"type\": \"event\", \"value\": [\"Chrome\"] }]\n }\n ]\n },\n { \"kind\": \"EventsNode\", \"event\": \"purchase\" }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" }\n}\n```\n\n# Examples\n\n## Conversion from first event ingested to insight saved for organizations over 6 months\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"first team event ingested\" },\n { \"kind\": \"EventsNode\", \"event\": \"insight saved\" }\n ],\n \"dateRange\": { \"date_from\": \"-6m\" },\n \"interval\": \"month\",\n \"aggregation_group_type_index\": 0,\n \"funnelsFilter\": {\n \"funnelOrderType\": \"ordered\",\n \"funnelVizType\": \"trends\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## Signup page CTA click rate within one hour, excluding page leaves, broken down by OS\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n {\n \"kind\": \"EventsNode\",\n \"event\": \"$pageview\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"click subscribe button\",\n \"properties\": [{ \"key\": \"$current_url\", \"type\": \"event\", \"value\": \"signup\", \"operator\": \"icontains\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-180d\" },\n \"interval\": \"week\",\n \"funnelsFilter\": {\n \"funnelWindowInterval\": 1,\n \"funnelWindowIntervalUnit\": \"hour\",\n \"funnelOrderType\": \"ordered\",\n \"exclusions\": [{ \"kind\": \"EventsNode\", \"event\": \"$pageleave\", \"funnelFromStep\": 0, \"funnelToStep\": 1 }]\n },\n \"breakdownFilter\": { \"breakdown_type\": \"event\", \"breakdown\": \"$os\" },\n \"filterTestAccounts\": true\n}\n```\n\n## Credit card purchase rate from viewing a product with strict ordering (no events in between)\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"EventsNode\", \"event\": \"view product\" },\n {\n \"kind\": \"EventsNode\",\n \"event\": \"purchase\",\n \"properties\": [{ \"key\": \"paymentMethod\", \"type\": \"event\", \"value\": \"credit_card\", \"operator\": \"exact\" }]\n }\n ],\n \"dateRange\": { \"date_from\": \"-30d\" },\n \"funnelsFilter\": {\n \"funnelOrderType\": \"strict\",\n \"funnelWindowInterval\": 14,\n \"funnelWindowIntervalUnit\": \"day\"\n },\n \"filterTestAccounts\": true\n}\n```\n\n## View product to buy button to purchase, using actions and events\n\n```json\n{\n \"kind\": \"FunnelsQuery\",\n \"series\": [\n { \"kind\": \"ActionsNode\", \"id\": 8882, \"name\": \"view product\" },\n { \"kind\": \"EventsNode\", \"event\": \"click buy button\" },\n {\n \"kind\": \"ActionsNode\",\n \"id\": 573,\n \"name\": \"purchase\",\n \"properties\": [\n { \"key\": \"shipping_method\", \"value\": \"express_delivery\", \"operator\": \"icontains\", \"type\": \"event\" }\n ]\n }\n ],\n \"funnelsFilter\": { \"funnelVizType\": \"steps\" },\n \"filterTestAccounts\": true\n}\n```\n\n# Reminders\n\n- You MUST ALWAYS use AT LEAST TWO series (events or actions) in the funnel.\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- The default funnel step order is `ordered` (events in sequence but with other events allowed in between). Use `strict` when events should happen consecutively with no events in between. Use `unordered` when order doesn't matter.\n- Exclusion events in funnels only exclude conversions where the event happened between the specified steps, not before or after the funnel.",
"category": "Query wrappers",
"feature": "insights",
"summary": "Run a funnel query",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 7384ae5180fa..fdade5e4d6e8 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -3687,7 +3687,7 @@ export namespace Schemas {
/** Start of the date range. Accepts ISO 8601 timestamps (e.g., 2024-01-15T00:00:00Z) or relative formats: -7d (7 days ago), -2w (2 weeks ago), -1m (1 month ago),
* -1h (1 hour ago), -1mStart (start of last month), -1yStart (start of last year). */
date_from?: string | null;
- /** End of the date range. Same format as date_from. Omit or null for "now". */
+ /** End of the date range. Same format as date_from. Omit or null for "now". A calendar day without a time (2024-01-15) is inclusive: it rounds to the last moment of that day in the project timezone, unless explicitDate is set. */
date_to?: string | null;
/** Restrict the query to events occurring on these ISO days of week (1=Monday to 7=Sunday), evaluated in the project timezone. Omit or empty for all days. Only applied by insight queries. */
daysOfWeek?: DaysOfWeekEnum[] | null;
diff --git a/services/mcp/src/tools/generated/ai_observability.ts b/services/mcp/src/tools/generated/ai_observability.ts
index cff7c3e93649..a2e7e66d8720 100644
--- a/services/mcp/src/tools/generated/ai_observability.ts
+++ b/services/mcp/src/tools/generated/ai_observability.ts
@@ -2379,7 +2379,13 @@ const llmaTraceReviewUpdate = (): ToolBase<
const AssistantDateRange = z.object({
date_from: z.string().describe('ISO8601 date string.'),
- date_to: z.string().nullable().describe('ISO8601 date string.').optional(),
+ date_to: z
+ .string()
+ .nullable()
+ .describe(
+ 'ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day.'
+ )
+ .optional(),
})
const AssistantDurationRange = z.object({
diff --git a/services/mcp/src/tools/generated/mcp_analytics.ts b/services/mcp/src/tools/generated/mcp_analytics.ts
index 2d91719ea900..0dc71fa0013e 100644
--- a/services/mcp/src/tools/generated/mcp_analytics.ts
+++ b/services/mcp/src/tools/generated/mcp_analytics.ts
@@ -192,7 +192,9 @@ const DateRange = z.object({
date_to: z
.string()
.nullable()
- .describe('End of the date range. Same format as date_from. Omit or null for "now".')
+ .describe(
+ 'End of the date range. Same format as date_from. Omit or null for "now". A calendar day without a time (2024-01-15) is inclusive: it rounds to the last moment of that day in the project timezone, unless explicitDate is set.'
+ )
.optional(),
daysOfWeek: z
.union([
diff --git a/services/mcp/src/tools/generated/query-wrappers.ts b/services/mcp/src/tools/generated/query-wrappers.ts
index 33c51279925f..a20575c23c42 100644
--- a/services/mcp/src/tools/generated/query-wrappers.ts
+++ b/services/mcp/src/tools/generated/query-wrappers.ts
@@ -66,7 +66,13 @@ const CompareFilter = z.object({
const AssistantDateRange = z.object({
date_from: z.string().describe('ISO8601 date string.'),
- date_to: z.string().nullable().describe('ISO8601 date string.').optional(),
+ date_to: z
+ .string()
+ .nullable()
+ .describe(
+ 'ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day.'
+ )
+ .optional(),
})
const AssistantDurationRange = z.object({
diff --git a/services/mcp/src/tools/generated/web_analytics.ts b/services/mcp/src/tools/generated/web_analytics.ts
index f66bca060f23..776fcdfb5e7f 100644
--- a/services/mcp/src/tools/generated/web_analytics.ts
+++ b/services/mcp/src/tools/generated/web_analytics.ts
@@ -497,7 +497,13 @@ const WebAnalyticsConversionGoal = z.union([ActionConversionGoal, CustomEventCon
const AssistantDateRange = z.object({
date_from: z.string().describe('ISO8601 date string.'),
- date_to: z.string().nullable().describe('ISO8601 date string.').optional(),
+ date_to: z
+ .string()
+ .nullable()
+ .describe(
+ 'ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day.'
+ )
+ .optional(),
})
const AssistantDurationRange = z.object({
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel-actors.json
index 2af9fa9ef778..50e11b5f32a5 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel-actors.json
@@ -115,7 +115,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel.json
index 4d8342f53e57..a4af89bcbe42 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-funnel.json
@@ -61,7 +61,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle-actors.json
index aeb3d1e6d366..e8187f485f1f 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle-actors.json
@@ -63,7 +63,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle.json
index c90f7c8592bf..80619367bdd1 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-lifecycle.json
@@ -31,7 +31,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-trace.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-trace.json
index dfe12dd91e99..c5f01783f774 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-trace.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-trace.json
@@ -18,7 +18,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-traces-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-traces-list.json
index bdb3a9751f47..061cf0f24046 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-traces-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-llm-traces-list.json
@@ -18,7 +18,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths-actors.json
index 682e7bcbfdc8..183138a14536 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths-actors.json
@@ -64,7 +64,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths.json
index a9cbf12886c2..365c3ebd40db 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-paths.json
@@ -31,7 +31,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention-actors.json
index 6f7888d5f5e1..60158a9c478c 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention-actors.json
@@ -65,7 +65,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention.json
index ed975fcaa492..3523aa6f183f 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-retention.json
@@ -31,7 +31,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness-actors.json
index b818d9e7a1a8..4219ec486bb6 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness-actors.json
@@ -78,7 +78,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness.json
index 8bb24b5c2dfd..4f4a4d79a386 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-stickiness.json
@@ -33,7 +33,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends-actors.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends-actors.json
index 8abcbb1adbc0..965f0b7d8663 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends-actors.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends-actors.json
@@ -180,7 +180,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends.json
index 0960fcebf84b..024556884d32 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-trends.json
@@ -125,7 +125,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-overview.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-overview.json
index 4d20a863bbed..44d92e98d776 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-overview.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-overview.json
@@ -803,7 +803,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-stats.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-stats.json
index 561ad1ff1834..5996c61e19ff 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-stats.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-stats.json
@@ -842,7 +842,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-vitals.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-vitals.json
index 9ef8d6474801..7f1cb91fd491 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-vitals.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-web-vitals.json
@@ -18,7 +18,7 @@
"type": "null"
}
],
- "description": "ISO8601 date string."
+ "description": "ISO8601 date string. A calendar day without a time (`2026-09-01`) is inclusive to the last moment of that day."
}
},
"required": ["date_from"],