{
  "id": "list_campaigns_without_traffic",
  "mcp_tool": "list_campaigns_without_traffic",
  "status": "approved",
  "source_system": "cake",
  "environment": ["staging", "prod"],
  "sharded": false,
  "connections": {
    "whale": "cake_whale_ro",
    "admin": "cake_admin_ro"
  },
  "objects": [
    "Admin.lucos_ro_campaign_directory",
    "whale.lucos_ro_advertiser_stats_daily"
  ],
  "parameters": {
    "advertiser_id": { "type": "int", "required": false },
    "include_inactive": { "type": "int", "required": false, "default": 0 },
    "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": 7,
    "max_rows": 50,
    "timeout_ms": 60000
  },
  "allow_fields": [
    "camp_id",
    "campaign_name",
    "adv_id",
    "adv_name",
    "campaign_status",
    "clicks"
  ],
  "deny_fields": ["rev_share", "net_cpc", "cpc", "click_table_id"],
  "post_processing": [
    "Two queries + TypeScript anti-join (OD-1: Admin and whale are different hosts). Identity zeros are directory camp_id not in the whale click set.",
    "Date filter lives only on whale.lucos_ro_advertiser_stats_daily WHERE stat_date BETWEEN ? AND ? AND show_oos = 0 GROUP BY camp_id HAVING SUM(clicks) > 0. Do not put a date filter on the directory WHERE.",
    "Do not LIMIT the directory query before the anti-join (zeros disappear if the first 50 by name have traffic).",
    "Default currently active campaigns only (d.status = 'A'). include_inactive 0/1, default 0; when 1 omit the status filter.",
    "Optional advertiser_id filters d.adv_id on the directory side so zero-traffic camps still appear.",
    "Unscoped result is row-capped at 50 after the anti-join and is not a complete inventory of every zero-traffic campaign."
  ],
  "notes": "Answers 'campaigns with no Cake advertiser_stats traffic in the last 7 days' as a TS anti-join of lucos_ro_campaign_directory to the whale click set. clicks_source is whale.advertiser_stats_report. rev_share stays denied. Do not use get_campaign_performance_report for zeros (sparse, ranker)."
}
