Skip to content

analytics_query_run

Answer a natural-language analytics question for the current product.

Tool

analytics_query_run

Answer a natural-language analytics question for the current product.

Answer a natural-language analytics question for the current product. Fallback surface: it routes the question to analytics_metric_query or analytics_funnel_run when it fits one of them and returns that tool's exact request and response in `structured`; it generates SQL only when neither fits. Call analytics_metric_query, analytics_funnel_run or analytics_person_timeline directly when you already know the shape of the question — those are deterministic and cheaper.

Behavior

HTTP
POST /analytics/query

Arguments

Name
Type
Required
Description
q
string
•
Natural-language analytics question

Response

Field
Type
Always
Description
sql
string
•
rows
array
•
answer
string
•
truncated
boolean
•
structured
object
—
explanation
string
•

Try it

Answer a natural-language analytics question for the current product.

When to use

Answer a natural-language analytics question for the current product. Fallback surface: it routes the question to analytics_metric_query or analytics_funnel_run when it fits one of them and returns that tool's exact request and response in `structured`; it generates SQL only when neither fits. Call analytics_metric_query, analytics_funnel_run or analytics_person_timeline directly when you already know the shape of the question — those are deterministic and cheaper.

Example

Ask your agent something like this:

Answer a natural-language analytics question for the current product.

The agent will invoke analytics_query_run with these arguments:

{
  "q": "<q>"
}

Esc

Start typing to search the docs.

↑↓navigate↵select