Skip to main content
Glama

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

NameRequiredDescriptionDefault
access_tokenNo
ad_idNo

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

  • 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)
  • 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
  • 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,
  • Listing of 'get_ad_details' in core/__init__.py __all__, exposing the tool at the core module level.
    '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