Skip to main content
Glama

meta-ad-library-scraper

Scrape Facebook and Instagram ads from Meta's Ad Library by keyword or advertiser page. Extract ad text, headlines, CTAs, links, media URLs, formats, platforms, run dates into one flat row per ad.

Instructions

Meta Ad Library Scraper. Scrape Facebook and Instagram ads from Meta's Ad Library by keyword or advertiser page: ad text, headline, call to action, link, image and video URLs, format, platforms and run dates. One flat row per ad, with a hard cap. Export data, run via API, schedule runs.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "meta-ad-library-scraper"
  }
}

Input Schema

NameRequiredDescriptionDefault
adTypeNo🗳️ Ad type — All ads, or only the political and social-issue shelf. Meta publishes spend, impressions and reach for that shelf and for nothing else, so the spend, impressionsText and reachEstimate columns only carry numbers here.all
maxAdsNo💯 Maximum ads — Hard cap for the whole run. It is checked before every request, so the run stops at this number and never bills you past it.
countryNo🌍 Country — Two-letter country code of the audience the ads were shown to, for example US, GB, DE. Meta indexes ads per country, so this changes which ads exist, not just how they are filtered.US
endDateNo📅 Ads started before — Only ads that began running on or before this date, as YYYY-MM-DD.
pageIdsNo📄 Facebook page IDs — Numeric page IDs to pull every ad of one advertiser, instead of searching by keyword. The ID is the number in an ad's Ad Library link, and it is also returned as pageId on every row.
queriesNo🔍 Search keywords — Words or brand names to search the Ad Library for, one per line. Every ad whose text, advertiser or link matches is returned.
mediaTypeNo🖼️ Media type — Keep only ads of one format. Meta applies this itself, so it changes which ads are fetched and therefore what you pay for.all
platformsNo📱 Platforms — Limit to ads shown on particular Meta surfaces. Leave empty for all of them.
startDateNo📅 Ads started after — Only ads that began running on or after this date, as YYYY-MM-DD.
activeStatusNo🟢 Ad status — Whether to return ads that are still running, ads that have stopped, or both.active
maxAdsPerQueryNoMaximum ads per keyword or page — Optional per-target cap, so one broad keyword cannot eat the whole run.
proxyConfigurationNoProxy — Meta serves the Ad Library to residential addresses only; from a datacentre address it answers with an empty response. Leave this on the default unless you know why you are changing it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the output shape ('one flat row per ad') and the existence of a hard cap, but says nothing about credit consumption/billing, authentication requirements, rate limits, or failure modes — the cost and auth profile is only discoverable by reading the schema's parameter text.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and output fields are front-loaded in a tight sentence, with the row/cap contract stated next. The closing sentence ('Export data, run via API, schedule runs') describes platform features rather than this tool's behavior and is the least earned line.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter tool with no annotations and no output schema, the description still covers the returned fields and the flat-row/cap contract, and the unusually rich schema fills in the rest. Missing are billing/auth and failure-mode context, which matter for a paid scraping tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 12 parameters in detail. The description's only added meaning is the keyword-vs-page targeting framing, which the schema also states; the baseline of 3 applies when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — scrape Facebook and Instagram ads from Meta's Ad Library — and names the two targeting modes (keyword or advertiser page) plus the returned fields. No sibling tool in the catalog covers this resource, so an agent can identify it immediately.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'by keyword or advertiser page' implies the two selection modes, but the description never says when to prefer one over the other or what prerequisites exist. There is no explicit when-to-use or when-not-to-use guidance, only an implied usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.