Skip to main content
Glama
Facebook Ads Library MCP Server

Facebook Ads Library MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GEMINI_API_KEYNoGoogle Gemini API key for video analysis (optional)
SCRAPECREATORS_API_KEYYesYour ads data provider API key

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server provides access to Meta's Ad Library (Facebook, Instagram) through the ScrapeCreators API.

Workflow:

  1. A brand's ads: get_meta_platform_id finds its page ID, then get_meta_ads returns its ads.

  2. Ads by topic, product or phrase, any advertiser: search_meta_ads_by_keyword.

  3. Creatives: analyze_ad_image and analyze_ad_video on any returned media_url.

Re-running get_meta_ads for a page 24h+ later reports which ads are new and how many dropped out since the last fetch. For a research job (video scripts, competitor teardown, product hunting, prospect lists, weekly competitor tracking) call get_playbook first and follow it.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_meta_platform_idA

Search for companies or brands in the Meta Ad Library and return their platform IDs. Use this tool when you need to find a brand's Meta Platform ID before retrieving their ads. This tool searches the Facebook Ad Library to find matching brands and their associated Meta Platform IDs for ad retrieval.

get_meta_adsA

Retrieve currently running ads for a brand using their Meta Platform ID. Use this tool after getting a platform ID from get_meta_platform_id. This tool fetches active advertisements from the Meta Ad Library, including ad content, media URLs, dates, and targeting information. The result's changes block lists ads launched in the last 7 days and, when the same page was fetched with the same filters 24h+ ago, which ads are new since then and how many dropped out. For complete analysis of visual elements, colors, design, or image content, you MUST also use analyze_ad_image on the media_url from each ad.

search_meta_ads_by_keywordA

Search the whole Meta Ad Library by keyword, topic or phrase, without knowing the advertiser. Use it to find who advertises a product or problem, ads in a niche, or partnership ads run through creators (get_meta_ads only returns a brand's own page). Returns ads with page_id and page_name, so you can follow up with get_meta_ads on any advertiser.

analyze_ad_imageA

Analyze a Facebook ad image: returns the image itself so you can see it, plus a checklist (text, hooks, people, brand elements, composition, colors). Pass one media_url from get_meta_ads or search_meta_ads_by_keyword. Downloads are cached locally.

get_cache_statsA

REQUIRED for checking media cache status and storage usage. Use this tool when users ask about cache statistics, storage space used by cached media (images and videos), or how many files have been analyzed and cached. Essential for cache management and monitoring.

search_cached_mediaA

REQUIRED for finding previously analyzed ad media (images and videos) in cache. Use this tool when users want to search for cached media by brand name, find media with people, search by colors, or filter by media type. Essential for retrieving past analysis results without re-downloading media.

cleanup_media_cacheB

REQUIRED for cleaning up old cached media files (images and videos) and freeing disk space. Use this tool when users want to remove old cached media, clean up storage space, or when cache becomes too large. Essential for cache maintenance and storage management.

analyze_ad_videoA

REQUIRED for analyzing video ads from Facebook. Download and analyze ad videos using Gemini's advanced video understanding capabilities. Extracts visual storytelling, audio elements, pacing, scene transitions, brand messaging, and marketing strategy insights. Uses intelligent caching for efficiency and includes comprehensive video analysis.

get_playbookA

Load a playbook: the step-by-step method for an ad research job (which tool calls, what to look for, output format). Call it BEFORE starting when the request matches a job, then follow it. Jobs:

  • script_writing: video ad scripts, hooks to film, UGC briefs, modelling or recreating a winning ad

  • competitor_teardown: competitors' hooks, offers, angles and positioning, what's working in a market

  • product_hunt: winning products to sell (dropshipping, DTC), or whether a product is saturated

  • who_is_advertising: which businesses or prospects run ads; prospect lists for agencies and sellers

  • competitor_watch: tracking competitors, what's new since last time, weekly updates

Prompts

Interactive templates invoked by user choice

NameDescription
script_writingPlaybook for video ad scripts, hooks to film, UGC briefs, modelling or recreating a winning ad.
competitor_teardownPlaybook for competitors' hooks, offers, angles and positioning, what's working in a market.
product_huntPlaybook for winning products to sell (dropshipping, DTC), or whether a product is saturated.
who_is_advertisingPlaybook for which businesses or prospects run ads; prospect lists for agencies and sellers.
competitor_watchPlaybook for tracking competitors, what's new since last time, weekly updates.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.8/5.0

Scored across 9 tools

Disambiguation5/5

Each tool targets a distinct step in the ad research workflow: brand lookup, ad retrieval, keyword search, media analysis, cache management, and playbook loading. Descriptions explicitly clarify boundaries, e.g., get_meta_ads works by platform ID while search_meta_ads_by_keyword covers the whole library, and analyze_ad_image vs. analyze_ad_video are cleanly separated by media type.

Naming Consistency4/5

Most names follow a readable snake_case verb_noun pattern (get_meta_ads, analyze_ad_image, search_cached_media). A few are slightly longer or irregular (search_meta_ads_by_keyword, cleanup_media_cache), but the convention remains predictable overall.

Tool Count5/5

Nine tools form a well-scoped set covering search, retrieval, analysis, caching, and guidance. No tool feels redundant, and the count sits comfortably within the ideal 3–15 range.

Completeness4/5

The surface covers the core ad research lifecycle: finding advertisers, fetching ads, keyword discovery, image/video analysis, cache monitoring, and step-by-step playbooks. Minor gaps exist around explicit filtering/date-range controls or batch export, but agents can work around them using existing tools.

Maintenance

ActivityMaintained
ResponsivenessLimited data