Skip to main content
Glama
EfrainTorres

ArmaVita Meta Ads MCP

search_ads_archive

Search Meta's public Ads Library to analyze competitor advertisements, research ad strategies, and monitor advertising trends across specified countries.

Instructions

Search ads in Meta's public Ads Library endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_termsYes
ad_reached_countriesYes
meta_access_tokenNo
ad_typeNoALL
page_sizeNo
page_cursorNo
fieldsNoad_creation_time,ad_creative_body,ad_creative_link_caption,ad_creative_link_description,ad_creative_link_title,ad_delivery_start_time,ad_delivery_stop_time,ad_snapshot_url,currency,demographic_distribution,funding_entity,impressions,page_id,page_name,publisher_platform,region_distribution,spend

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler implementation for the search_ads_archive MCP tool. It uses decorators for registration and makes the API request via make_api_request.
    @mcp_server.tool()
    @meta_api_tool
    async def search_ads_archive(
        search_terms: str,
        ad_reached_countries: List[str],
        meta_access_token: Optional[str] = None,
        ad_type: str = "ALL",
        page_size: int = 25,
        page_cursor: str = "",
        fields: str = (
            "ad_creation_time,ad_creative_body,ad_creative_link_caption,ad_creative_link_description,"
            "ad_creative_link_title,ad_delivery_start_time,ad_delivery_stop_time,ad_snapshot_url,currency,"
            "demographic_distribution,funding_entity,impressions,page_id,page_name,publisher_platform,"
            "region_distribution,spend"
        ),
    ) -> str:
        """Search ads in Meta's public Ads Library endpoint."""
        if not str(search_terms or "").strip():
            return json.dumps({"error": "search_terms parameter is required"}, indent=2)
    
        if not isinstance(ad_reached_countries, list) or not ad_reached_countries:
            return json.dumps({"error": "ad_reached_countries parameter is required"}, indent=2)
    
        countries = [str(code).strip().upper() for code in ad_reached_countries if str(code).strip()]
        if not countries:
            return json.dumps({"error": "ad_reached_countries parameter is required"}, indent=2)
    
        payload = {
            "search_terms": search_terms,
            "ad_reached_countries": countries,
            "ad_type": _normalize_ad_type(ad_type),
            "page_size": int(page_size),
            "fields": fields,
        }
        if page_cursor:
            payload["page_cursor"] = page_cursor
    
        result = await make_api_request("ads_archive", meta_access_token, payload, method="GET")
        return json.dumps(result, indent=2)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'Meta's public Ads Library endpoint' which hints at an external API, but doesn't disclose authentication requirements (despite the meta_access_token parameter), rate limits, pagination behavior (though page_size and page_cursor parameters exist), or what kind of data is returned. The description is minimal and leaves critical behavioral aspects unexplained.

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?

The description is extremely concise - a single sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential action and target. Every word earns its place, making it maximally efficient within its limited scope.

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

Completeness2/5

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

Given the complexity (7 parameters, 2 required), complete lack of schema descriptions, and no annotations, the description is inadequate. While an output schema exists (which relieves the description from explaining return values), the description doesn't address authentication needs, parameter meanings, usage context, or behavioral constraints. For a search tool with multiple parameters and external API integration, this leaves too many gaps for effective agent use.

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

Parameters2/5

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

With 0% schema description coverage for all 7 parameters, the description provides no parameter information whatsoever. It doesn't explain what 'search_terms' should contain, what 'ad_reached_countries' expects, what the 'meta_access_token' is for, what 'ad_type' options exist, how pagination works with 'page_size' and 'page_cursor', or what 'fields' controls. The description fails to compensate for the complete lack of schema documentation.

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?

The description clearly states the action ('Search ads') and target resource ('Meta's public Ads Library endpoint'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling search tools like 'search_behaviors', 'search_demographics', or 'search_pages', which all search different aspects of the Meta ecosystem.

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?

The description provides no guidance about when to use this tool versus alternatives. There's no mention of when this search is appropriate compared to other search tools (like search_pages or search_interests) or when to use it versus listing tools (like list_ads). No prerequisites, exclusions, or contextual boundaries are provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EfrainTorres/armavita-meta-ads-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server