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

NameTypeRequiredDescription
qstringNatural-language analytics question

Response

FieldTypeAlwaysDescription
sqlstring
rowsarray
answerstring
truncatedboolean
structuredobject
explanationstring

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.

navigateselect