{
  "id": "search_affiliates",
  "mcp_tool": "search_affiliates",
  "status": "approved",
  "source_system": "cake",
  "environment": ["staging", "prod"],
  "sharded": false,
  "connections": {
    "admin": "cake_admin_ro"
  },
  "objects": [
    "Admin.lucos_ro_affiliate_directory"
  ],
  "parameters": {
    "q": { "type": "string", "required": false },
    "publisher_id": { "type": "string", "required": false },
    "affiliate_id": { "type": "int", "required": false },
    "limit": { "type": "int", "required": false, "default": 25 }
  },
  "constraints": {
    "max_window_days": 1,
    "default_window_days": 1,
    "max_rows": 25,
    "timeout_ms": 60000
  },
  "allow_fields": [
    "affiliate_id",
    "affiliate_name"
  ],
  "deny_fields": ["rev_share", "email", "pass_clr", "pass_hash"],
  "post_processing": [
    "Exactly one of q (substring on affiliate_name), publisher_id (exact Affiliate.name), or affiliate_id (exact Cake id). Unscoped directory dump is rejected.",
    "Reads Admin.lucos_ro_affiliate_directory only (AffiliateIDs.id + AffiliateIDs.Affiliate joined to Affiliate). Not the click-grain CPC view. No date window.",
    "Row-capped at 25. search_publishers stays MNGT identity (no numeric Cake id)."
  ],
  "notes": "Answers 'what is the Cake affiliate_id for fatcoupon_CPA'. Do not use get_affiliate_report (payout, times out on CPC). Do not adhoc onto AffiliateIDs. Dummy 1-day window constraints exist because the catalog schema requires them; the executor does not apply a date filter."
}
