Skip to main content
Glama
EfrainTorres

ArmaVita Meta Ads MCP

list_insights

Fetch performance insights for Meta Ads accounts, campaigns, ad sets, or ads to analyze metrics and optimize advertising strategies.

Instructions

Fetch insights for an account, campaign, ad set, or ad.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_idYes
meta_access_tokenNo
date_rangeNomaximum
breakdownNo
breakdownsNo
action_breakdownsNo
summary_action_breakdownsNo
levelNoad
page_sizeNo
page_cursorNo
action_attribution_windowsNo
compactNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The list_insights function serves as the primary handler for fetching insights from Meta Ads. It validates parameters, normalizes time and breakdown inputs, performs the API request, and formats the response.
    async def list_insights(
        object_id: str,
        meta_access_token: Optional[str] = None,
        date_range: Union[str, Dict[str, str]] = "maximum",
        breakdown: str = "",
        breakdowns: Optional[List[str]] = None,
        action_breakdowns: Optional[List[str]] = None,
        summary_action_breakdowns: Optional[List[str]] = None,
        level: str = "ad",
        page_size: int = 25,
        page_cursor: str = "",
        action_attribution_windows: Optional[List[str]] = None,
        compact: bool = False,
    ) -> str:
        """Fetch insights for an account, campaign, ad set, or ad."""
        if not str(object_id or "").strip():
            return json.dumps({"error": "No object ID provided"}, indent=2)
    
        params: Dict[str, Any] = {
            "fields": _DEFAULT_FIELDS,
            "level": level,
            "page_size": int(page_size),
        }
    
        time_params, time_error, normalization_warnings = normalize_time_input(date_range, default_preset="maximum")
        if time_error:
            return json.dumps(time_error, indent=2)
        params.update(time_params or {})
    
        breakdown_params, breakdown_warnings = normalize_breakdown_inputs(
            breakdown=breakdown,
            breakdowns=breakdowns,
            action_breakdowns=action_breakdowns,
            summary_action_breakdowns=summary_action_breakdowns,
        )
        params.update(breakdown_params)
        normalization_warnings.extend(breakdown_warnings)
    
        if page_cursor:
            params["page_cursor"] = page_cursor
    
        deprecated_windows = _deprecated_windows(action_attribution_windows)
        if action_attribution_windows:
            params["action_attribution_windows"] = list(action_attribution_windows)
    
        payload = await make_api_request(f"{object_id}/insights", meta_access_token, params)
    
        if isinstance(payload, dict):
            _append_warnings(payload, normalization_warnings)
            _with_warning(payload, deprecated_windows)
    
            if compact and isinstance(payload.get("data"), list):
                payload["data"] = [
                    _strip_redundant_actions(row) if isinstance(row, dict) else row
                    for row in payload["data"]
                ]
    
        return json.dumps(payload, indent=2)
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Fetch insights' implies a read operation, but it doesn't specify permissions needed, rate limits, pagination behavior (though page_size and page_cursor parameters exist), or what format the insights come in. The description is too vague about what 'insights' actually means in this context.

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?

The description is a single, efficient sentence with no wasted words. It's appropriately sized for what it communicates, though what it communicates is insufficient. The structure is front-loaded with the core action and target.

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

Completeness2/5

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

For a tool with 12 parameters, 0% schema description coverage, no annotations, and complex sibling relationships, the description is severely incomplete. While an output schema exists (which helps with return values), the description doesn't address parameter meanings, usage context, behavioral constraints, or differentiation from alternatives. It leaves too many questions unanswered for effective tool selection and invocation.

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

Parameters2/5

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

With 12 parameters and 0% schema description coverage, the description provides no information about any parameters. It doesn't explain what 'object_id' refers to, what 'date_range' options exist, what 'breakdown' means, or how any parameters interact. The description fails to compensate for the complete lack of parameter documentation in the schema.

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 action ('Fetch insights') and the target resources ('for an account, campaign, ad set, or ad'), making the purpose understandable. However, it doesn't distinguish this tool from other list/search tools on the server (like list_ads, list_campaigns, etc.), which would require explicit differentiation to earn a 5.

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. With many sibling tools available (e.g., list_ads, list_campaigns, search_ads_archive), there's no indication of when insights fetching is preferred over other listing operations or what specific insights it provides that other tools don't.

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/EfrainTorres/armavita-meta-ads-mcp'

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