Skip to main content
Glama

get_adset_details

Retrieve comprehensive ad set details including targeting, optimization, learning stage, frequency caps, and attribution settings using an ad set ID.

Instructions

Get detailed ad set information including targeting, optimization, learning stage, frequency caps, and attribution settings.

Args: adset_id: Ad set ID (numeric string).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
adset_idYes

Implementation Reference

  • The main handler function for the 'get_adset_details' tool. Fetches detailed ad set info from Meta's Graph API including targeting, optimization, budget, learning stage, frequency caps, and attribution settings.
    @mcp.tool()
    def get_adset_details(adset_id: str) -> dict:
        """
        Get detailed ad set information including targeting, optimization,
        learning stage, frequency caps, and attribution settings.
    
        Args:
            adset_id: Ad set ID (numeric string).
        """
        api_client._ensure_initialized()
    
        try:
            result = api_client.graph_get(
                f"/{adset_id}",
                fields=ADSET_DETAIL_FIELDS,
            )
    
            # Enrich budget display
            if result.get("daily_budget"):
                result["daily_budget_display"] = format_budget_cents_to_currency(result["daily_budget"])
            if result.get("lifetime_budget"):
                result["lifetime_budget_display"] = format_budget_cents_to_currency(result["lifetime_budget"])
    
            # Get child ad count
            try:
                ads_result = api_client.graph_get(
                    f"/{adset_id}/ads",
                    fields=["id"],
                    params={"limit": "0"},
                )
                result["ad_count"] = len(ads_result.get("data", []))
            except MetaAPIError:
                result["ad_count"] = None
    
            result["rate_limit_usage_pct"] = api_client.rate_limits.max_usage_pct
            return result
    
        except MetaAPIError:
            raise
  • Schema definition for the detail fields requested from the Meta API when retrieving ad set details.
    ADSET_DETAIL_FIELDS = ADSET_LIST_FIELDS + [
        "targeting", "promoted_object",
        "budget_remaining", "bid_amount",
        "frequency_control_specs", "pacing_type",
        "destination_type", "attribution_spec",
        "learning_stage_info",
        "issues_info",
    ]
  • Registration of 'get_adset_details' as an MCP tool via the @mcp.tool() decorator.
    @mcp.tool()
    def get_adset_details(adset_id: str) -> dict:
  • Helper utility used by get_adset_details to format budget values (cents) into human-readable currency strings.
    def format_budget_cents_to_currency(cents: int | str, currency: str = "EUR") -> str:
        """Convert Meta API budget (in cents) to human-readable currency string."""
        value = int(cents) / 100
        return f"{currency} {value:.2f}"
Behavior3/5

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

The description indicates a read operation ('Get ... information') but does not disclose any additional behavioral traits such as required permissions, rate limits, or side effects. Without annotations, more detail would be beneficial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is very concise: two sentences plus an args line. No wasted words, information is front-loaded.

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

Completeness4/5

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

With no output schema, the description lists key output fields (targeting, optimization, etc.), giving a good sense of the return value. It could be more exhaustive, but it's largely complete for an agent to understand what to expect.

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 coverage is 0%, so the description adds some value by specifying 'Ad set ID (numeric string)' beyond the schema's bare type. However, it does not explain where to obtain the ID or format constraints fully.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it retrieves detailed ad set information and lists specific fields like targeting, optimization, etc. It distinguishes from sibling tools like get_adsets (list) and update_adset (mutation).

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

Usage Guidelines3/5

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

While the purpose is clear, there is no explicit guidance on when to use this tool vs. alternatives such as get_adsets or get_ad_details. Usage can be inferred but lacks explicit when/when-not context.

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/brandu-mos/konquest-meta-ads-mcp'

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