get_campaign_settings
Retrieve current campaign settings and 56-day change history for Google Ads, Meta, or both platforms.
Instructions
Current campaign settings + 56-day change history per platform.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | Yes |
Implementation Reference
- src/ads_mcp_server/server.py:178-190 (handler)The `get_campaign_settings_impl` function is the handler for the 'get_campaign_settings' tool. It accepts a `platform` parameter (google|meta|both), delegates to `get_google_ads_report_impl` or `get_meta_ads_report_impl` with `include_campaign_settings=True`, and returns the campaign_settings sub-object for each platform.
def get_campaign_settings_impl(platform: str) -> dict[str, Any]: if platform not in ("google", "meta", "both"): return error_response(platform, "platform must be google|meta|both") out: dict[str, Any] = {"fetched_at": _now_iso()} if platform in ("google", "both"): out["google"] = get_google_ads_report_impl( "yesterday", "account", include_campaign_settings=True ).get("campaign_settings", []) if platform in ("meta", "both"): out["meta"] = get_meta_ads_report_impl("yesterday", "account").get( "campaign_settings", [] ) return out - src/ads_mcp_server/server.py:262-275 (registration)The tool is registered as an MCP Tool in the `list_tools` handler with name='get_campaign_settings', description about current campaign settings + change history, and an inputSchema requiring a 'platform' enum (google|meta|both).
Tool( name="get_campaign_settings", description="Current campaign settings + 56-day change history per platform.", inputSchema={ "type": "object", "properties": { "platform": { "type": "string", "enum": ["google", "meta", "both"], } }, "required": ["platform"], }, ), - src/ads_mcp_server/server.py:292-293 (registration)In the `call_tool` handler, when the tool name is 'get_campaign_settings', the function dispatches to `get_campaign_settings_impl` with the 'platform' argument from the request.
elif name == "get_campaign_settings": result = get_campaign_settings_impl(arguments["platform"]) - src/ads_mcp_server/schema.py:34-39 (schema)The `error_response` helper used by the handler to return error dicts when platform is invalid.
def error_response(platform: str, message: str, **extra: Any) -> dict[str, Any]: return { "error": message, "platform": platform, **extra, }