{
  "id": "list_advertisers_high_revenue_concentration",
  "mcp_tool": "list_advertisers_high_revenue_concentration",
  "status": "approved",
  "source_system": "cake",
  "environment": ["staging", "prod"],
  "sharded": false,
  "connections": {
    "admin": "cake_admin_ro",
    "whale": "cake_whale_ro"
  },
  "objects": [
    "Admin.lucos_ro_adv_campaign_performance_daily",
    "Admin.lucos_ro_campaign_directory",
    "whale.lucos_ro_advertiser_stats_daily"
  ],
  "parameters": {
    "max_performing_campaigns": { "type": "int", "required": false },
    "min_top_share": { "type": "number", "required": false },
    "date_from": { "type": "date", "required": false },
    "date_to": { "type": "date", "required": false },
    "limit": { "type": "int", "required": false, "default": 50 }
  },
  "constraints": {
    "max_window_days": 92,
    "default_window_days": 31,
    "max_rows": 50,
    "timeout_ms": 60000
  },
  "allow_fields": [
    "adv_id",
    "adv_name",
    "performing_campaign_count",
    "top_campaign_id",
    "top_campaign_name",
    "top_campaign_revenue",
    "advertiser_revenue",
    "top_campaign_share",
    "revenue_risk_20pct"
  ],
  "deny_fields": ["rev_share", "aov", "postback_url", "ip"],
  "post_processing": [
    "Per campaign: sales_revenue from Admin (0 if missing), spend from whale (0 if missing). Merge in TypeScript — do not SQL-join Admin and whale (OD-1).",
    "Performing campaign = sales_revenue > 0, else spend > 0 (CPA).",
    "Per advertiser: performing_campaign_count, advertiser_revenue = sum sales_revenue, top campaign by sales_revenue (tie-break smaller camp_id).",
    "top_campaign_share = top_campaign_revenue / advertiser_revenue when advertiser_revenue > 0; otherwise skip the advertiser (cannot compute revenue share).",
    "revenue_risk_20pct = 0.20 * top_campaign_revenue (always server-derived, labeled). Ranked top_campaign_share DESC, then advertiser_revenue DESC. Row-capped at 50.",
    "If max_performing_campaigns is set, keep performing_campaign_count <= that value (must be >= 1). If min_top_share is set, keep top_campaign_share >= that 0–1 fraction.",
    "Admin SQL aggregates lucos_ro_adv_campaign_performance_daily by (adv_id, camp_id) first, then joins lucos_ro_campaign_directory. Do NOT invent a new view."
  ],
  "notes": "Answers advertisers whose campaign revenue is concentrated, plus 20% top-campaign risk (TW-340). Spend is on whale; revenue is on Admin — never SQL-join across instances. Catch tmobile / LOOKFANTASTIC with many camps but >=80% in top 1–2 via min_top_share. Never invert list_advertisers_low_traffic_concentration (that tool ranks LOW click share among >=5 active campaigns)."
}
