Skip to content

Aggregate and product drilldown

Query an aggregate scope, then rank products under exactly the same filters.

Authenticated runtime tools and each query response are authoritative for tenant scope and current data coverage.

This is an MCP query composition, not a complete business report; see Research Methods in the Agent Docs for complete workflows.

Required inputs

scopeRequired · search_values

Exact category value

category_l3
timeRequired · user_required

Analysis time range

ranking_metricOptional · user_required

Metric used to rank products

Default: gmv · Allowed values: gmv, units
top_nOptional · user_required

Number of products to return

Default: 20

Execution steps

  1. 1
    resolve_scope · search_values

    Resolve the spoken category value.

    Request contract
    category_l3 ← $scope
  2. 2
    query_scope · query_metrics

    Query aggregate GMV and units.

    Request contract
    metrics: gmv, unitsfilter: category_l3 eq $scopetime: $time
  3. 3
    query_products · query_metrics

    Query products using the same scope and time.

    Request contract
    metrics: gmv, unitsgroup_by: product_id, title, product_urlfilter: category_l3 eq $scopetime: $timeorder_by: $ranking_metric desclimit: $top_n

Call example

Replace example values with exact user inputs or platform values returned by search_values.

search_values
{
  "dataset": "tmall",
  "field": "category_l3",
  "kw": "示例品类",
  "limit": 10,
  "task_query": "使用 tmall 数据执行汇总与商品下钻;scope=示例品类,time={\"last_complete_months\":3},ranking_metric=gmv,top_n=10"
}
query_metrics
{
  "additional_queries": [
    {
      "filters": [
        {
          "field": "category_l3",
          "op": "eq",
          "value": "示例品类"
        }
      ],
      "group_by": [
        "product_id",
        "title",
        "product_url"
      ],
      "limit": 10,
      "metrics": [
        "gmv",
        "units"
      ],
      "name": "query_products",
      "order_by": [
        {
          "dir": "desc",
          "field": "gmv"
        }
      ],
      "time": {
        "last_complete_months": 3
      }
    }
  ],
  "dataset": "tmall",
  "filters": [
    {
      "field": "category_l3",
      "op": "eq",
      "value": "示例品类"
    }
  ],
  "main_query_name": "query_scope",
  "metrics": [
    "gmv",
    "units"
  ],
  "task_query": "使用 tmall 数据执行汇总与商品下钻;scope=示例品类,time={\"last_complete_months\":3},ranking_metric=gmv,top_n=10",
  "time": {
    "last_complete_months": 3
  }
}

Agent computation

rank_products · rank

Rank products by the requested metric.

source_steps: query_products

Output policy

  • Show the aggregate before the product ranking, with complete product identity.

Stop conditions

  • Stop if the scope cannot be resolved exactly.

Limitations

  • Keep the aggregate and drilldown filters identical.