Skip to main content
Glama
EfrainTorres

ArmaVita Meta Ads MCP

create_campaign

Create Meta advertising campaigns with customizable budgeting, bidding strategies, and objective-based targeting for campaign management.

Instructions

Create a campaign with optional budgeting and bid controls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_account_idYes
nameYes
objectiveYes
meta_access_tokenNo
statusNoPAUSED
special_ad_categoriesNo
daily_budgetNo
lifetime_budgetNo
buying_typeNo
bid_strategyNo
bid_capNo
spend_capNo
campaign_budget_optimizationNo
ab_test_control_setupsNo
use_ad_set_level_budgetsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'create_campaign' function, decorated with @mcp_server.tool(), is the primary handler that executes the campaign creation logic via the Meta Graph API.
    async def create_campaign(
        ad_account_id: str,
        name: str,
        objective: str,
        meta_access_token: Optional[str] = None,
        status: str = "PAUSED",
        special_ad_categories: Optional[List[str]] = None,
        daily_budget: Optional[int] = None,
        lifetime_budget: Optional[int] = None,
        buying_type: Optional[str] = None,
        bid_strategy: Optional[str] = None,
        bid_cap: Optional[int] = None,
        spend_cap: Optional[int] = None,
        campaign_budget_optimization: Optional[bool] = None,
        ab_test_control_setups: Optional[List[Dict[str, Any]]] = None,
        use_ad_set_level_budgets: bool = False,
    ) -> str:
        """Create a campaign with optional budgeting and bid controls."""
        if not ad_account_id:
            return _json({"error": "No account ID provided"})
        if not name:
            return _json({"error": "No campaign name provided"})
        if not objective:
            return _json({"error": "No campaign objective provided"})
    
        categories, category_error = _normalize_special_ad_categories(special_ad_categories)
        if category_error:
            return _json({"error": category_error})
    
        bid_error = _validate_bid_strategy(bid_strategy)
        if bid_error:
            return _json(bid_error)
    
        auto_budget_applied = False
        if not use_ad_set_level_budgets and daily_budget is None and lifetime_budget is None:
            daily_budget = 1000
            auto_budget_applied = True
    
        payload: Dict[str, Any] = {
            "name": name,
            "objective": objective,
            "status": status,
            "special_ad_categories": json.dumps(categories),
        }
    
        if use_ad_set_level_budgets:
            payload["is_adset_budget_sharing_enabled"] = "false"
        else:
            if daily_budget is not None:
                payload["daily_budget"] = str(daily_budget)
            if lifetime_budget is not None:
                payload["lifetime_budget"] = str(lifetime_budget)
            if campaign_budget_optimization is not None:
                payload["campaign_budget_optimization"] = "true" if campaign_budget_optimization else "false"
    
        if buying_type is not None:
            payload["buying_type"] = buying_type
        if bid_strategy is not None:
            payload["bid_strategy"] = str(bid_strategy).strip().upper()
        if bid_cap is not None:
            payload["bid_cap"] = str(bid_cap)
        if spend_cap is not None:
            payload["spend_cap"] = str(spend_cap)
        if ab_test_control_setups:
            payload["ab_test_control_setups"] = ab_test_control_setups
    
        result = await make_api_request(f"{ad_account_id}/campaigns", meta_access_token, payload, method="POST")
    
        if isinstance(result, dict):
            if use_ad_set_level_budgets:
                result["budget_strategy"] = "ad_set_level"
                result["note"] = "Campaign created with ad set level budgets. Set budgets on child ad sets."
            elif auto_budget_applied:
                result["budget_default_applied"] = "daily_budget=1000"
                result["note"] = "No campaign budget provided, so MCP applied daily_budget=1000."
    
        return _json(result)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a creation tool (implying a write/mutation operation) but doesn't mention required permissions, rate limits, side effects, or what happens upon success/failure. The mention of 'optional budgeting and bid controls' hints at configuration options but lacks operational context.

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. It's appropriately sized for a basic tool description, though it could be more front-loaded with critical information given the complexity of the tool.

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 15-parameter mutation tool with no annotations and 0% schema description coverage, this description is inadequate. While an output schema exists (which helps with return values), the description fails to provide necessary context about the tool's behavior, parameter meanings, usage scenarios, or differentiation from sibling tools. It doesn't compensate for the lack of structured documentation.

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 all 15 parameters are undocumented in the schema. The description only mentions 'optional budgeting and bid controls', which covers perhaps 4-5 parameters at most (daily_budget, lifetime_budget, bid_strategy, bid_cap, spend_cap). It doesn't explain critical required parameters like ad_account_id, name, objective, or other important ones like status, special_ad_categories, or campaign_budget_optimization.

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 ('Create') and resource ('campaign'), and specifies optional budgeting and bid controls. However, it doesn't differentiate this from sibling tools like 'clone_campaign' or 'update_campaign', which would require explicit comparison.

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 about when to use this tool versus alternatives like 'clone_campaign' or 'update_campaign'. The description mentions optional budgeting and bid controls but doesn't explain prerequisites, constraints, or typical use cases for campaign creation.

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