Skip to content

Product contribution to change

Attribute cross-period GMV change from two product-level atomic queries.

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 scope

category_l3
periodsRequired · user_required

Two comparable periods

Execution steps

  1. 1
    resolve_scope · search_values

    Resolve the category value.

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

    Query product GMV in the first period.

    Request contract
    metrics: gmvgroup_by: product_id, title, product_urlfilter: category_l3 eq $scopetime: $periods.firstlimit: 1000
  3. 3
    query_second_period · query_metrics

    Query product GMV in the second period.

    Request contract
    metrics: gmvgroup_by: product_id, title, product_urlfilter: category_l3 eq $scopetime: $periods.secondlimit: 1000

Call example

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

search_values
{
  "dataset": "jd",
  "field": "category_l3",
  "kw": "示例品类",
  "limit": 10,
  "task_query": "使用 jd 数据执行商品变化贡献;scope=示例品类,periods={\"first\":{\"start\":\"2025-01-01\",\"end\":\"2025-03-31\"},\"second\":{\"start\":\"2025-04-01\",\"end\":\"2025-06-30\"}}"
}
query_metrics
{
  "additional_queries": [
    {
      "filters": [
        {
          "field": "category_l3",
          "op": "eq",
          "value": "示例品类"
        }
      ],
      "group_by": [
        "product_id",
        "title",
        "product_url"
      ],
      "limit": 1000,
      "metrics": [
        "gmv"
      ],
      "name": "query_second_period",
      "time": {
        "end": "2025-06-30",
        "start": "2025-04-01"
      }
    }
  ],
  "dataset": "jd",
  "filters": [
    {
      "field": "category_l3",
      "op": "eq",
      "value": "示例品类"
    }
  ],
  "group_by": [
    "product_id",
    "title",
    "product_url"
  ],
  "limit": 1000,
  "main_query_name": "query_first_period",
  "metrics": [
    "gmv"
  ],
  "task_query": "使用 jd 数据执行商品变化贡献;scope=示例品类,periods={\"first\":{\"start\":\"2025-01-01\",\"end\":\"2025-03-31\"},\"second\":{\"start\":\"2025-04-01\",\"end\":\"2025-06-30\"}}",
  "time": {
    "end": "2025-03-31",
    "start": "2025-01-01"
  }
}

Agent computation

compute_contribution · contribution

Join by product ID, subtract periods, and rank contributions.

source_steps: query_first_period, query_second_period

Output policy

  • Show product IDs, titles, canonical URLs, deltas, and contribution to total change.

Stop conditions

  • Stop when periods or filters differ.
  • Stop and report truncation when either period response has meta.truncated=true.

Limitations

  • Contribution is arithmetic attribution, not causal inference.
  • Attribution requires complete source queries; use each response's meta.truncated flag as the source of truth.