Skip to content
Run this on autopilot — free
Workflow · Creatives

Rank and Diagnose Your Ad Creatives With Claude Code + GoMarble MCP

Time to first output: About 15-20 minutes to set up, then a few minutes per run.

What it does?

The prompt pulls live creative-level performance from Meta and Google via GoMarble MCP, ranks every ad, flags the ones fatiguing (frequency up 30%+, CTR down 20%+ week over week), and writes an AI performance brief.

What you need

  • Anthropic API key
  • GoMarble API key
  • Meta Ad Account ID and/or Google Ads Customer ID

First, connect Claude Code to your ad accounts

GoMarble MCP connects Claude Code with your live Meta and Google Ads accounts so the generated script can pull creative performance data automatically.

1

Install Claude Code and Python

Download Claude Code (claude.com/download) and Python (python.org/downloads) if you don't already have them.

2

Connect your ad account(s)

Go to apps.gomarble.ai, sign up, and connect the Meta Ads and/or Google Ads account you want to analyze in the Integrations page.

3

Get your GoMarble API key

In GoMarble, go to Settings → API Key, copy the key, and save it somewhere safe.

4

Add GoMarble MCP to Claude Code

Run the command below in your terminal to connect Claude Code to GoMarble MCP.

claude mcp add --transport http gomarble https://apps.gomarble.ai/mcp-api/mcp --header "Authorization: Bearer <paste your API key>"

Unlike the other scripts in this batch, what you paste here is a build instruction — Claude Code writes the actual creative_performance.py script for you based on it.

The prompt

Paste this into Claude Code — it instructs Claude to build a Python CLI script (creative_performance.py) that pulls Meta and Google creative performance via GoMarble MCP, detects fatigue, and ranks winners vs. underperformers. Then update the credentials and run the generated script.

Lead-magnet prompt · free

Build a Python CLI script called creative_performance.py that ranks ad creatives and detects fatigue using GoMarble MCP.

CLI args: --meta act_123456 and/or --google 1234567890

Use GoMarble MCP call pattern:

ANTHROPIC_API_KEY = ""
GOMARBLE_API_KEY = ""

POST https://api.anthropic.com/v1/messages, anthropic-version: "2023-06-01", anthropic-beta: "mcp-client-2025-04-04"

mcp_servers: [{type: "url", url: "https://apps.gomarble.ai/mcp-api/sse", name: "gomarble", authorization_token: GOMARBLE_API_KEY}]

6-step pipeline:

1. Account Structure — fetch details

2. Ad-Level Performance (30d) — Meta: facebook_get_adaccount_insights, level: ad, fields: [ad_id, ad_name, campaign_name, spend, impressions, clicks, ctr, cpc, cpm, purchase_roas, actions], limit 50. Google: GAQL ad_group_ad metrics

3. Weekly Trends — Meta: time_increment: 7. Google: daily data bucketed into weeks. Fatigue = frequency up >30% AND CTR down >20%

4. Rankings — top 20% by ROAS = "winner", bottom 20% = "underperformer"

5. AI Brief — creative performance analysis

6. Output: creative_performance.csv, creative_fatigue.csv, creative_brief.txt

What you get back

  • Format: Three files, per the build prompt:
    • creative_performance.csv — ranked ad creatives with performance metrics
    • creative_fatigue.csv — ads flagged for fatigue (frequency up more than 30% and CTR down more than 20% week over week)
    • creative_brief.txt — an AI-written creative performance analysis
Upgrade

Want this automated?

Run the prompt above every Monday morning automatically. GoMarble Agents don't just deliver the report (Slack / email / in-app) — they can execute the recommended changes directly in your ad account, too. Offload the whole recurring task and stop doing it manually.

Try GoMarble Agents free →

FAQ

What does this build?
A Python CLI script (creative_performance.py) that ranks ad creatives by performance and flags fatiguing ones, using GoMarble MCP for live Meta and Google Ads data.
How does it detect fatigue?
Per the build spec: fatigue is flagged when frequency (Meta) rises more than 30% and CTR falls more than 20% across weekly buckets.
How does it rank winners vs. underperformers?
The top 20% of creatives by ROAS are labeled "winner" and the bottom 20% are labeled "underperformer."
What data does it pull?
Ad-level performance (spend, impressions, clicks, CTR, CPC, CPM, ROAS, actions) via facebook_get_adaccount_insights for Meta, limited to 50 ads, and ad-group-ad metrics via a GAQL query for Google.
Does this run automatically?
No — it's a CLI script you run yourself with --meta and/or --google flags each time you want a fresh breakdown.
What files does it output?
creative_performance.csv, creative_fatigue.csv, and creative_brief.txt.
Do I need both Meta and Google connected?
No — the CLI args accept --meta and/or --google, so either platform alone works.

Skip the prompt — let GoMarble do this for you.

Sign up, connect your ad accounts, and creative performance breakdowns runs on every account, every week, automatically.