Run analytics queries to answer data questions about users, events, funnels, and retention.
- Answer questions like:
- "How many active users did we have last week?"
- "Show me a funnel from sign up to purchase"
- "What is the retention rate for new users?"
- "How many users completed checkout yesterday?"
- Any question asking for metrics, counts, trends, funnels, or retention analysis
- Finding existing charts/dashboards → use 'search' instead
- To get the valid chart definition to pass -> use 'get_chart_definition_params' instead
- To validate the chart definition before passing it to query_dataset -> use 'verify_chart_definition' instead
- BOTH THESE TOOLS SHOULD BE USED AND ARE INEXPENSIVE TO USE BEFORE PASSING THE CHART DEFINITION TO query_dataset
- If you need more information about existing charts in the project as an example → use 'get_charts' instead
- Project settings (timezone, currency) → use 'get_project_context' instead
1. Use the 'search' tool to find if there are charts with properties that relate to the data you want to query. 2. If you are unsure about the properties or schema please don't modify existing properties and use the two tools below to get detailed information: 3. Use the 'get_chart_definition_params' tool to understand the valid chart definition to pass. 4. Use the 'verify_chart_definition' tool to validate the chart definition before passing it to query_dataset. 5. Use the 'get_charts' tool to find examples of existing charts in the project to understand the events, properties, and dataset schema generally. 6. Optionally use the 'search' tool again to find additional events, user properties, etc. needed for the query. 7. Optionally use the 'get_event_properties' tool to get properties on individual events. 8. Use this tool to query the ad hoc analysis.
- Don't assume or guess properties, events, or schema. Use the tools provided to you to understand the data before running a dataset query.
- When running into query failures, try searching for existing charts to understand the data taxonomy and dataset schema.
- When you receive a 400 error response the schema is likely incorrect or the events/properties do not exist.
- ALWAYS include a descriptive "name" field in the definition object. This name will be displayed as the chart title. Examples: "Active Users Last 7 Days", "Sign Up to Purchase Funnel", "New User Retention".
Special system events available for analysis. Events are passed in the "event_type" field:
- "_active": Any active event useful for tracking 'active users' like DAU, MAU(events not marked as inactive)
- "_all": Any event being tracked in Amplitude
- "_new": Events triggered by new users within the time interval. Useful for tracking 'new users'.
- "_any_revenue_event": Any revenue-generating event. Useful for tracking 'revenue'.
- "$popularEvents": Top events by volume (dynamically computed). Useful for more meta taxonomy analyses like 'what are the most common events'.
- Amplitude core properties are built-in and use standard names like "country", "platform", "device_id", "user_id"
- Custom properties are organization-defined and are typically prefixed with "gp:"
- Derived/formula properties (from TMS) must use prop_type and group_by.type of "derivedV2" in segments and group_by — not "user" or legacy "derived". Use get_properties with propertyType "derived" to list them.
- Hidden properties are intentionally excluded from get_properties; do not use them. Prefer derived replacements named in project context.
- If you are unsure which properties exist, use search/get_charts/get_properties/get_event_properties before querying, then verify_chart_definition before query_dataset
RESPONSE FORMAT: Returns {isCsvResponse: bool, csvResponse or jsonResponse, definition}. Only ONE response type present. Check the isCsvResponse flag to determine which response format to parse
CRITICAL — NON-ADDITIVE METRICS (uniques, pct_dau):
- These metrics cannot be summed across intervals. The chart UI plots per-interval values, not a running total.
- Additive metrics (totals, sums) CAN be summed across intervals.
How to read the JSON response, by metric type:
1. COUNT metrics ("uniques"):
- Use "overallSeries" — it is the TRUE deduped unique count across the full date range.
- Do NOT sum "timeSeries" values — that overstates the count due to user overlap across intervals.
2. RATIO metrics ("pct_dau" only):
- Use "timeSeriesAverage" (mean of per-interval values) — this matches what the chart UI displays.
For "current" reporting, also consider the most recent N intervals from "timeSeries".
- Do NOT use "overallSeries" for pct_dau over multi-interval ranges. For pct_dau, "overallSeries"
is a long-range aggregate (deduped numerator over the full range / deduped denominator over the full range). Over many intervals the denominator dedupes a much larger pool than the numerator, which compresses the ratio — typically reporting roughly half of the per-interval values the chart shows. This is mathematically valid as a long-range aggregate but is NOT what users see in the chart.
- Do NOT sum "timeSeries" values — ratios cannot be summed.
CSV Response Structure (when isCsvResponse is true):
- Header rows: The top rows contain metadata including chart name, description, events, formulas, and other chart configuration details
- Data header row: A single row containing column labels for the data points below (typically includes dates or time periods)
- Data rows: Each row contains:
- Label columns: First few columns contain row labels identifying the data series
- Value columns: Numerical data organized under the corresponding date/time columns from the data header row
- Parse by: Skip metadata rows, identify the data header row, then extract labels from first columns and values from remaining columns
- Cells in the CSV response are delimited by commas and may be prepended with a character
Example below measures uniques of custom event "Valuable Tweaking" over 3 days (2025-08-23, 2025-08-24, 2025-08-25) for all users. The data points are 614, 1769, and 4132 for the 3 days respectively. IMPORTANT: The overall unique users is 5642 (NOT 614+1769+4132=6515), because users overlap across days. data: " Example chart name" " Formula"," UNIQUES(A)" " A:"," [Custom] 'Valuable Tweaking'"
" Segment"," 2025-08-23"," 2025-08-24"," 2025-08-25" " All Non-Amplitude Users","614","1769","4132" definition: { "app": "APP_ID", "params": { "countGroup": "User", "end": 1756166399, "events": [ { "event_type": "ce:'Valuable Tweaking'", "filters": [], "group_by": [] } ], "groupBy": [], "interval": 1, "metric": "uniques", "segments": [], "start": 1755907200, }, "type": "eventsSegmentation", }
JSON Response Structure (when isCsvResponse is false):
- Parse using the following structure:
- timeSeries: Array of arrays, each containing data points for a given time period with a "value" property
- overallSeries: Array of arrays, each containing the overall data point across the entire range under the "value" property.
IMPORTANT — interpretation depends on the metric:
- For "uniques" (count): this is the TRUE deduped unique count over the full date range. Use this.
- For "pct_dau" (ratio): this is a long-range aggregate ratio (deduped numerator
over range / deduped denominator over range). It does NOT match the per-interval values the chart UI plots and is typically much smaller. Do NOT report it as the headline number — use "timeSeriesAverage" instead.
- timeSeriesAverage: Present only for "pct_dau". Array of arrays, one per series, each
containing a single {value} that is the mean of "timeSeries" values for that series. Use this as the headline ratio when the chart spans multiple intervals — it matches what users see in the chart UI.
- seriesMetadata: Array of objects containing metadata for each series
- xValuesForTimeSeries: Array of strings representing the x-axis values (dates) for the time series
- Use the dataset definition to be able to parse referenced events, properties, and segments.
Example below is a JSON response is for the same query as the CSV example above. { "timeSeries": [[{"value": 614}, {"value": 1769}, {"value": 4132}]], "overallSeries": [[{"value": 5642}]], "seriesMetadata": [{"segmentIndex": 0, "formulaIndex": 0, "formula": "UNIQUES(A)"}], "xValuesForTimeSeries": ["2025-08-23T00:00:00", "2025-08-24T00:00:00", "2025-08-25T00:00:00"] } Note: 614+1769+4132=6515, but overallSeries shows 5642. This is because unique users overlap across days. For "uniques", always use overallSeries for the total.
Example below is a "pct_dau" query over 3 weeks (a ratio metric): { "timeSeries": [[{"value": 0.1402}, {"value": 0.1421}, {"value": 0.1444}]], "overallSeries": [[{"value": 0.0712}]], "timeSeriesAverage": [[{"value": 0.1422}]], "seriesMetadata": [{"segmentIndex": 0, "formulaIndex": 0, "formula": "PCT_DAU(A)"}], "xValuesForTimeSeries": ["2026-04-06T00:00:00", "2026-04-13T00:00:00", "2026-04-20T00:00:00"] } Note: the chart UI shows ~14% per week. timeSeriesAverage (14.22%) matches that. overallSeries (7.12%) is the deduped 3-week aggregate ratio and would HALVE the reported value if used as the headline — never report it as "the number" for "pct_dau". Always use timeSeriesAverage for "pct_dau".