A solution for an AI agent
A morning ad account digest: an AI agent spots the deviations
Meta Ads
Claude
A morning with a dozen ad accounts usually starts the same way: open each one, compare yesterday with the previous days and spot where something went wrong. A missed deviation costs a day of wasted spend. You can hand this check to an AI agent: it goes through the accounts on a schedule and sends a short digest that shows right away where to look.
This is a solution that runs inside an AI agent. You need Claude (or another agent) with Meta Ads MCP connected, read-only access and a scheduled run. No separate server, bot or thresholds in code.
A quick note
This is a fairly simple solution. This article works as a good reference implementation for your agent and as a step-by-step documented guide.
What the agent checks
- Cost per key event. Yesterday versus the 7-day average for every account and its larger campaigns.
- Spend. Over- and underspend against the average and the monthly plan.
- Conversions. Campaigns that spend without results.
- CTR, CPM and frequency. Signs of creative fatigue and an overheated audience.
- Trends. Metrics that have been getting worse for several days, even if yesterday was within range.
What the digest looks like
An example on fictional accounts. The digest is short: what needs attention first, the total across accounts at the end.
Digest for 2 November4 accounts · compared with the 7-day average
Stridely EU. Cost per trial $41.2 versus $27.8 (+48%). Spend is normal, conversions dropped in the retargeting campaign. Check the creative: weekly frequency is 5.3.
Stridely LatAm. Spend $1,840 versus $1,200 (+53%), cost per trial is normal. Looks like automatic budget expansion.
Northwind Shop. CTR 0.62% versus 0.94%, down for the third day in a row.
Stridely MENA. Cost per trial $22.1 (−4%), spend on plan.
Day total: $6,310 spend, 214 conversions, average cost $29.5 (+9%).
How it works
- Context. Once, you give the agent the list of accounts, the key event and target cost for each, and the deviation thresholds.
- Schedule. The daily digest prompt runs every morning, for example at 8:00. In Claude this is a scheduled task; with other agents any scheduler works.
- Digest. The agent requests the statistics through MCP, calculates the deviations and writes briefly: what happened, the number and what to check.
- Drill-down. If something is flagged as critical, the third prompt asks the agent to dig into it.
Prompt 0. Context and rules
Put it into the instructions of a separate Claude project so every run uses the same rules.
You are responsible for daily monitoring of Meta ad accounts through the connected Meta Ads MCP. Read-only mode: do not create, change or pause anything.
Accounts:
- [name or ID]: key event [trial / purchase / lead], target cost [$], monthly spend plan [$]
- [name or ID]: ...
Thresholds:
- Critical: cost per key event [30]% or more above the 7-day average, or more than [$] spent with zero conversions.
- Attention: a [15–30]% deviation in cost per event or spend, CTR [20]% or more below average, weekly frequency above [4], one metric getting worse 3 days in a row.
- Do not assess campaigns spending under [$50] a day individually, only include them in the account total.
Rules:
1. Compare yesterday with the average of the previous 7 days and with the same day last week.
2. Allow for attribution delay: yesterday's conversions may still come in, so mark small conversion drops as "preliminary".
3. Report only facts from the data. If data is missing, say so.
4. Format every item as: account, what happened, number versus average, what to check.
Prompt 1. Daily digest
This is the prompt you put on a schedule.
Make the morning digest for yesterday across all accounts in the instructions.
1. For each account get, for yesterday and the 7 previous days: spend, impressions, CPM, CTR, frequency, key events and their cost. For accounts with deviations add a breakdown by campaign.
2. Compare yesterday with the 7-day average and with the same day last week, apply the thresholds.
3. Check campaigns that spent more than the threshold yesterday without conversions.
4. Calculate month-to-date spend pace against the monthly plan.
Answer format, no longer than 15 lines:
- Heading: date and number of accounts.
- Blocks "Critical", "Attention", "On track". Skip empty blocks. One line per account in "On track".
- At the end, the day total across all accounts: spend, key events, average cost and deviation from the average.
No tables and no introduction, only the digest.
Prompt 2. Weekly digest
Schedule it for Monday, instead of or alongside the daily one.
Make a digest for last week (Monday to Sunday) across all accounts in the instructions.
1. Compare the week with the previous one: spend, key events, their cost, CTR, CPM, frequency.
2. Show the 3 campaigns with the best and the 3 with the worst trend in cost per event.
3. Month-to-date spend pace against the plan and a forecast for the end of the month.
4. Flag creatives and ad sets where frequency went up and CTR went down.
Format: the same "Critical", "Attention", "On track" blocks, then 3 recommendations for the week.
Prompt 3. Drill into a deviation
Run it by hand when the digest flags something.
Analyse the deviation in account [name] on [date]: [what the digest flagged].
1. Find the level where it started: campaign, ad set or ad.
2. Check breakdowns by placement, device, age and gender and find where exactly the picture changed.
3. See whether budgets, bids, audiences or creatives changed in the last 3 days.
4. Give 2–3 possible causes in order of likelihood and what to check for each.
Do not change anything in the account, analysis only.
How to put it on a schedule
- Create a Claude project called “Ad account monitoring” and paste prompt 0 into its instructions.
- Run prompt 1 by hand once and check the digest: do the numbers match Ads Manager, do the thresholds fit?
- Create a scheduled task with prompt 1 for every morning, for example 8:00 your time. For Mondays add a task with prompt 2.
- After a week, tune the thresholds: if the digest is noisy, raise them; if it misses important things, lower them.
If your agent runs outside Claude, the logic is the same: prompt 0 goes into the system instructions, a scheduler runs prompt 1, and the digest goes wherever you will read it. How to send it to Slack and Telegram is below.
How to get the digest in Slack or Telegram
Slack
Option 1. Claude inside Slack (Team and Enterprise plans). Claude has a Slack app, Claude Tag, and it can run scheduled jobs in a channel.
- An admin of your Claude organization pairs the Slack workspace and adds Meta Ads MCP as a connector for the channel: in the Claude Tag settings this is done through a custom connector.
- In the channel, send one message with the schedule and the job: “@Claude every weekday at 8am [time zone], make the morning ad account digest”, followed by the text of prompts 0 and 1.
- Every morning the digest posts in that channel, and you can discuss a deviation right in the thread under it.
Option 2. A webhook (any plan). This works with an agent that runs on a schedule and can send HTTP requests, such as Claude Code or your own agent.
- In Slack, create an app with an Incoming Webhook for the channel and copy the webhook URL.
- Store the URL in an environment variable,
SLACK_WEBHOOK_URL. Don’t paste it into the prompt: it’s a secret. - Add this to the end of prompt 1:
When the digest is ready, send it to Slack: POST to the URL in the SLACK_WEBHOOK_URL environment variable with the JSON body {"text": "<digest>"}. Don't print the URL in your reply. If sending fails, retry once and report the error.
Telegram
- Create a bot with @BotFather and get its token.
- Send the bot
/start(or add it to your team chat) and find thechat_id: openhttps://api.telegram.org/bot<token>/getUpdatesin a browser and look for thechat.idfield. - Then there are two ways:
- An agent that sends HTTP requests (Claude Code, your own agent). Store the token in an environment variable,
TELEGRAM_BOT_TOKEN, and add the block below to the end of prompt 1. - A Telegram connector in Claude. Third-party MCP servers for Telegram bots exist and can be added as a custom connector. Keep in mind that the bot token is then stored by that third party.
- An agent that sends HTTP requests (Claude Code, your own agent). Store the token in an environment variable,
When the digest is ready, send it to Telegram: POST https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage with chat_id=[your chat_id], parse_mode=HTML and text=the digest. Make block titles bold with <b>, no Markdown. Take the token from the environment variable and don't print it in your reply. If sending fails, retry once and report the error.
A 15-line digest fits within one Telegram message (4,096 characters), so there’s no need to split it.
Tips from practice
- Don’t run the digest before 7–8 am in the account time zone: by then yesterday’s data is almost complete.
- Each account needs its own thresholds. Small accounts have more daily noise and need wider thresholds.
- The digest doesn’t make decisions. The agent shows where to look. You change budgets and pause campaigns.
- For a deep dive once a month, use audience research with an AI agent.