Skip to main content
Glama

get_ad_details

Retrieve detailed information about a specific Meta ad by providing its ad ID, including performance data and creative details for analysis.

Instructions

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)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idYes
access_tokenNo

Implementation Reference

  • The primary handler implementation for the get_ad_details MCP tool. Decorated with @mcp_server.tool() for registration and @meta_api_tool for API handling. Fetches detailed ad information from Meta Ads API endpoint using specified fields.
    @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)
  • Import statement that brings get_ad_details function into the core package namespace, enabling its use and exposure.
    from .ads import get_ads, get_ad_details, get_ad_creatives, get_ad_image, update_ad
  • Inclusion of get_ad_details in __all__, explicitly exporting it from the core module.
    'get_ad_details',
  • Import of get_ad_details from core into top-level package namespace.
    get_ad_details,
  • Listing of get_ad_details in top-level __all__ for package export.
    'get_ad_details',

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/pipeboard-co/meta-ads-mcp'

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