get_ad_creatives
Retrieve detailed creative information for Meta ads to analyze visual content, copy, and specifications. Use with get_ad_image for complete creative review.
Instructions
Get creative details for a specific ad. Best if combined with get_ad_image to get the full image.
Args:
ad_id: Meta Ads ad ID
access_token: Meta API access token (optional - will use cached token if not provided)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ad_id | Yes | ||
| access_token | No |
Implementation Reference
- meta_ads_mcp/core/ads.py:161-187 (handler)The core handler function implementing the get_ad_creatives tool. It queries the Meta Ads API endpoint /{ad_id}/adcreatives, processes the response by adding extracted image URLs using extract_creative_image_urls helper, and returns JSON. Decorated with @mcp_server.tool() for MCP registration and @meta_api_tool for shared API logic.@mcp_server.tool() @meta_api_tool async def get_ad_creatives(ad_id: str, access_token: Optional[str] = None) -> str: """ Get creative details for a specific ad. Best if combined with get_ad_image to get the full image. Args: ad_id: Meta Ads ad ID access_token: Meta API access token (optional - will use cached token if not provided) """ if not ad_id: return json.dumps({"error": "No ad ID provided"}, indent=2) endpoint = f"{ad_id}/adcreatives" params = { "fields": "id,name,status,thumbnail_url,image_url,image_hash,object_story_spec,asset_feed_spec,image_urls_for_viewing" } data = await make_api_request(endpoint, access_token, params) # Add image URLs for direct viewing if available if 'data' in data: for creative in data['data']: creative['image_urls_for_viewing'] = extract_creative_image_urls(creative) return json.dumps(data, indent=2)
- meta_ads_mcp/__init__.py:49-49 (registration)Package-level export/registration of get_ad_creatives function from core module, making it available at package top-level.get_ad_creatives,
- meta_ads_mcp/core/ads.py:182-186 (helper)Uses helper function extract_creative_image_urls from utils.py to enrich creative data with direct image viewing URLs.if 'data' in data: for creative in data['data']: creative['image_urls_for_viewing'] = extract_creative_image_urls(creative) return json.dumps(data, indent=2)