Agent context
Microsoft Ads models
4 SQL models that turn the raw Microsoft Ads tables into the reports people ask about. Deploy them in Weld and your agent queries the definitions behind every number.
How the set is built
- 6Raw tables
- 4Core
- 4Analytics
Staging cleans each raw table once, core holds the logic, and analytics is the table dashboards and agents read.
- Account ReportGenerates an account report by integrating with Microsoft Ads. It retrieves data from the ad_performance_daily_report and account tables, joins them based on the account_id, and calculates metrics such as clicks, impressions, and spend. The resulting report includes information about the date, account name, account ID, time zone, device OS, device type, network, and currency code.grain: day x account x device OS x device type x network x currency · 2 raw tables
- Ad Group ReportGenerates a report that combines data from the "ad_performance_daily_report," "ad_group," "campaign," and "account" tables in the Microsoft Ads integration. It joins these tables based on specific columns and calculates aggregated metrics such as clicks, impressions, and spend. The resulting report includes information on the date, account, campaign, ad group, device, network, and currency code.grain: day x ad group x device OS x device type x network x currency · 4 raw tables
- Campaign ReportGenerates a campaign report by integrating with Microsoft Ads. It combines data from the campaign performance daily report, campaign, and account tables. The joined table includes information such as date, account name and ID, campaign name and ID, campaign type and status, device OS and type, network, currency code, clicks, impressions, and spend.grain: day x campaign x device OS x device type x network x currency · 3 raw tables
- Ad ReportGenerates an ad report by joining data from multiple tables related to Microsoft Ads. It retrieves information such as date, account name and ID, campaign name and ID, ad group name and ID, ad name and ID, device OS, device type, network, currency code, clicks, impressions, and spend. The template performs a left join on the specified tables and groups the data based on selected columns. The final result includes all columns from the joined data.grain: day x ad x device OS x device type x network x currency · 5 raw tables
- Weld or dbt
- The same SQL in both dialects. Sync the folder with GitHub Sync, or copy the dbt models into your project.
- Check before you rely on it
- Reconcile a month against Microsoft Ads's own reports first. Each model's notes say what the synced data can and can't support.
Connect Microsoft Ads.
Your agents start with context.
Sync Microsoft Ads to your warehouse, deploy these models, and query them from Claude, Cursor or ChatGPT over MCP. Free for 14 days, no credit card.