Skip to content

Cross-period product sets

Compare product-ID sets returned by one bundled period call.

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 products in the first period.

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

    Query products in the second period.

    Request contract
    metrics: unitsgroup_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": "tmall",
  "field": "category_l3",
  "kw": "示例品类",
  "limit": 10,
  "task_query": "使用 tmall 数据执行跨期商品集合;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": [
        "units"
      ],
      "name": "query_second_period",
      "time": {
        "end": "2025-06-30",
        "start": "2025-04-01"
      }
    }
  ],
  "dataset": "tmall",
  "filters": [
    {
      "field": "category_l3",
      "op": "eq",
      "value": "示例品类"
    }
  ],
  "group_by": [
    "product_id",
    "title",
    "product_url"
  ],
  "limit": 1000,
  "main_query_name": "query_first_period",
  "metrics": [
    "units"
  ],
  "task_query": "使用 tmall 数据执行跨期商品集合;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

compare_sets · set_difference

Compute new, missing, and retained product IDs.

source_steps: query_first_period, query_second_period

Output policy

  • State period direction and list exact product IDs, titles, and canonical URLs.

Stop conditions

  • Stop when the periods or scope are not comparable.
  • Stop and report truncation when either period response has meta.truncated=true.

Limitations

  • Absence means no returned units in the queried data, not a launch claim.
  • The comparison requires complete source queries; use each response's meta.truncated flag as the source of truth.