Skip to main content
Glama
EfrainTorres

ArmaVita Meta Ads MCP

create_report

Generate performance reports for Meta Ads accounts and campaigns to analyze advertising metrics and insights locally.

Instructions

Generate OSS-local performance reports for Meta Ads accounts/campaigns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_account_idYes
meta_access_tokenNo
report_typeNoaccount
date_rangeNolast_30d
campaign_idsNo
export_formatNopdf
report_nameNo
include_sectionsNo
breakdownsNo
action_breakdownsNo
summary_action_breakdownsNo
comparison_periodNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'create_report' tool, which validates input parameters and initializes the report generation process.
    async def create_report(
        ad_account_id: str,
        meta_access_token: Optional[str] = None,
        report_type: str = "account",
        date_range: Union[str, Dict[str, str]] = "last_30d",
        campaign_ids: Optional[List[str]] = None,
        export_format: str = "pdf",
        report_name: Optional[str] = None,
        include_sections: Optional[List[str]] = None,
        breakdowns: Optional[List[str]] = None,
        action_breakdowns: Optional[List[str]] = None,
        summary_action_breakdowns: Optional[List[str]] = None,
        comparison_period: Optional[Union[str, Dict[str, str]]] = None,
    ) -> str:
        """Generate OSS-local performance reports for Meta Ads accounts/campaigns."""
        if not ad_account_id:
            return {
                "error": "invalid_parameters",
                "message": "ad_account_id is required",
                "details": {"required_parameter": "ad_account_id", "format": "act_XXXXXXXXX"},
            }
    
        normalized_type = str(report_type).strip().lower()
        normalized_export = str(export_format).strip().lower()
    
        if normalized_type not in {"account", "campaign", "comparison"}:
            return {
                "error": "invalid_parameters",
                "message": "report_type must be one of: account, campaign, comparison",
                "report_type": report_type,
            }
    
        if normalized_export not in {"json", "html", "pdf"}:
            return {
                "error": "invalid_parameters",
                "message": "export_format must be one of: json, html, pdf",
                "export_format": export_format,
            }
    
        if normalized_type in {"campaign", "comparison"} and not campaign_ids:
            return {
                "error": "invalid_parameters",
                "message": f"campaign_ids are required for {normalized_type} reports",
                "details": {"required_parameter": "campaign_ids"},
            }
    
        sections_requested = set(include_sections or [])
        if not sections_requested:
            sections_requested = {"summary", "kpis", "actions", "comparison"}
    
        generated_at = datetime.datetime.utcnow().replace(microsecond=0).isoformat() + "Z"
        report: Dict[str, Any] = {
            "success": True,
            "report_name": report_name or f"Meta Ads {normalized_type.title()} Report",
            "report_type": normalized_type,
            "generated_at": generated_at,
            "date_range": date_range,
            "breakdowns": breakdowns or [],
            "action_breakdowns": action_breakdowns or [],
            "summary_action_breakdowns": summary_action_breakdowns or [],
            "sections": {},
        }
    
        base_time_params, time_error, time_warnings = _resolve_time_params(date_range)
        if time_error:
            return {
                "error": "invalid_parameters",
                "message": time_error.get("message", "Invalid date range"),
                "details": time_error,
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 'Generate... reports' which implies a read-only operation, but doesn't disclose authentication needs (though 'meta_access_token' parameter hints at this), rate limits, whether it's synchronous/asynchronous, or what the output contains beyond 'reports'. More context on the tool's behavior is needed.

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 a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a tool name like 'create_report', though it could be more informative given the complexity.

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?

Given the tool's complexity (12 parameters, no annotations, 0% schema coverage) and the presence of an output schema, the description is inadequate. It doesn't explain parameter usage, behavioral traits, or how it differs from siblings. While the output schema might cover return values, the description lacks essential context for proper 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?

Schema description coverage is 0%, so the description must compensate but fails to do so. It doesn't explain any of the 12 parameters, such as what 'OSS-local' means, valid values for 'report_type' or 'export_format', or how 'date_range' should be formatted. The description adds no parameter semantics beyond what's inferred from parameter names.

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 ('Generate') and resource ('OSS-local performance reports for Meta Ads accounts/campaigns'), making the purpose understandable. However, it doesn't explicitly differentiate this reporting tool from other reporting-related tools like 'list_insights' or 'search_ads_archive', which might offer similar data in different formats.

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. The description doesn't mention prerequisites, such as needing a Meta Ads account, or compare it to other tools that might retrieve similar data (e.g., 'list_insights' for raw data vs. this for formatted reports).

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