Agent context
Sendgrid models
4 SQL models that turn the raw Sendgrid 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
- 8Raw tables
- 8Staging
- 4Core
- 4Analytics
Staging cleans each raw table once, core holds the logic, and analytics is the table dashboards and agents read.
- Category stats dailySendGrid's Category Stats, rebuilt: the same funnel as email_stats_daily, split by the category labels you attach when sending (for example "welcome", "receipt", "newsletter-2026-10").grain: one row per day x category · 1 raw table
- Email stats dailySendGrid's global Stats overview, rebuilt: the delivery funnel and engagement for all mail sent through the account, per day.grain: one row per day, as SendGrid's Stats API buckets it · 1 raw table
- Mailbox provider stats dailySendGrid's Mailbox Provider stats, rebuilt: deliverability and engagement by the receiving provider. This is where a reputation problem shows up first, usually as blocks or deferrals at one provider while the others look normal.grain: one row per day x mailbox provider · 1 raw table
- Suppressions dailyNew suppressions per day, by type: the list-hygiene view behind SendGrid's Suppressions pages (Bounces, Blocks, Invalid Emails, Spam Reports, Global Unsubscribes).grain: one row per day (UTC, from the suppression's `created` time) x suppression type · 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 Sendgrid's own reports first. Each model's notes say what the synced data can and can't support.
Connect Sendgrid.
Your agents start with context.
Sync Sendgrid to your warehouse, deploy these models, and query them from Claude, Cursor or ChatGPT over MCP. Free for 14 days, no credit card.