Skip to main content
Glama

get_adset_details

Retrieve comprehensive data about a Meta Ads ad set, including performance metrics and configuration details, to analyze campaign effectiveness and optimize advertising strategies.

Instructions

Get detailed information about a specific ad set.

Args:
    adset_id: Meta Ads ad set ID
    access_token: Meta API access token (optional - will use cached token if not provided)

Example:
    To call this function through MCP, pass the adset_id as the first argument:
    {
        "args": "YOUR_ADSET_ID"
    }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
adset_idYes
access_tokenNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the get_adset_details MCP tool. It is decorated with @mcp_server.tool() for registration and @meta_api_tool. Fetches detailed ad set information from the Meta Ads API using make_api_request, including special handling for frequency_control_specs and dsa_beneficiary fields.
    @mcp_server.tool()
    @meta_api_tool
    async def get_adset_details(adset_id: str, access_token: Optional[str] = None) -> str:
        """
        Get detailed information about a specific ad set.
        
        Args:
            adset_id: Meta Ads ad set ID
            access_token: Meta API access token (optional - will use cached token if not provided)
        
        Example:
            To call this function through MCP, pass the adset_id as the first argument:
            {
                "args": "YOUR_ADSET_ID"
            }
        """
        if not adset_id:
            return json.dumps({"error": "No ad set ID provided"}, indent=2)
        
        endpoint = f"{adset_id}"
        # Explicitly prioritize frequency_control_specs in the fields request
        params = {
            "fields": "id,name,campaign_id,status,frequency_control_specs{event,interval_days,max_frequency},daily_budget,lifetime_budget,targeting,bid_amount,bid_strategy,optimization_goal,billing_event,start_time,end_time,created_time,updated_time,attribution_spec,destination_type,promoted_object,pacing_type,budget_remaining,dsa_beneficiary,is_dynamic_creative"
        }
        
        data = await make_api_request(endpoint, access_token, params)
        
        # For debugging - check if frequency_control_specs was returned
        if 'frequency_control_specs' not in data:
            data['_meta'] = {
                'note': 'No frequency_control_specs field was returned by the API. This means either no frequency caps are set or the API did not include this field in the response.'
            }
        
        return json.dumps(data, indent=2)
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 insight. It mentions the access token is optional with caching behavior, which is useful, but doesn't cover permissions needed, 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 sized and front-loaded with the core purpose. The example section is helpful but could be more integrated; overall, it avoids unnecessary verbosity while maintaining clarity.

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), no annotations, and low schema coverage, the description is moderately complete. It covers the basic purpose and parameters but lacks usage context and detailed behavioral transparency, making it adequate but with clear room for improvement.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It explains that 'adset_id' is a 'Meta Ads ad set ID' and 'access_token' is optional with caching, adding meaningful context beyond the bare schema. However, it doesn't clarify format requirements (e.g., ID structure) or token sourcing, leaving some ambiguity.

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 set', making the purpose unambiguous. It distinguishes from siblings like 'get_adsets' (plural) by focusing on a single ad set, though it doesn't explicitly mention this differentiation in the text.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_adsets' or 'get_ad_details'. The description only explains how to call the function through MCP, not the appropriate context or prerequisites for its use.

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