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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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',
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral disclosure. It mentions the access token is optional with caching behavior, which is useful, but doesn't describe authentication requirements, rate limits, error conditions, or what 'detailed information' includes. For a read operation with zero annotation coverage, this leaves significant gaps.

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 appropriately brief with a clear purpose statement followed by parameter explanations. The two-sentence structure is efficient, though the parameter section could be more integrated. Every sentence adds value without redundancy.

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

Completeness3/5

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

Given the tool has an output schema (which handles return values), 2 parameters with poor schema coverage, and no annotations, the description is moderately complete. It covers the basic purpose and parameters but lacks behavioral context and usage guidance. For a simple read operation with output schema, this is adequate but has clear gaps.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates well by explaining both parameters: 'ad_id' as 'Meta Ads ad ID' and 'access_token' with its optional nature and caching behavior. This adds meaningful context beyond the bare schema, though it doesn't specify format requirements (e.g., ad_id structure) or token scope.

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 clearly states the verb 'Get' and resource 'detailed information about a specific ad', making the purpose immediately understandable. It distinguishes from siblings like 'get_ads' (plural) by specifying retrieval of details for a single ad, though it doesn't explicitly contrast with similar tools like 'get_adset_details' or 'get_campaign_details'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'get_ads' for multiple ads, or how it differs from other detail-fetching tools like 'get_adset_details'. The only usage context is implicit in the parameter descriptions.

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

Install Server

Other Tools

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