Skip to main content
Glama

facebook_ad_library_company_ads

Ads for one Meta page — active by default, Meta's top-by-impressions order, sort_by and date window, same envelope as /facebook/search. Each ad has creativeHash + landingDomain; dedupe=true merges repeats. Costs 2 credits. Empty results and failures are never charged. Pass cache=true for a free 24h cache hit (default always fresh).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "facebook_ad_library_company_ads"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYespageId from /search-companies (preferred), libraryUrl, vanity page URL (facebook.com/nike/), or Ad Library URL with view_all_page_id. Do not pass profileId from facebook.com/{digits}/ when it differs from pageId. The URL platform must match this endpoint's platform. Do not pass cross-platform URLs, e.g. YouTube to TikTok, Instagram to Facebook, LinkedIn to X/Twitter, or Pinterest to Rumble.
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 on the native path; the extended fallback bills per returned ad.
cursorNoPagination cursor from a previous nextCursor. Pages through the current Meta HTML result batch.
dedupeNoWhen true, ads with the same creativeHash (same copy, headline and landing domain) collapse into one row, the first in library order, with duplicateIds[] (every ad id in the group) and duplicateCount (group size). Duplicates are merged only among the ads this request fetched (retrievableCount). Ads from another request or from library pages past this batch are not compared, so the same creative can appear again there. Default false: every ad is its own row and no duplicate fields are added. Same price.
fieldsNoOptional comma-separated keys to keep on each result row (or on the object for single-item tools), e.g. id,url,publishedAt,engagement. Pagination keys are always kept. Does not change the price.
statusNoAd delivery status: ACTIVE (default), INACTIVE, or ALL. Use ACTIVE for "what are they running now?".
compactNoDefault true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. On Threads, Facebook, Meta Ad Library and TikTok Shop tools request timings are dropped too. Pass false for the full body.
countryNoTwo-letter ISO country code, or ALL for every country (Meta's own value). Default US. For inactive ads prefer ALL: a single-country search can list far fewer inactive ads than ALL. Other non-ISO codes are a definitive 400 INVALID_COUNTRY.
sort_byNoMeta sort mode: total_impressions or relevancy_monthly_grouped. Omit for Meta's default ranking (top ads by impressions first).
end_dateNoOnly ads shown (delivered) on or before this date (YYYY-MM-DD).
start_dateNoOnly ads shown (delivered) on or after this date (YYYY-MM-DD). Delivery-date window, not a start-date filter: an ad that started earlier but was still running in the range is included.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / dedupe
      Added value: +{
      +  "description": "When true, ads with the same creativeHash (same copy, headline and landing domain) collapse into one row, the first in library order, with duplicateIds[] (every ad id in the group) and duplicateCount (group size). Duplicates are merged only among the ads this request fetched (retrievableCount). Ads from another request or from library pages past this batch are not compared, so the same creative can appear again there. Default false: every ad is its own row and no duplicate fields are added. Same price.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / compact / description
      Previous value: -"Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. Pass false for the full body."New value: +"Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. On Threads, Facebook, Meta Ad Library and TikTok Shop tools request timings are dropped too. Pass false for the full body."
  3. Changed2 schema fields changed
    • addedInput schema / properties / compact
      Added value: +{
      +  "default": true,
      +  "description": "Default true here: drop signed media URLs (video, image, avatar links and their expiry stamps) to keep the response small. Ids, permalinks, dates, text and metrics stay. Pass false for the full body.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / fields
      Added value: +{
      +  "description": "Optional comma-separated keys to keep on each result row (or on the object for single-item tools), e.g. id,url,publishedAt,engagement. Pagination keys are always kept. Does not change the price.",
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / country / description
      Previous value: -"Two-letter ISO country code. Default US. Non-ISO codes are a definitive 400 INVALID_COUNTRY."New value: +"Two-letter ISO country code, or ALL for every country (Meta's own value). Default US. For inactive ads prefer ALL: a single-country search can list far fewer inactive ads than ALL. Other non-ISO codes are a definitive 400 INVALID_COUNTRY."
  5. Changed1 schema field changed
    • removedInput schema / properties / url / format
      Removed value: -"uri"
  6. Changed3 schema fields changed
    • addedInput schema / properties / end_date
      Added value: +{
      +  "description": "Only ads shown (delivered) on or before this date (YYYY-MM-DD).",
      +  "type": "string"
      +}
    • addedInput schema / properties / sort_by
      Added value: +{
      +  "description": "Meta sort mode: total_impressions or relevancy_monthly_grouped. Omit for Meta's default ranking (top ads by impressions first).",
      +  "type": "string"
      +}
    • addedInput schema / properties / start_date
      Added value: +{
      +  "description": "Only ads shown (delivered) on or after this date (YYYY-MM-DD). Delivery-date window, not a start-date filter: an ad that started earlier but was still running in the range is included.",
      +  "type": "string"
      +}
  7. Changed3 schema fields changed
    • changedInput schema / properties / country / description
      Previous value: -"Two-letter ISO country code. Default US."New value: +"Two-letter ISO country code. Default US. Non-ISO codes are a definitive 400 INVALID_COUNTRY."
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Pagination cursor from a previous nextCursor. Pages through the current Meta HTML result batch.",
      +  "type": "string"
      +}
    • addedInput schema / properties / status
      Added value: +{
      +  "description": "Ad delivery status: ACTIVE (default), INACTIVE, or ALL. Use ACTIVE for \"what are they running now?\".",
      +  "type": "string"
      +}
  8. 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."
  9. Changed4 schema fields changed
    • 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. Default US."
    • 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 on the native path; the extended fallback bills per returned ad."
    • changedInput schema / properties / url / description
      Previous value: -"Facebook page URL or Meta Ad Library URL. The URL platform must match this tool's platform. Do not pass cross-platform URLs, e.g. YouTube to TikTok, Instagram to Facebook, LinkedIn to X/Twitter, or Pinterest to Rumble."New value: +"pageId from /search-companies (preferred), libraryUrl, vanity page URL (facebook.com/nike/), or Ad Library URL with view_all_page_id. Do not pass profileId from facebook.com/{digits}/ when it differs from pageId. The URL platform must match this endpoint's platform. Do not pass cross-platform URLs, e.g. YouTube to TikTok, Instagram to Facebook, LinkedIn to X/Twitter, or Pinterest to Rumble."
  10. 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."
  11. 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"
      +}
  12. Added

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the 2-credit cost, that empty results and failures are never charged, that caching is opt-in with a 24h window and fresh-by-default, and that compact=true strips signed media URLs by default. It stops short of auth requirements, rate limits, or how nextCursor paging interacts with the credit charge.

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?

The purpose and key defaults are front-loaded in a single dense paragraph with no filler sentences. Some fragments are telegraphic to the point of ambiguity ("same envelope as /facebook/search", the bare "creativeHash + landingDomain") but nothing is wasted.

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 covers billing, caching, dedupe scope limits, and default behaviors well. It is slightly thin on the overall return shape and pagination, which an agent must infer from the schema alone.

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% and the schema already explains url, dedupe, status, country, dates, and compact in detail, so the description only echoes these at a high level ("sort_by and date window", "active by default"). The "same envelope as /facebook/search" reference is opaque and adds little meaning an agent can act on.

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?

"Ads for one Meta page" gives a specific resource plus scope, and the mention of creativeHash, landingDomain and the shared envelope tells an agent what a row looks like. It does not name the keyword-search sibling (facebook_ad_library_search) as the alternative, so the boundary between per-page and search tools is left implicit.

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?

Useful defaults are stated (active by default, Meta's top-by-impressions order, dedupe=true merges repeats, cache=true for a free hit), which implies when to use this tool for a single advertiser's current ads. However, there is no explicit when-not guidance and no named alternative for cross-advertiser or keyword discovery, leaving the routing decision partly inferred.

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.