Skip to main content
Glama
dhawalshah

meta-ads-mcp

get_ad_creatives_by_ad_id

Fetch ad creatives for a Facebook ad by ad ID, returning creative content, media, and specifications. Choose relevant fields and paginate through results.

Instructions

Retrieves the ad creatives associated with a specific Facebook ad.

This function accesses the Facebook Graph API to retrieve the creative objects used by a specific ad, including details about the creative content, media, and specifications.

Args: ad_id (str): The ID of the ad to retrieve creatives for. fields (Optional[List[str]]): A list of specific fields to retrieve for each creative. If None, a default set of fields will be returned. Available fields include: - 'id': The creative's ID - 'name': The creative's name - 'account_id': The ID of the ad account this creative belongs to - 'actor_id': ID of the Facebook actor associated with creative - 'adlabels': Ad labels applied to the creative - 'applink_treatment': App link treatment type - 'asset_feed_spec': Specifications for dynamic ad creatives - 'authorization_category': Political ad authorization category - 'body': Ad body text content - 'branded_content_sponsor_page_id': ID of sponsoring page for branded content - 'call_to_action_type': Type of call to action button - 'effective_authorization_category': Effective authorization category - 'effective_instagram_media_id': Instagram media ID used - 'effective_instagram_story_id': Instagram story ID used - 'effective_object_story_id': Object story ID used - 'image_hash': Hash of the image used in the creative - 'image_url': URL of the image used - 'instagram_actor_id': Instagram actor ID (deprecated) - 'instagram_permalink_url': Instagram permalink URL - 'instagram_story_id': Instagram story ID - 'instagram_user_id': Instagram user ID associated with creative - 'link_og_id': Open Graph ID for the link - 'link_url': URL being advertised - 'object_id': ID of the Facebook object being advertised - 'object_story_id': ID of the page post used in the ad - 'object_story_spec': Specification for the page post - 'object_type': Type of the object being advertised ('PAGE', 'DOMAIN', etc.) - 'object_url': URL of the object being advertised - 'platform_customizations': Custom specifications for different platforms - 'product_set_id': ID of the product set for product ads - 'status': Status of this creative ('ACTIVE', 'IN_PROCESS', etc.) - 'template_url': URL of the template used - 'thumbnail_url': URL of the creative thumbnail - 'title': Ad headline/title text - 'url_tags': URL tags appended to landing pages for tracking - 'use_page_actor_override': Whether to use the page actor instead of account actor - 'video_id': ID of the video used in the ad limit (Optional[int]): Maximum number of creatives to return per page. Default is 25. after (Optional[str]): Pagination cursor for the next page. From response['paging']['cursors']['after']. before (Optional[str]): Pagination cursor for the previous page. From response['paging']['cursors']['before']. date_format (Optional[str]): Format for date responses. Options: - 'U': Unix timestamp (seconds since epoch) - 'Y-m-d H:i:s': MySQL datetime format - None: ISO 8601 format (default)

Returns: Dict: A dictionary containing the requested ad creatives. The main results are in the 'data' list, and pagination info is in the 'paging' object.

Example: ```python # Get basic creative information for an ad creatives = get_ad_creatives( ad_id="23843211234567", fields=["name", "image_url", "body", "title", "status"] )

# Get detailed creative specifications with pagination
detailed_creatives = get_ad_creatives(
    ad_id="23843211234567",
    fields=["name", "object_story_spec", "image_url", "call_to_action_type"],
    limit=50
)

# Fetch the next page if available using the pagination cursor
next_page_cursor = creatives.get("paging", {}).get("cursors", {}).get("after")
if next_page_cursor:
    next_page = get_ad_creatives(
        ad_id="23843211234567",
        fields=["name", "image_url", "body", "title"],
        limit=50,
        after=next_page_cursor
    )
```

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYes
afterNo
limitNo
beforeNo
fieldsNo
date_formatNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/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 explains that the function accesses the Facebook Graph API, returns a dict with 'data' and 'paging', uses defaults when fields is None, and supports pagination cursors. It does not cover authentication, rate limits, or error behavior, but for a read-only retrieval this is substantially transparent.

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 description is long but justified by the large set of available fields and options. It is well-structured with Args, Returns, and Example sections, and the core purpose is front-loaded. The examples use the function name `get_ad_creatives` instead of `get_ad_creatives_by_ad_id`, which is a minor inconsistency.

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

Completeness5/5

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

Given the 6-parameter interface and lack of annotations, the description is remarkably complete: it covers all parameters, return shape, pagination, defaults, and realistic usage examples. An agent would have enough context to select and invoke the tool correctly without needing additional information.

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

Parameters5/5

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

Schema description coverage is 0%, and the description compensates thoroughly. Every parameter is explained, including defaults, types, semantics for pagination cursors, date_format options, and an extensive list of valid field values with meanings. This goes well beyond the bare schema.

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 states a specific action ('Retrieves the ad creatives associated with a specific Facebook ad') and identifies the resource clearly. It does not explicitly distinguish itself from the sibling `get_ad_creative_by_id`, but the plural resource and ad_id scoping make the purpose clear.

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

Usage Guidelines4/5

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

The description clearly conveys the intended context: call this when you need creatives for a specific ad, and the examples show typical invocation patterns with fields and pagination. It does not explicitly say when not to use it or mention alternatives, but the context is unambiguous.

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