Skip to main content
Glama
EfrainTorres

ArmaVita Meta Ads MCP

create_campaign_budget_schedule

Set a time-based budget schedule for Meta ad campaigns by specifying start and end times with budget amounts to control spending periods.

Instructions

Create a high-demand budget schedule for a campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYes
budget_valueYes
budget_value_typeYes
time_startYes
time_endYes
meta_access_tokenNo

Implementation Reference

  • The handler function `create_campaign_budget_schedule` which implements the creation logic for a budget schedule, registered as an MCP tool.
    @mcp_server.tool()
    @meta_api_tool
    async def create_campaign_budget_schedule(
        campaign_id: str,
        budget_value: int,
        budget_value_type: str,
        time_start: int,
        time_end: int,
        meta_access_token: Optional[str] = None,
    ) -> str:
        """Create a high-demand budget schedule for a campaign."""
        if not campaign_id:
            return json.dumps({"error": "Campaign ID is required"}, indent=2)
        if budget_value is None:
            return json.dumps({"error": "Budget value is required"}, indent=2)
        if time_start is None or time_end is None:
            return json.dumps({"error": "time_start and time_end are required"}, indent=2)
    
        normalized_type = str(budget_value_type or "").upper().strip()
        if normalized_type not in _ALLOWED_BUDGET_VALUE_TYPES:
            return json.dumps(
                {
                    "error": "Invalid budget_value_type",
                    "details": "budget_value_type must be ABSOLUTE or MULTIPLIER",
                },
                indent=2,
            )
    
        payload = {
            "budget_value": budget_value,
            "budget_value_type": normalized_type,
            "time_start": time_start,
            "time_end": time_end,
        }
    
        result = await make_api_request(f"{campaign_id}/budget_schedules", meta_access_token, payload, method="POST")
        return json.dumps(result, indent=2)

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