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(error-tracking): explain volumeResolution when MCP callers send a unit (#108033)

posthog[bot]bbfa4af0f8f4
diff --git a/products/error_tracking/backend/presentation/views/query_serializers.py b/products/error_tracking/backend/presentation/views/query_serializers.py
index 17729e9d6912..e4aa7c2a9f5f 100644
--- a/products/error_tracking/backend/presentation/views/query_serializers.py
+++ b/products/error_tracking/backend/presentation/views/query_serializers.py
@@ -79,6 +79,24 @@ def validate_filter_group(value: list[dict[str, object]]) -> list[dict[str, obje
return value
+VOLUME_RESOLUTION_MAX = 200
+VOLUME_RESOLUTION_HELP = (
+ f"Integer count of equal-width time buckets across dateRange, from 0 to {VOLUME_RESOLUTION_MAX}. "
+ "Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets."
+)
+
+
+class VolumeResolutionField(serializers.IntegerField):
+ default_error_messages = {
+ "invalid": f"Must be an integer bucket count from 0 to {VOLUME_RESOLUTION_MAX}, not a time unit such as 'day'. Example: 7 with a 7-day dateRange gives daily buckets.",
+ "min_value": f"Must be an integer bucket count from 0 to {VOLUME_RESOLUTION_MAX}.",
+ "max_value": f"Must be an integer bucket count from 0 to {VOLUME_RESOLUTION_MAX}.",
+ }
+
+ def __init__(self, *, help_text: str) -> None:
+ super().__init__(required=False, default=0, min_value=0, max_value=VOLUME_RESOLUTION_MAX, help_text=help_text)
+
+
class ErrorTrackingAssigneeSerializer(serializers.Serializer):
id = StringOrIntegerField(help_text="User ID or role UUID to filter by.")
type = serializers.ChoiceField(choices=["user", "role"], help_text="Assignee target type: user or role.")
@@ -141,12 +159,8 @@ class ErrorTrackingIssuesListQueryRequestSerializer(serializers.Serializer):
help_text="Page size. Defaults to 10. Use nextOffset to fetch more rows instead of a large page.",
)
offset = serializers.IntegerField(required=False, min_value=0, default=0, help_text="Pagination offset.")
- volumeResolution = serializers.IntegerField(
- required=False,
- min_value=0,
- max_value=200,
- default=0,
- help_text="Number of volume buckets. Defaults to 0, which returns only aggregate counts without volume buckets.",
+ volumeResolution = VolumeResolutionField(
+ help_text=f"{VOLUME_RESOLUTION_HELP} Defaults to 0, which returns only aggregate counts without volume buckets.",
)
library = StringOrStringListField(
required=False, help_text="Filter by SDK/library value from event $lib, for example posthog-js."
@@ -181,8 +195,8 @@ class ErrorTrackingIssueQueryRequestSerializer(serializers.Serializer):
default=True,
help_text="When true, exclude internal/test account data from results. Defaults to true.",
)
- volumeResolution = serializers.IntegerField(
- required=False, min_value=0, max_value=200, default=0, help_text="Volume buckets. Maximum 200."
+ volumeResolution = VolumeResolutionField(
+ help_text=f"{VOLUME_RESOLUTION_HELP} Defaults to 0, or to 12 when includeSparkline is true.",
)
includeSparkline = serializers.BooleanField(
required=False,
diff --git a/products/error_tracking/backend/tests/api/test_query_api.py b/products/error_tracking/backend/tests/api/test_query_api.py
index d70a1c83cf17..873acd82b177 100644
--- a/products/error_tracking/backend/tests/api/test_query_api.py
+++ b/products/error_tracking/backend/tests/api/test_query_api.py
@@ -362,20 +362,22 @@ class TestErrorTrackingQueryAPI(ClickhouseTestMixin, APIBaseTest):
assert response.status_code == 400
- def test_rejects_large_volume_resolution(self) -> None:
+ @parameterized.expand([("too_large", 201), ("time_unit", "day")])
+ def test_rejects_invalid_volume_resolution_with_accepted_values(self, _name: str, value: object) -> None:
list_response = self.client.post(
f"/api/environments/{self.team.id}/error_tracking/query/issues",
- data={"volumeResolution": 201},
+ data={"volumeResolution": value},
format="json",
)
detail_response = self.client.post(
f"/api/environments/{self.team.id}/error_tracking/query/issue",
- data={"issueId": self.issue_id, "volumeResolution": 201},
+ data={"issueId": self.issue_id, "volumeResolution": value},
format="json",
)
- assert list_response.status_code == 400
- assert detail_response.status_code == 400
+ for response in (list_response, detail_response):
+ assert response.status_code == 400
+ assert "integer bucket count from 0 to 200" in response.content.decode()
@time_machine.travel("2026-04-24T12:00:00Z", tick=False)
def test_issues_list_filters_by_assignee(self) -> None:
diff --git a/products/error_tracking/frontend/generated/api.schemas.ts b/products/error_tracking/frontend/generated/api.schemas.ts
index 0a92bc93b3f8..4ac6360af895 100644
--- a/products/error_tracking/frontend/generated/api.schemas.ts
+++ b/products/error_tracking/frontend/generated/api.schemas.ts
@@ -1129,7 +1129,7 @@ export interface ErrorTrackingIssueQueryRequestApi {
/** When true, exclude internal/test account data from results. Defaults to true. */
filterTestAccounts?: boolean
/**
- * Volume buckets. Maximum 200.
+ * Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, or to 12 when includeSparkline is true.
* @minimum 0
* @maximum 200
*/
@@ -1636,7 +1636,7 @@ export interface ErrorTrackingIssuesListQueryRequestApi {
*/
offset?: number
/**
- * Number of volume buckets. Defaults to 0, which returns only aggregate counts without volume buckets.
+ * Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, which returns only aggregate counts without volume buckets.
* @minimum 0
* @maximum 200
*/
diff --git a/products/error_tracking/frontend/generated/api.zod.ts b/products/error_tracking/frontend/generated/api.zod.ts
index 2b2b3de5d6b3..d8f3e6c52482 100644
--- a/products/error_tracking/frontend/generated/api.zod.ts
+++ b/products/error_tracking/frontend/generated/api.zod.ts
@@ -603,7 +603,9 @@ export const ErrorTrackingQueryIssueCreateBody = /* @__PURE__ */ zod.object({
.min(errorTrackingQueryIssueCreateBodyVolumeResolutionMin)
.max(errorTrackingQueryIssueCreateBodyVolumeResolutionMax)
.default(errorTrackingQueryIssueCreateBodyVolumeResolutionDefault)
- .describe('Volume buckets. Maximum 200.'),
+ .describe(
+ "Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, or to 12 when includeSparkline is true."
+ ),
includeSparkline: zod
.boolean()
.default(errorTrackingQueryIssueCreateBodyIncludeSparklineDefault)
@@ -997,7 +999,7 @@ export const ErrorTrackingQueryIssuesListCreateBody = /* @__PURE__ */ zod.object
.max(errorTrackingQueryIssuesListCreateBodyVolumeResolutionMax)
.default(errorTrackingQueryIssuesListCreateBodyVolumeResolutionDefault)
.describe(
- 'Number of volume buckets. Defaults to 0, which returns only aggregate counts without volume buckets.'
+ "Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, which returns only aggregate counts without volume buckets."
),
library: zod
.union([zod.string(), zod.array(zod.string()).min(1)])
diff --git a/products/error_tracking/mcp/prompts/query-error-tracking-issue.md b/products/error_tracking/mcp/prompts/query-error-tracking-issue.md
index 17643c6327a9..45459cd0fbb2 100644
--- a/products/error_tracking/mcp/prompts/query-error-tracking-issue.md
+++ b/products/error_tracking/mcp/prompts/query-error-tracking-issue.md
@@ -9,7 +9,7 @@ Defaults are intentionally useful: last 7 days, test accounts filtered out, aggr
- `issueId`: required Error tracking issue UUID.
- `dateRange`: time range for impact counts and latest-event metadata. Defaults to last 7 days.
- `includeSparkline`: set true only if a trend/sparkline helps answer the user. When true, `volumeResolution` defaults to 12 if not provided.
-- `volumeResolution`: number of volume buckets when sparkline data is needed.
+- `volumeResolution`: integer count of equal-width buckets across `dateRange`, from 0 to 200, when sparkline data is needed. It is not a unit such as `hour` or `day`. For daily buckets over the default 7-day range, send `7`.
- `includeBreakdown`: set true when the user asks where, for whom, or on which platforms the issue happens. It returns the same breakdowns as the issue page, over all matching events: the most common paths (or URLs, when events have no path, as with backend SDKs), screens, browsers, OS, libraries, library versions, and app versions, each with a count, and up to 5 `$session_id` values with the most events. It covers at most the last 30 days of `dateRange`; `range_limited` is true when it covers less than you asked for. Empty dimensions are left out.
# Next steps
diff --git a/products/error_tracking/mcp/prompts/query-error-tracking-issues-list.md b/products/error_tracking/mcp/prompts/query-error-tracking-issues-list.md
index 6870f7a16e53..221f19c16a77 100644
--- a/products/error_tracking/mcp/prompts/query-error-tracking-issues-list.md
+++ b/products/error_tracking/mcp/prompts/query-error-tracking-issues-list.md
@@ -4,7 +4,7 @@ Use this first when the user asks which errors are happening, which errors are m
Defaults are intentionally useful: active issues, last 7 days, sorted by occurrences, test accounts filtered out, 10 rows per page, and compact aggregate counts. Each row carries a short `description` preview. Use `query-error-tracking-issue` for the full description.
-Keep `limit` small. When `hasMore` is true and you need more rows, fetch the next page with `offset` set to `nextOffset`. Set `volumeResolution` only when the user asks for volume over time.
+Keep `limit` small. When `hasMore` is true and you need more rows, fetch the next page with `offset` set to `nextOffset`. Set `volumeResolution` only when the user asks for volume over time. It is an integer count of equal-width buckets across `dateRange`, from 0 to 200, not a unit such as `hour` or `day`. For daily volume over the default 7-day range, send `7`. For hourly volume over the last 24 hours, send `24` with `dateRange.date_from` set to `-24h`.
For all-time issue counts by status or severity, query `system.error_tracking_issues` with `posthog:execute-sql`. The table follows the connected user's Error tracking access and only returns issues from the current project. This list tool only includes issues observed during `dateRange`.
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 3bb97d41abd1..cf37d5d10c0c 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -9864,7 +9864,7 @@
"feature_flag": "tracing"
},
"query-error-tracking-issue": {
- "description": "Get compact details for one Error tracking issue.\n\nUse this after `query-error-tracking-issues-list` when you have an `issueId` and need issue status, severity, name/description, first/last seen timestamps, assignee, compact impact counts, top in-app frame, and latest release metadata.\n\nDefaults are intentionally useful: last 7 days, test accounts filtered out, aggregate impact included, and no sparkline unless requested.\n\n# Parameters\n\n- `issueId`: required Error tracking issue UUID.\n- `dateRange`: time range for impact counts and latest-event metadata. Defaults to last 7 days.\n- `includeSparkline`: set true only if a trend/sparkline helps answer the user. When true, `volumeResolution` defaults to 12 if not provided.\n- `volumeResolution`: number of volume buckets when sparkline data is needed.\n- `includeBreakdown`: set true when the user asks where, for whom, or on which platforms the issue happens. It returns the same breakdowns as the issue page, over all matching events: the most common paths (or URLs, when events have no path, as with backend SDKs), screens, browsers, OS, libraries, library versions, and app versions, each with a count, and up to 5 `$session_id` values with the most events. It covers at most the last 30 days of `dateRange`; `range_limited` is true when it covers less than you asked for. Empty dimensions are left out.\n\n# Next steps\n\nUse `query-error-tracking-issue-events` with the same `issueId` only when the user needs a concrete event, a stack trace, code variables, OpenTelemetry trace IDs, or the handled flag. Do not fetch many events to count browsers, URLs, or versions; use `includeBreakdown` instead.\n\nWhen `sample_session_ids` is not empty and the user asks what happened before the error, call `query-session-recordings-list` with `session_ids`.",
+ "description": "Get compact details for one Error tracking issue.\n\nUse this after `query-error-tracking-issues-list` when you have an `issueId` and need issue status, severity, name/description, first/last seen timestamps, assignee, compact impact counts, top in-app frame, and latest release metadata.\n\nDefaults are intentionally useful: last 7 days, test accounts filtered out, aggregate impact included, and no sparkline unless requested.\n\n# Parameters\n\n- `issueId`: required Error tracking issue UUID.\n- `dateRange`: time range for impact counts and latest-event metadata. Defaults to last 7 days.\n- `includeSparkline`: set true only if a trend/sparkline helps answer the user. When true, `volumeResolution` defaults to 12 if not provided.\n- `volumeResolution`: integer count of equal-width buckets across `dateRange`, from 0 to 200, when sparkline data is needed. It is not a unit such as `hour` or `day`. For daily buckets over the default 7-day range, send `7`.\n- `includeBreakdown`: set true when the user asks where, for whom, or on which platforms the issue happens. It returns the same breakdowns as the issue page, over all matching events: the most common paths (or URLs, when events have no path, as with backend SDKs), screens, browsers, OS, libraries, library versions, and app versions, each with a count, and up to 5 `$session_id` values with the most events. It covers at most the last 30 days of `dateRange`; `range_limited` is true when it covers less than you asked for. Empty dimensions are left out.\n\n# Next steps\n\nUse `query-error-tracking-issue-events` with the same `issueId` only when the user needs a concrete event, a stack trace, code variables, OpenTelemetry trace IDs, or the handled flag. Do not fetch many events to count browsers, URLs, or versions; use `includeBreakdown` instead.\n\nWhen `sample_session_ids` is not empty and the user asks what happened before the error, call `query-session-recordings-list` with `session_ids`.",
"category": "Error tracking",
"feature": "error_tracking",
"summary": "Query error tracking issue",
@@ -9894,7 +9894,7 @@
"system_prompt_hint": "Error event samples, stack traces, code variables, and session IDs (error-tracking category)"
},
"query-error-tracking-issues-list": {
- "description": "List and filter Error tracking issues. Returns compact issue rows with aggregate impact counts (`occurrences`, `users`, `sessions`) and optional volume buckets.\n\nUse this first when the user asks which errors are happening, which errors are most common, or wants to narrow issues by status, severity, release, library, fingerprint, URL, user, person, or properties.\n\nDefaults are intentionally useful: active issues, last 7 days, sorted by occurrences, test accounts filtered out, 10 rows per page, and compact aggregate counts. Each row carries a short `description` preview. Use `query-error-tracking-issue` for the full description.\n\nKeep `limit` small. When `hasMore` is true and you need more rows, fetch the next page with `offset` set to `nextOffset`. Set `volumeResolution` only when the user asks for volume over time.\n\nFor all-time issue counts by status or severity, query `system.error_tracking_issues` with `posthog:execute-sql`. The table follows the connected user's Error tracking access and only returns issues from the current project. This list tool only includes issues observed during `dateRange`.\n\nBe minimalist. Only add filters needed to answer the user’s question. Do not add \"is set\" filters unless the user explicitly asks for them.\n\n# Common filters\n\n- `status`: `active`, `resolved`, `suppressed`, `pending_release`, `archived`, or `all`. Defaults to `active`.\n- `searchQuery`: free-text search for exception names, values, stack frames, and email text.\n- `library`: exact `$lib` match, for example `posthog-js`.\n- `release`: exact release ID, release version, or git commit ID captured in `$exception_releases`. This intentionally does not match project name, branch, or timestamp fragments.\n- `fingerprint`: exact `$exception_fingerprint` match.\n- `url`: substring match on `$current_url`.\n- `personId`: exact PostHog person UUID.\n- `user`: user/email text search.\n- `filePath`: stack-frame file/source text search.\n- `filterGroup`: advanced flat AND property filters. Prefer typed fields above when they fit. For severity, use type `error_tracking_issue`, key `severity`, and `exact`, `is_set`, or `is_not_set`.\n\nUse `dateRange` for time, not property filters. Omit `date_to` for now.\n\n# Next steps\n\n- Use `query-error-tracking-issue` with `issueId` to inspect one issue.\n- Use `query-error-tracking-issue-events` with `issueId` to fetch sampled exception events, stack traces, URLs, and `$session_id` values.\n- If the user asks what people were doing before the error, use `$session_id` values from issue events with `query-session-recordings-list` and its `session_ids` parameter.",
+ "description": "List and filter Error tracking issues. Returns compact issue rows with aggregate impact counts (`occurrences`, `users`, `sessions`) and optional volume buckets.\n\nUse this first when the user asks which errors are happening, which errors are most common, or wants to narrow issues by status, severity, release, library, fingerprint, URL, user, person, or properties.\n\nDefaults are intentionally useful: active issues, last 7 days, sorted by occurrences, test accounts filtered out, 10 rows per page, and compact aggregate counts. Each row carries a short `description` preview. Use `query-error-tracking-issue` for the full description.\n\nKeep `limit` small. When `hasMore` is true and you need more rows, fetch the next page with `offset` set to `nextOffset`. Set `volumeResolution` only when the user asks for volume over time. It is an integer count of equal-width buckets across `dateRange`, from 0 to 200, not a unit such as `hour` or `day`. For daily volume over the default 7-day range, send `7`. For hourly volume over the last 24 hours, send `24` with `dateRange.date_from` set to `-24h`.\n\nFor all-time issue counts by status or severity, query `system.error_tracking_issues` with `posthog:execute-sql`. The table follows the connected user's Error tracking access and only returns issues from the current project. This list tool only includes issues observed during `dateRange`.\n\nBe minimalist. Only add filters needed to answer the user’s question. Do not add \"is set\" filters unless the user explicitly asks for them.\n\n# Common filters\n\n- `status`: `active`, `resolved`, `suppressed`, `pending_release`, `archived`, or `all`. Defaults to `active`.\n- `searchQuery`: free-text search for exception names, values, stack frames, and email text.\n- `library`: exact `$lib` match, for example `posthog-js`.\n- `release`: exact release ID, release version, or git commit ID captured in `$exception_releases`. This intentionally does not match project name, branch, or timestamp fragments.\n- `fingerprint`: exact `$exception_fingerprint` match.\n- `url`: substring match on `$current_url`.\n- `personId`: exact PostHog person UUID.\n- `user`: user/email text search.\n- `filePath`: stack-frame file/source text search.\n- `filterGroup`: advanced flat AND property filters. Prefer typed fields above when they fit. For severity, use type `error_tracking_issue`, key `severity`, and `exact`, `is_set`, or `is_not_set`.\n\nUse `dateRange` for time, not property filters. Omit `date_to` for now.\n\n# Next steps\n\n- Use `query-error-tracking-issue` with `issueId` to inspect one issue.\n- Use `query-error-tracking-issue-events` with `issueId` to fetch sampled exception events, stack traces, URLs, and `$session_id` values.\n- If the user asks what people were doing before the error, use `$session_id` values from issue events with `query-session-recordings-list` and its `session_ids` parameter.",
"category": "Error tracking",
"feature": "error_tracking",
"summary": "Query error tracking issues list",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 48240255d957..b491aa5677f7 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -10455,7 +10455,7 @@
"feature_flag": "tracing"
},
"query-error-tracking-issue": {
- "description": "Get compact details for one Error tracking issue.\n\nUse this after `query-error-tracking-issues-list` when you have an `issueId` and need issue status, severity, name/description, first/last seen timestamps, assignee, compact impact counts, top in-app frame, and latest release metadata.\n\nDefaults are intentionally useful: last 7 days, test accounts filtered out, aggregate impact included, and no sparkline unless requested.\n\n# Parameters\n\n- `issueId`: required Error tracking issue UUID.\n- `dateRange`: time range for impact counts and latest-event metadata. Defaults to last 7 days.\n- `includeSparkline`: set true only if a trend/sparkline helps answer the user. When true, `volumeResolution` defaults to 12 if not provided.\n- `volumeResolution`: number of volume buckets when sparkline data is needed.\n- `includeBreakdown`: set true when the user asks where, for whom, or on which platforms the issue happens. It returns the same breakdowns as the issue page, over all matching events: the most common paths (or URLs, when events have no path, as with backend SDKs), screens, browsers, OS, libraries, library versions, and app versions, each with a count, and up to 5 `$session_id` values with the most events. It covers at most the last 30 days of `dateRange`; `range_limited` is true when it covers less than you asked for. Empty dimensions are left out.\n\n# Next steps\n\nUse `query-error-tracking-issue-events` with the same `issueId` only when the user needs a concrete event, a stack trace, code variables, OpenTelemetry trace IDs, or the handled flag. Do not fetch many events to count browsers, URLs, or versions; use `includeBreakdown` instead.\n\nWhen `sample_session_ids` is not empty and the user asks what happened before the error, call `query-session-recordings-list` with `session_ids`.",
+ "description": "Get compact details for one Error tracking issue.\n\nUse this after `query-error-tracking-issues-list` when you have an `issueId` and need issue status, severity, name/description, first/last seen timestamps, assignee, compact impact counts, top in-app frame, and latest release metadata.\n\nDefaults are intentionally useful: last 7 days, test accounts filtered out, aggregate impact included, and no sparkline unless requested.\n\n# Parameters\n\n- `issueId`: required Error tracking issue UUID.\n- `dateRange`: time range for impact counts and latest-event metadata. Defaults to last 7 days.\n- `includeSparkline`: set true only if a trend/sparkline helps answer the user. When true, `volumeResolution` defaults to 12 if not provided.\n- `volumeResolution`: integer count of equal-width buckets across `dateRange`, from 0 to 200, when sparkline data is needed. It is not a unit such as `hour` or `day`. For daily buckets over the default 7-day range, send `7`.\n- `includeBreakdown`: set true when the user asks where, for whom, or on which platforms the issue happens. It returns the same breakdowns as the issue page, over all matching events: the most common paths (or URLs, when events have no path, as with backend SDKs), screens, browsers, OS, libraries, library versions, and app versions, each with a count, and up to 5 `$session_id` values with the most events. It covers at most the last 30 days of `dateRange`; `range_limited` is true when it covers less than you asked for. Empty dimensions are left out.\n\n# Next steps\n\nUse `query-error-tracking-issue-events` with the same `issueId` only when the user needs a concrete event, a stack trace, code variables, OpenTelemetry trace IDs, or the handled flag. Do not fetch many events to count browsers, URLs, or versions; use `includeBreakdown` instead.\n\nWhen `sample_session_ids` is not empty and the user asks what happened before the error, call `query-session-recordings-list` with `session_ids`.",
"category": "Error tracking",
"feature": "error_tracking",
"summary": "Query error tracking issue",
@@ -10485,7 +10485,7 @@
"system_prompt_hint": "Error event samples, stack traces, code variables, and session IDs (error-tracking category)"
},
"query-error-tracking-issues-list": {
- "description": "List and filter Error tracking issues. Returns compact issue rows with aggregate impact counts (`occurrences`, `users`, `sessions`) and optional volume buckets.\n\nUse this first when the user asks which errors are happening, which errors are most common, or wants to narrow issues by status, severity, release, library, fingerprint, URL, user, person, or properties.\n\nDefaults are intentionally useful: active issues, last 7 days, sorted by occurrences, test accounts filtered out, 10 rows per page, and compact aggregate counts. Each row carries a short `description` preview. Use `query-error-tracking-issue` for the full description.\n\nKeep `limit` small. When `hasMore` is true and you need more rows, fetch the next page with `offset` set to `nextOffset`. Set `volumeResolution` only when the user asks for volume over time.\n\nFor all-time issue counts by status or severity, query `system.error_tracking_issues` with `posthog:execute-sql`. The table follows the connected user's Error tracking access and only returns issues from the current project. This list tool only includes issues observed during `dateRange`.\n\nBe minimalist. Only add filters needed to answer the user’s question. Do not add \"is set\" filters unless the user explicitly asks for them.\n\n# Common filters\n\n- `status`: `active`, `resolved`, `suppressed`, `pending_release`, `archived`, or `all`. Defaults to `active`.\n- `searchQuery`: free-text search for exception names, values, stack frames, and email text.\n- `library`: exact `$lib` match, for example `posthog-js`.\n- `release`: exact release ID, release version, or git commit ID captured in `$exception_releases`. This intentionally does not match project name, branch, or timestamp fragments.\n- `fingerprint`: exact `$exception_fingerprint` match.\n- `url`: substring match on `$current_url`.\n- `personId`: exact PostHog person UUID.\n- `user`: user/email text search.\n- `filePath`: stack-frame file/source text search.\n- `filterGroup`: advanced flat AND property filters. Prefer typed fields above when they fit. For severity, use type `error_tracking_issue`, key `severity`, and `exact`, `is_set`, or `is_not_set`.\n\nUse `dateRange` for time, not property filters. Omit `date_to` for now.\n\n# Next steps\n\n- Use `query-error-tracking-issue` with `issueId` to inspect one issue.\n- Use `query-error-tracking-issue-events` with `issueId` to fetch sampled exception events, stack traces, URLs, and `$session_id` values.\n- If the user asks what people were doing before the error, use `$session_id` values from issue events with `query-session-recordings-list` and its `session_ids` parameter.",
+ "description": "List and filter Error tracking issues. Returns compact issue rows with aggregate impact counts (`occurrences`, `users`, `sessions`) and optional volume buckets.\n\nUse this first when the user asks which errors are happening, which errors are most common, or wants to narrow issues by status, severity, release, library, fingerprint, URL, user, person, or properties.\n\nDefaults are intentionally useful: active issues, last 7 days, sorted by occurrences, test accounts filtered out, 10 rows per page, and compact aggregate counts. Each row carries a short `description` preview. Use `query-error-tracking-issue` for the full description.\n\nKeep `limit` small. When `hasMore` is true and you need more rows, fetch the next page with `offset` set to `nextOffset`. Set `volumeResolution` only when the user asks for volume over time. It is an integer count of equal-width buckets across `dateRange`, from 0 to 200, not a unit such as `hour` or `day`. For daily volume over the default 7-day range, send `7`. For hourly volume over the last 24 hours, send `24` with `dateRange.date_from` set to `-24h`.\n\nFor all-time issue counts by status or severity, query `system.error_tracking_issues` with `posthog:execute-sql`. The table follows the connected user's Error tracking access and only returns issues from the current project. This list tool only includes issues observed during `dateRange`.\n\nBe minimalist. Only add filters needed to answer the user’s question. Do not add \"is set\" filters unless the user explicitly asks for them.\n\n# Common filters\n\n- `status`: `active`, `resolved`, `suppressed`, `pending_release`, `archived`, or `all`. Defaults to `active`.\n- `searchQuery`: free-text search for exception names, values, stack frames, and email text.\n- `library`: exact `$lib` match, for example `posthog-js`.\n- `release`: exact release ID, release version, or git commit ID captured in `$exception_releases`. This intentionally does not match project name, branch, or timestamp fragments.\n- `fingerprint`: exact `$exception_fingerprint` match.\n- `url`: substring match on `$current_url`.\n- `personId`: exact PostHog person UUID.\n- `user`: user/email text search.\n- `filePath`: stack-frame file/source text search.\n- `filterGroup`: advanced flat AND property filters. Prefer typed fields above when they fit. For severity, use type `error_tracking_issue`, key `severity`, and `exact`, `is_set`, or `is_not_set`.\n\nUse `dateRange` for time, not property filters. Omit `date_to` for now.\n\n# Next steps\n\n- Use `query-error-tracking-issue` with `issueId` to inspect one issue.\n- Use `query-error-tracking-issue-events` with `issueId` to fetch sampled exception events, stack traces, URLs, and `$session_id` values.\n- If the user asks what people were doing before the error, use `$session_id` values from issue events with `query-session-recordings-list` and its `session_ids` parameter.",
"category": "Error tracking",
"feature": "error_tracking",
"summary": "Query error tracking issues list",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index ca395078bf9c..37bfd8917a38 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -39121,7 +39121,7 @@ export namespace Schemas {
/** When true, exclude internal/test account data from results. Defaults to true. */
filterTestAccounts?: boolean;
/**
- * Volume buckets. Maximum 200.
+ * Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, or to 12 when includeSparkline is true.
* @minimum 0
* @maximum 200
*/
@@ -39310,7 +39310,7 @@ export namespace Schemas {
*/
offset?: number;
/**
- * Number of volume buckets. Defaults to 0, which returns only aggregate counts without volume buckets.
+ * Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, which returns only aggregate counts without volume buckets.
* @minimum 0
* @maximum 200
*/
diff --git a/services/mcp/src/generated/error_tracking/api.ts b/services/mcp/src/generated/error_tracking/api.ts
index ebd483a705ed..469fbe249d4d 100644
--- a/services/mcp/src/generated/error_tracking/api.ts
+++ b/services/mcp/src/generated/error_tracking/api.ts
@@ -8134,7 +8134,9 @@ export const ErrorTrackingQueryIssueCreateBody = () => zod.object({
.min(errorTrackingQueryIssueCreateBodyVolumeResolutionMin)
.max(errorTrackingQueryIssueCreateBodyVolumeResolutionMax)
.default(errorTrackingQueryIssueCreateBodyVolumeResolutionDefault)
- .describe('Volume buckets. Maximum 200.'),
+ .describe(
+ "Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, or to 12 when includeSparkline is true."
+ ),
includeSparkline: zod
.boolean()
.default(errorTrackingQueryIssueCreateBodyIncludeSparklineDefault)
@@ -8544,7 +8546,7 @@ export const ErrorTrackingQueryIssuesListCreateBody = () => zod.object({
.max(errorTrackingQueryIssuesListCreateBodyVolumeResolutionMax)
.default(errorTrackingQueryIssuesListCreateBodyVolumeResolutionDefault)
.describe(
- 'Number of volume buckets. Defaults to 0, which returns only aggregate counts without volume buckets.'
+ "Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, which returns only aggregate counts without volume buckets."
),
library: zod
.union([zod.string(), zod.array(zod.string()).min(1)])
diff --git a/services/mcp/src/tools/exec.ts b/services/mcp/src/tools/exec.ts
index bd951e3d532c..6996c5324376 100644
--- a/services/mcp/src/tools/exec.ts
+++ b/services/mcp/src/tools/exec.ts
@@ -1032,13 +1032,13 @@ function namedKeys(keys: readonly string[]): string {
.join(', ')
}
-/** Bound on the parameter description echoed back with a missing-parameter
- * rejection, so a tool with a long field description cannot inflate the
- * analytics error message. */
-const MAX_MISSING_PARAM_HINT = 200
+/** Bound on the parameter description echoed back with a missing or wrong-type
+ * parameter rejection, so a tool with a long field description cannot inflate
+ * the analytics error message. */
+const MAX_PARAM_HINT = 200
/**
- * The missing parameter's own description, appended to the rejection.
+ * The parameter's own description, appended to a missing or wrong-type rejection.
*
* A bare `missing required parameter: short_id` names the field to fill but not
* what to fill it with, so a caller that never held the identifier retries the
@@ -1051,7 +1051,7 @@ const MAX_MISSING_PARAM_HINT = 200
* input, so it is safe in the message returned to the caller and recorded as the
* analytics error message.
*/
-function missingParameterHint(path: ReadonlyArray<PropertyKey>, schema: ZodObjectAny | undefined): string {
+function parameterHint(path: ReadonlyArray<PropertyKey>, schema: ZodObjectAny | undefined): string {
if (!schema || path.length !== 1) {
return ''
}
@@ -1063,9 +1063,7 @@ function missingParameterHint(path: ReadonlyArray<PropertyKey>, schema: ZodObjec
return ''
}
const capped =
- description.length > MAX_MISSING_PARAM_HINT
- ? `${description.slice(0, MAX_MISSING_PARAM_HINT).trimEnd()}...`
- : description
+ description.length > MAX_PARAM_HINT ? `${description.slice(0, MAX_PARAM_HINT).trimEnd()}...` : description
return ` (${capped})`
}
@@ -1285,7 +1283,7 @@ export function formatInputValidationError(
const path = issue.path.map(String).join('.')
if (issue.code === 'invalid_type') {
if ('input' in issue && issue.input === undefined) {
- const hint = missingParameterHint(issue.path, schema)
+ const hint = parameterHint(issue.path, schema)
if (looksLikeUnwrappedPayload(issue.path, input, schema)) {
const { shape, unplaced } = acceptedWrapperShape(path, input, schema)
const rejected = unplaced.length
@@ -1304,7 +1302,9 @@ export function formatInputValidationError(
}
return `missing required parameter: ${path}${hint}`
}
- return `parameter "${path}" must be of type ${issue.expected}`
+ // The type alone does not say which values the field accepts, for
+ // example a bucket count where the caller sent a unit such as "day".
+ return `parameter "${path}" must be of type ${issue.expected}${parameterHint(issue.path, schema)}`
}
if (issue.code === 'invalid_union') {
const expanded = describeUnionIssue(issue.errors, issue.path)
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issue.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issue.json
index 62fc67dd92e5..af56cfb063b4 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issue.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issue.json
@@ -43,7 +43,7 @@
},
"volumeResolution": {
"default": 0,
- "description": "Volume buckets. Maximum 200.",
+ "description": "Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, or to 12 when includeSparkline is true.",
"maximum": 200,
"minimum": 0,
"type": "number"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issues-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issues-list.json
index 3a9227a17e77..41e58c6d1552 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issues-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/query-error-tracking-issues-list.json
@@ -274,7 +274,7 @@
},
"volumeResolution": {
"default": 0,
- "description": "Number of volume buckets. Defaults to 0, which returns only aggregate counts without volume buckets.",
+ "description": "Integer count of equal-width time buckets across dateRange, from 0 to 200. Not a time unit: 'hour', 'day', and 'week' are invalid. Example: 7 with a 7-day dateRange gives daily buckets. Defaults to 0, which returns only aggregate counts without volume buckets.",
"maximum": 200,
"minimum": 0,
"type": "number"
diff --git a/services/mcp/tests/unit/exec.test.ts b/services/mcp/tests/unit/exec.test.ts
index 01af4e3bbb7d..ac67577931a6 100644
--- a/services/mcp/tests/unit/exec.test.ts
+++ b/services/mcp/tests/unit/exec.test.ts
@@ -711,6 +711,11 @@ describe('exec tool', () => {
input: '{"id":"not-a-number"}',
expected: /parameter "id" must be of type number/,
},
+ {
+ case: 'a parameter of the wrong type, echoing the field description',
+ input: '{"id":1,"buckets":"day"}',
+ expected: /parameter "buckets" must be of type number \(Bucket count, not a time unit\.\)/,
+ },
{
// Plain z.object strips unknown keys at parse time (Zod v4), so the
// actionable signal is the absent required `id`, not the stray key.
@@ -728,7 +733,11 @@ describe('exec tool', () => {
])('rejects a call with $case', async ({ input, expected }) => {
const tool = makeMockTool({
name: 'action-get',
- schema: z.object({ id: z.number(), description: z.string().max(400).optional() }),
+ schema: z.object({
+ id: z.number(),
+ description: z.string().max(400).optional(),
+ buckets: z.number().optional().describe('Bucket count, not a time unit.'),
+ }),
handler: async (_ctx, params) => params,
})
const exec = createExec([tool])