Skip to main content
Glama

facebook_ad_library_search

Search Meta Ad Library by keyword — active/inactive, media type, date range, platforms, cursor, and spend/impressions when Meta publishes them. Costs 2 credits. Empty results and failures are never charged. Pass cache=true for a free 24h cache hit (default always fresh).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesKeyword, brand, or advertiser to search Meta Ad Library (min 2 characters).
trimNoWhen true, omit cards/images/videos typed arrays (media[] stays). Captapi payloads are already lean vs Meta nested snapshots.
cacheNoSet true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh.
limitNoMax items to return (default 20, max 200). Flat 2 credits per call.
cursorNoPagination cursor from a previous nextCursor. Pages through the current Meta HTML result batch.
statusNoAd delivery status: ACTIVE (default), INACTIVE, or ALL. Use ACTIVE for "what are they running now?".
ad_typeNoall (default) or political_and_issue_ads. Spend/impressions are typically only filled for political/issue ads.
countryNoTwo-letter ISO country code (e.g. US, GB, DE). Default US. Non-ISO codes are a definitive 400 INVALID_COUNTRY — Meta would otherwise ignore the code and search globally while echoing it back as if the filter worked.
sort_byNoMeta sort mode: total_impressions or relevancy_monthly_grouped.
end_dateNoOnly ads with delivery start on/before this date (YYYY-MM-DD).
platformsNoComma-separated publisher platforms to keep: FACEBOOK, INSTAGRAM, MESSENGER, AUDIENCE_NETWORK, THREADS.
media_typeNoCreative filter: ALL (default), IMAGE, VIDEO, MEME, IMAGE_AND_MEME, or NONE.
start_dateNoOnly ads with delivery start on/after this date (YYYY-MM-DD).
search_typeNokeyword_unordered (default) or keyword_exact_phrase.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / country / description
      Previous value: -"Two-letter ISO country code (e.g. US, GB, DE). Default US."New value: +"Two-letter ISO country code (e.g. US, GB, DE). Default US. Non-ISO codes are a definitive 400 INVALID_COUNTRY — Meta would otherwise ignore the code and search globally while echoing it back as if the filter worked."
  2. Changed1 schema field changed
    • changedInput schema / properties / cache / description
      Previous value: -"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits."New value: +"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh."
  3. Changed13 schema fields changed
    • changedInput schema / properties / ad_type / description
      Previous value: -"all (default) or political_and_issue_ads."New value: +"all (default) or political_and_issue_ads. Spend/impressions are typically only filled for political/issue ads."
    • changedInput schema / properties / cache / description
      Previous value: -"Set true to serve from the 24h response cache. Default false — always fetch fresh data."New value: +"Set true to serve from the 24h response cache (0 credits on hit). Default false — always fetch fresh. Envelope includes cached + cachedAt on hits."
    • changedInput schema / properties / country / description
      Previous value: -"ISO country code. Default US."New value: +"Two-letter ISO country code (e.g. US, GB, DE). Default US."
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Pagination cursor from a previous nextCursor. Pages through the current Meta HTML result batch.",
      +  "type": "string"
      +}
    • changedInput schema / properties / end_date / description
      Previous value: -"Delivery start on/before YYYY-MM-DD."New value: +"Only ads with delivery start on/before this date (YYYY-MM-DD)."
    • changedInput schema / properties / limit / description
      Previous value: -"Max items to return. Default 20, max 200. Billed per result."New value: +"Max items to return (default 20, max 200). Flat 2 credits per call."
    • changedInput schema / properties / media_type / description
      Previous value: -"ALL (default), IMAGE, VIDEO, MEME, IMAGE_AND_MEME, or NONE."New value: +"Creative filter: ALL (default), IMAGE, VIDEO, MEME, IMAGE_AND_MEME, or NONE."
    • addedInput schema / properties / platforms
      Added value: +{
      +  "description": "Comma-separated publisher platforms to keep: FACEBOOK, INSTAGRAM, MESSENGER, AUDIENCE_NETWORK, THREADS.",
      +  "type": "string"
      +}
    • changedInput schema / properties / q / description
      Previous value: -"Search query or keywords (min 2 chars)."New value: +"Keyword, brand, or advertiser to search Meta Ad Library (min 2 characters)."
    • changedInput schema / properties / sort_by / description
      Previous value: -"total_impressions or relevancy_monthly_grouped."New value: +"Meta sort mode: total_impressions or relevancy_monthly_grouped."
    • changedInput schema / properties / start_date / description
      Previous value: -"Delivery start on/after YYYY-MM-DD."New value: +"Only ads with delivery start on/after this date (YYYY-MM-DD)."
    • changedInput schema / properties / status / description
      Previous value: -"ACTIVE (default), INACTIVE, or ALL."New value: +"Ad delivery status: ACTIVE (default), INACTIVE, or ALL. Use ACTIVE for \"what are they running now?\"."
    • addedInput schema / properties / trim
      Added value: +{
      +  "description": "When true, omit cards/images/videos typed arrays (media[] stays). Captapi payloads are already lean vs Meta nested snapshots.",
      +  "type": "boolean"
      +}
  4. Changed7 schema fields changed
    • addedInput schema / properties / ad_type
      Added value: +{
      +  "description": "all (default) or political_and_issue_ads.",
      +  "type": "string"
      +}
    • addedInput schema / properties / end_date
      Added value: +{
      +  "description": "Delivery start on/before YYYY-MM-DD.",
      +  "type": "string"
      +}
    • addedInput schema / properties / media_type
      Added value: +{
      +  "description": "ALL (default), IMAGE, VIDEO, MEME, IMAGE_AND_MEME, or NONE.",
      +  "type": "string"
      +}
    • addedInput schema / properties / search_type
      Added value: +{
      +  "description": "keyword_unordered (default) or keyword_exact_phrase.",
      +  "type": "string"
      +}
    • addedInput schema / properties / sort_by
      Added value: +{
      +  "description": "total_impressions or relevancy_monthly_grouped.",
      +  "type": "string"
      +}
    • addedInput schema / properties / start_date
      Added value: +{
      +  "description": "Delivery start on/after YYYY-MM-DD.",
      +  "type": "string"
      +}
    • addedInput schema / properties / status
      Added value: +{
      +  "description": "ACTIVE (default), INACTIVE, or ALL.",
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • changedInput schema / properties / cache / description
      Previous value: -"Responses are cached for 24 hours by default. Set false to bypass the cache and always fetch fresh data (default true)."New value: +"Set true to serve from the 24h response cache. Default false — always fetch fresh data."
  6. Changed1 schema field changed
    • addedInput schema / properties / cache
      Added value: +{
      +  "description": "Responses are cached for 24 hours by default. Set false to bypass the cache and always fetch fresh data (default true).",
      +  "type": "boolean"
      +}
  7. Added

TDQS

B3.3/5.0
Behavior3/5

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

Since no annotations are provided, the description carries the full burden. It discloses credit cost, free cache hits, and that empty results/failures are not charged. It does not address auth, rate limits, response shape, or side-effect safety, but the mentioned behaviors add meaningful context.

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

Conciseness5/5

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

Three compact sentences front-load the tool's purpose and filter list, then add cost and caching details. Every sentence earns its place with no redundancy.

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

Completeness3/5

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

The tool is complex (14 parameters, no output schema, no annotations), and the description gives a useful high-level overview plus billing/cache behavior. However, it does not explain the response format, pagination semantics beyond a cursor parameter, or how to choose among the many ad library siblings.

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 coverage is 100%, so the baseline is 3. The description repeats the cache behavior and spend/impressions availability already present in the schema, adding no significant new parameter-level insight beyond the mention of credit cost.

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

Purpose4/5

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

States a specific verb and resource ('Search Meta Ad Library by keyword') and lists the main filters, making the core function clear. It does not explicitly differentiate from the sibling facebook_ad_library_search_companies, so it falls short of full sibling distinction.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives like facebook_ad_library_search_companies or facebook_ad_library_company_ads. It does not mention exclusions or routing to siblings, leaving the agent to infer usage context.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.