Recipe
Pause the ads of out-of-stock products, from the chat
Through the Adrails MCP server, Claude or ChatGPT reads your Shopify products with their inventory, finds the ads whose final URL or copy still sells a sold-out product, and prepares one pause per ad. You confirm each on its review page. No automation pauses on stock today; the article says what runs on a schedule instead.
By Thomas, founder of Adrails · Reviewed Oct 4, 2026
The recipe
From stock to pause
Two reads, then one proposal per ad. The match between a product and its ads is the assistant's reading of the final URL and the copy.
01
Read stock
store_products returns each product's title, handle, price range, total inventory and status, 50 at a time.
02
Match the ads
campaigns_structure lists every ad of an account with its final URL and copy; the assistant matches the product's handle or title.
03
Pause, one confirmation each
campaigns_set_status prepares one proposal per ad. Open each link, check the ad, confirm. Adrails reads the platform again and pauses once.
04
Resume when it is back
The same tool with status ACTIVE, or actions_undo while the platform still matches the change.
01
What you get, and how long it takes
At the end, every ad that still sends clicks to a sold-out product is paused, with the reason recorded and the result measured after 24 hours, 3 days and 7 days. The recipe takes ten minutes for a catalogue of fifty products and a handful of ads: two reads, then one review page per ad to confirm in the browser.
What you do not get is an automation that does it while you sleep. No automation step reads inventory today, and the Pause step acts only on rows that came from an ad step or a threshold. The last section says what can run on a schedule instead, and what it does not do.
02
Before you start
Connect Adrails to Claude or ChatGPT as the setup article explains. Reading the catalogue and the ads needs Read workspace data, which any member can grant. Each pause needs Prepare advertising changes, an owner or admin, and an active plan: Preview refuses proposals.
Shopify must be connected under Integrations in Adrails, so store_products has products to read. Its inventory is as of the last sync: integrations_status says how fresh it is, and integrations_sync, with Manage integrations, queues a refresh before you read.
- Permissions: Read workspace data for the reads, Prepare advertising changes for the pauses.
- Shopify connected, with its products synced. Meta or Google Ads accounts connected.
- On Meta, the connection needs the ads_management permission for a pause.
03
1. Read the inventory with store_products
store_products returns the products of the connected stores: title, handle, minimum and maximum price with the currency, total inventory, status, product type, vendor and the store they come from. Its inputs are limit, 1 to 50, search, which filters on the title, and status. Ask for active products and keep those whose total inventory is 0 or below.
Fifty products come back per call and there is no page cursor. For a larger catalogue, read by product type or by search term, or ask the assistant to search for the product lines your ads actually sell. The sync date comes back with the results; a stock figure older than a day is worth a refresh first.
- Prompt: Read my active products with store_products, 50 at most. Keep those with an inventory of 0 or less and list title and handle.
- Returned: products with title, handle, prices, inventory and status, the store they belong to, and when they were synced.
04
2. Find the ads that still sell the product
campaigns_structure returns one account as of the last sync, on Meta and Google Ads alike. It lists every campaign with type, status and budget, every ad set or ad group, and every ad with its format, headlines, descriptions, final URL and review status. Give it the account id, and a campaign id to narrow it on a large account. The assistant matches each sold-out product by its handle in a final URL or its title in the copy.
On Meta, creative_insights adds a second route. It groups the account's ads by the image or video they use and reports each asset's metadata: angle, offer, product, persona and creator. The metadata is what Creatives in Adrails carries, and it is reported missing when nothing was tagged. When your creatives carry a product, the match is by name rather than by URL.
- Prompt: Read campaigns_structure for account <id>. Which active ads have a final URL containing one of these handles, or a headline naming one of these products: <list>?
- Prompt, Meta: Read creative_insights for account <id> and list the assets whose product is one of <list>, with the ads that use them.
- Returned: the matching ads with their ids, status, campaign and ad set or ad group.
05
3. Pause each ad, one confirmation each
campaigns_set_status pauses one campaign, ad group or ad on Meta or Google Ads. Give the account id, the ad's id exactly as campaigns_structure returned it, entityType ad, status PAUSED and a reason of up to 300 characters naming the product and its inventory. Each call returns one proposal: a preview, an action id, an expiry 30 minutes later and a review link. Nothing reaches the platform.
Open each link and confirm the change on the review page, or decline it. Once you confirm, Adrails reads the platform again, refuses if the ad changed in the meantime, and pauses it once. actions_recent then shows each pause with its observations. When the product is back, prepare the same tool with status ACTIVE, or actions_undo while the platform still matches the pause.
- Prompt: For each matching ad, prepare campaigns_set_status PAUSED on account <id>, reason: product <handle> at inventory 0 on <date>, ad still sends clicks to it.
- Returned: one proposal per ad, each with its review link. Ten proposals a minute per connection, so a long list comes in batches.
06
4. What can run on a schedule today
No automation template pauses on stock, and none can be built to. The Shopify products step of an automation reads sales, units and orders, not inventory, and the Pause step accepts rows from an ad step or a threshold only. An automation that read products and then paused would be refused by the editor with the reason: pausing needs campaigns, ads or their groups above it.
What can run is a scheduled list. Start a blank automation with a weekly schedule and an Adrails Agent step with your Shopify connection. Instruct it to list sold-out products that still have active ads, and add a Send step to Slack, Discord or email. The agent step has the read tools, store_products and campaigns_structure included, and nothing else: it posts the list and pauses nothing. It uses agent credits each time it runs, and on Preview an automation has no agent step.
Then the pauses are yours: run this recipe from the chat, or open the ads in Campaigns in Adrails. When an automation that reads inventory exists, this article will say so.
07
Pitfalls
The weak point of this recipe is the match. An ad that sells a collection, not a product, keeps running when one item sells out, and a product sold under two names needs both in the search. Read the matched list before confirming anything.
- store_products returns 50 products per call with no cursor. Read by product type or search term on a large catalogue.
- Inventory is as of the last sync. Refresh with integrations_sync, or check integrations_status, before you pause on a figure.
- creative_insights reads Meta only, and reports product metadata only where Creatives carries it.
- Rate limits: 60 calls and 10 proposals a minute per connection, one call at a time. Twenty ads take two minutes of proposals.
- A proposal expires 30 minutes after it is prepared. Confirm the batch while it is fresh, or ask again.
- A paused ad stays paused when the product returns. Resume it with campaigns_set_status ACTIVE, or it never sells again.
On a schedule
What runs on a schedule, and what does not
Checked against the automation templates and steps. The honest answer is that stock does not reach the Pause step yet.
| Need | What Adrails has today | What it does not do |
|---|---|---|
| Pause an ad when a product sells out | Nothing: no automation step reads inventory | The Pause step only takes campaigns, ad sets, ad groups or ads from an ad step or a threshold |
| A weekly list of sold-out products with live ads | A blank automation: a schedule, an Adrails Agent step with your Shopify connection, a Send step | The agent step reads only. It posts the list to Slack, Discord or email; it pauses nothing |
| Pause what spends without results | The Stop-loss template: spend of 100 today without a result, ask to pause up to 5 per run | It reads spend and results, not stock |
| The week's best sellers | The Best sellers template: the store's ten best sellers of the week, every Monday | Sales, units and orders; no inventory |
From the Automations documentation and the workflow templates. The Shopify products step reads sales, units and orders; the Pause step takes rows from an ad step or a threshold only.
Go further
Read more
- Connect Meta Ads and Google Ads to Claude and ChatGPTAdd the Adrails server to Claude, Claude Code, ChatGPT or Codex, then choose the permissions.
- Shopify integrationWhat Adrails imports from Shopify, including products, and how often.
- Automations in the docsTriggers, steps and the Pause step's rules.
- MCP tools referenceEvery tool, its inputs, what it reads or changes and who can call it.
FAQ
Common questions
Can Adrails pause ads automatically when a product sells out?
Not today. No automation step reads inventory, and the Pause step acts only on rows from an ad step or a threshold. The recipe pauses from the chat, one review page per ad.
How does the assistant know which ad sells which product?
From campaigns_structure: each ad's final URL and copy. It matches the product's handle in the URL or its title in the headlines. On Meta, creative_insights adds the product tagged on each creative in Creatives.
Is one confirmation enough for several ads?
No. campaigns_set_status prepares one proposal per campaign, ad group or ad, each with its own review link. A batch of ten is ten review pages.
What happens when the product is back in stock?
Nothing, until you act. Prepare campaigns_set_status with status ACTIVE for each paused ad, or actions_undo while the platform still matches the pause.