get_ad_details
Retrieve comprehensive details about a Meta Ads campaign using its ad ID. This tool integrates with the Meta Ads MCP server to provide specific ad information for analysis and management.
Instructions
Get detailed information about a specific ad.
Args:
access_token: Meta API access token (optional - will use cached token if not provided)
ad_id: Meta Ads ad ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_token | No | ||
| ad_id | No |
Input Schema (JSON Schema)
{
"properties": {
"access_token": {
"default": null,
"title": "Access Token",
"type": "string"
},
"ad_id": {
"default": null,
"title": "Ad Id",
"type": "string"
}
},
"title": "get_ad_detailsArguments",
"type": "object"
}
Implementation Reference
- meta_ads_mcp/core/ads.py:66-86 (handler)The primary handler function for the 'get_ad_details' tool. It retrieves detailed information about a specific Meta ad using the API, decorated with @mcp_server.tool() for MCP registration and @meta_api_tool for API handling.@mcp_server.tool() @meta_api_tool async def get_ad_details(ad_id: str, access_token: Optional[str] = None) -> str: """ Get detailed information about a specific ad. 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}" params = { "fields": "id,name,adset_id,campaign_id,status,creative,created_time,updated_time,bid_amount,conversion_domain,tracking_specs,preview_shareable_link" } data = await make_api_request(endpoint, access_token, params) return json.dumps(data, indent=2)
- meta_ads_mcp/core/__init__.py:7-7 (registration)Import statement in core/__init__.py that brings get_ad_details into the core namespace, enabling its exposure and use in the MCP server.from .ads import get_ads, get_ad_details, get_ad_creatives, get_ad_image, update_ad
- meta_ads_mcp/__init__.py:48-48 (registration)Inclusion of get_ad_details in the top-level __all__ list and direct import from .core, registering it for package-level access.get_ad_details,
- meta_ads_mcp/core/__init__.py:30-30 (registration)Listing of 'get_ad_details' in core/__init__.py __all__, exposing the tool at the core module level.'get_ad_details',