create_campaign
Create advertising campaigns on PropellerAds by specifying ad format, target countries, budget, bid model, and landing page URL.
Instructions
Create a new advertising campaign with specified settings.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Campaign name | |
| ad_format | Yes | Ad format: push, onclick, interstitial, in-page-push | |
| countries | Yes | Target country codes (e.g., ['US', 'GB', 'DE']) | |
| daily_budget | Yes | Daily budget in USD | |
| total_budget | No | Total campaign budget in USD | |
| bid | Yes | Bid amount (CPC/CPM) | |
| bid_model | No | Bid model: cpc, cpm, smart_cpc, smart_cpm | |
| target_url | Yes | Landing page URL |
Implementation Reference
- src/propellerads_mcp/client.py:108-111 (handler)The actual API client method that makes the POST request to create a campaign.
def create_campaign(self, campaign_data: dict[str, Any]) -> dict[str, Any]: """Create a new campaign.""" result = self._request("POST", "/adv/campaigns", json_data=campaign_data) return result.get("data", result) if isinstance(result, dict) else result - src/propellerads_mcp/server.py:510-525 (handler)The tool handler function that parses arguments and calls the PropellerAdsClient to create a campaign.
elif name == "create_campaign": campaign_data = { "name": args["name"], "ad_format": args["ad_format"], "countries": args["countries"], "daily_budget": args["daily_budget"], "bid": args["bid"], "target_url": args["target_url"], } if args.get("total_budget"): campaign_data["total_budget"] = args["total_budget"] if args.get("bid_model"): campaign_data["bid_model"] = args["bid_model"] result = client.create_campaign(campaign_data) return f"Campaign created successfully!\n\n```json\n{json.dumps(result, indent=2)}\n```" - src/propellerads_mcp/server.py:111-144 (registration)The tool definition and schema registration for create_campaign.
Tool( name="create_campaign", description="Create a new advertising campaign with specified settings.", inputSchema={ "type": "object", "properties": { "name": {"type": "string", "description": "Campaign name"}, "ad_format": { "type": "string", "description": "Ad format: push, onclick, interstitial, in-page-push", }, "countries": { "type": "array", "items": {"type": "string"}, "description": "Target country codes (e.g., ['US', 'GB', 'DE'])", }, "daily_budget": { "type": "number", "description": "Daily budget in USD", }, "total_budget": { "type": "number", "description": "Total campaign budget in USD", }, "bid": {"type": "number", "description": "Bid amount (CPC/CPM)"}, "bid_model": { "type": "string", "description": "Bid model: cpc, cpm, smart_cpc, smart_cpm", }, "target_url": {"type": "string", "description": "Landing page URL"}, }, "required": ["name", "ad_format", "countries", "daily_budget", "bid", "target_url"], }, ),