{"name":"analytics_query","inputSchema":{"type":"object","oneOf":[{"type":"object","properties":{"platform":{"type":"string","const":"instagram"},"account_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scope":{"default":"account","type":"string","enum":["account","top_posts","post"]},"date_window":{"type":"string","enum":["last_7d","last_14d","last_30d","last_90d","last_month"]},"metric":{"type":"string","enum":["engagement_rate","reach","impressions","views","likes","comments","shares","saves","total_interactions","retention_rate"]},"direction":{"type":"string","enum":["top","bottom"]},"top_n":{"type":"integer","minimum":1,"maximum":10},"include":{"type":"array","items":{"type":"string","enum":["daily_trend","demographics","content_type","audience_breakdown","post_activity"]}},"post_id":{"type":"string"}},"required":["platform"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"facebook"},"account_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scope":{"default":"account","type":"string","enum":["account","top_posts","post"]},"date_window":{"type":"string","enum":["last_7d","last_14d","last_30d","last_90d","last_month"]},"metric":{"type":"string","enum":["engagement_rate","reach","impressions","views","likes","comments","shares","saves","total_interactions","retention_rate"]},"direction":{"type":"string","enum":["top","bottom"]},"top_n":{"type":"integer","minimum":1,"maximum":10},"include":{"type":"array","items":{"type":"string","enum":["daily_trend","demographics","content_type","audience_breakdown","post_activity"]}},"post_id":{"type":"string"}},"required":["platform"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"tiktok"},"account_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scope":{"default":"account","type":"string","enum":["account","top_posts","post"]},"date_window":{"type":"string","enum":["last_7d","last_14d","last_30d","last_90d","last_month"]},"metric":{"type":"string","enum":["engagement_rate","reach","impressions","views","likes","comments","shares","saves","total_interactions","retention_rate"]},"direction":{"type":"string","enum":["top","bottom"]},"top_n":{"type":"integer","minimum":1,"maximum":10},"include":{"type":"array","items":{"type":"string","enum":["daily_trend","demographics","content_type","audience_breakdown","post_activity"]}},"post_id":{"type":"string"}},"required":["platform"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"linkedin"},"account_id":{"description":"LinkedIn sponsored account id for paid scopes; omit only for organic account/top_posts/post scopes when a single organization is connected.","type":"string"},"surface":{"default":"organic","type":"string","enum":["organic","paid"]},"scope":{"default":"account","type":"string","enum":["account","top_posts","post","overview","campaign","top_campaigns","top_adsets","top_ads"]},"date_window":{"type":"string","enum":["last_7d","last_14d","last_30d","last_90d","last_month"]},"metric":{"type":"string","enum":["engagement_rate","reach","impressions","views","likes","comments","shares","saves","total_interactions","retention_rate"]},"kpi":{"type":"string","enum":["spend","impressions","clicks","ctr","cpc","cpm","conversions","conversions_value","cost_per_conversion","roas"]},"direction":{"type":"string","enum":["top","bottom"]},"top_n":{"type":"integer","minimum":1,"maximum":10},"include":{"type":"array","items":{"type":"string","enum":["daily_trend","demographics","content_type","audience_breakdown","post_activity"]}},"include_daily_trend":{"type":"boolean"},"since":{"description":"Paid scopes only.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"description":"Paid scopes only.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"post_id":{"type":"string"},"campaign_id":{"type":"string"},"adset_id":{"description":"LinkedIn paid top_ads treats this as a creative id.","type":"string"}},"required":["platform"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"youtube"},"account_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"scope":{"default":"kpis","type":"string","enum":["kpis","top_posts"]},"date_window":{"type":"string","enum":["last_7d","last_14d","last_30d","last_90d","last_month"]},"metric":{"type":"string","enum":["engagement_rate","reach","impressions","views","likes","comments","shares","saves","total_interactions","retention_rate"]},"direction":{"type":"string","enum":["top","bottom"]},"top_n":{"type":"integer","minimum":1,"maximum":10}},"required":["platform"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"google_ads"},"account_id":{"description":"Google Ads customer ID. Omit to use the brand's only connected Google Ads account; required when the brand has more than one.","type":"string"},"scope":{"default":"overview","anyOf":[{"type":"string","enum":["overview","campaign","top_campaigns","top_adsets","top_ads"]},{"type":"string","enum":["top_keywords","top_search_terms","keyword_quality"]}]},"kpi":{"type":"string","enum":["spend","impressions","clicks","ctr","cpc","cpm","conversions","conversions_value","cost_per_conversion","roas"]},"date_window":{"type":"string","enum":["last_7d","last_14d","last_30d"]},"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"direction":{"type":"string","enum":["top","bottom"]},"top_n":{"type":"integer","minimum":1,"maximum":10},"include_daily_trend":{"type":"boolean"},"campaign_id":{"type":"string"},"adset_id":{"type":"string"}},"required":["platform"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"meta"},"account_id":{"description":"Meta ad account id (required; not auto-resolved).","type":"string"},"scope":{"default":"overview","type":"string","enum":["overview","campaign","top_campaigns","top_adsets","top_ads","list"]},"kpi":{"type":"string","enum":["spend","impressions","clicks","ctr","cpc","cpm","conversions","conversions_value","cost_per_conversion","roas"]},"date_window":{"type":"string","enum":["last_7d","last_14d","last_30d"]},"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"direction":{"type":"string","enum":["top","bottom"]},"top_n":{"type":"integer","minimum":1,"maximum":10},"include_daily_trend":{"type":"boolean"},"level":{"type":"string","enum":["campaign","adset","ad"]},"limit":{"type":"integer","minimum":1,"maximum":500},"cursor":{"type":"string","minLength":1},"campaign_id":{"type":"string"},"adset_id":{"type":"string"}},"required":["platform"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"google_analytics"},"property_id":{"description":"GA4 property ID; omit to use the brand's default connected property.","type":"string"},"date_range":{"anyOf":[{"type":"object","properties":{"preset":{"type":"string","enum":["last_7d","last_14d","last_30d"]}},"required":["preset"],"additionalProperties":false},{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["since","until"],"additionalProperties":false}]}},"required":["platform"],"additionalProperties":false}]}}
