Skip to main content
Glama
Captapi MCP Server

Captapi MCP Server

Official

Facebook Ad Library Search

facebook_ad_library_search

Search Meta Ad Library by keyword to find active or inactive ads with filters for platform, media type, country, and date range. Use it to research competitor creatives and ad spend.

Instructions

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).

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": {
      "q": "<q>"
    },
    "name": "facebook_ad_library_search"
  }
}

Input 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. First observedv0.5.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden and does deliver real behavioral value: 2 credits per call, empty results and failures never charged, and a 24h cache that is opt-in. It says nothing about rate limits, authentication, error modes beyond what the schema mentions, or what a successful response contains.

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?

Front-loaded with the verb and resource, then compact sentences covering facets, cost, billing exceptions, and cache. Every sentence carries information an agent would act on; no filler.

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?

For a 14-parameter tool with no annotations and no output schema, the description covers cost, billing exceptions, and cache policy well but omits the response shape and pagination behavior (cursor semantics live only in the schema). An agent can call it, but cannot predict what it gets back.

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 14 parameters, including the careful country-code and cache semantics. The description adds nothing beyond restating the facet list and the cache default, so baseline 3 applies.

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+resource ('Search Meta Ad Library by keyword') and enumerates the filterable facets, so an agent knows exactly what the tool retrieves. It does not distinguish itself from siblings such as facebook_ad_library_company_ads or search_companies, so the agent must infer the difference from names alone.

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 invocation guidance exists for the cost/cache tradeoff ('Pass cache=true for a free 24h cache hit'), but there is no when-to-use/when-not guidance relative to the sibling ad-library tools. Usage is only implied by the keyword-search framing.

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

Deploy Server

Other Tools