Skip to main content
Glama
jmacaggi-gfm

ads-mcp-server

by jmacaggi-gfm

get_google_ads_report

Pull Google Ads performance data: account totals, campaign-type breakdown, top-50 ad rows with diagnosis, 56-day daily series, and WoW + 8-week DoW comparisons. Optionally include per-campaign settings for enabled campaigns.

Instructions

Pull Google Ads performance. Returns account totals, campaign-type breakdown, top-50 per-ad rows with diagnosis, 56-day daily series, and WoW + 8-week DoW comparisons. Set include_campaign_settings=True to also return per-campaign settings (target CPA, daily budget, diagnosis, utilization) for ENABLED campaigns only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_rangeYes
breakdownYes
include_campaign_settingsNoIf true, attach campaign_settings list to the response. Defaults to false to keep payload small.

Implementation Reference

  • The main handler function `get_google_ads_report_impl` that executes the tool logic. Validates inputs, fetches/loads Google Ads data (56-day performance, settings, changes), and builds the response via `aggregate.build_response`.
    def get_google_ads_report_impl(
        date_range: str, breakdown: str, include_campaign_settings: bool = False
    ) -> dict[str, Any]:
        if date_range not in VALID_RANGES:
            return error_response("google", f"Invalid date_range. Use one of {VALID_RANGES}")
        if breakdown not in ("account", "campaign_type", "ad"):
            return error_response("google", f"Invalid breakdown: {breakdown}")
        app = get_app_config()
        if not app.google.is_configured:
            return error_response(
                "google",
                "Missing Google Ads credentials",
                missing_keys=app.google.missing,
            )
        try:
            today = _today()
            df_56d, source = _ensure_google_56d(app)
            settings = cache.load_settings_cache("google", today)
            if settings is None:
                settings = google_ads.fetch_settings(app.google)
                cache.save_settings_cache("google", settings)
            settings = _settings_with_types(settings, google_classifier())
            changes = cache.load_changes_cache("google", today)
            if changes is None:
                changes = google_ads.fetch_changes(app.google, today)
                cache.save_changes_cache("google", changes)
            return aggregate.build_response(
                df_56d=df_56d,
                settings=settings,
                date_range=date_range,
                breakdown=breakdown,
                today=_today(),
                thresholds=app.thresholds,
                platform="google",
                fetched_at=_now_iso(),
                data_source=source,
                change_history=changes,
                include_campaign_settings=include_campaign_settings,
            )
        except Exception as e:
            log.exception("Google tool failed")
            return error_response("google", str(e))
  • Tool registration via MCP `Tool` object with name 'get_google_ads_report', description, and inputSchema (date_range, breakdown, include_campaign_settings).
    Tool(
        name="get_google_ads_report",
        description=(
            "Pull Google Ads performance. Returns account totals, "
            "campaign-type breakdown, top-50 per-ad rows with diagnosis, "
            "56-day daily series, and WoW + 8-week DoW comparisons. "
            "Set include_campaign_settings=True to also return per-campaign "
            "settings (target CPA, daily budget, diagnosis, utilization) "
            "for ENABLED campaigns only."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "date_range": {
                    "type": "string",
                    "enum": list(VALID_RANGES),
                },
                "breakdown": {
                    "type": "string",
                    "enum": ["account", "campaign_type", "ad"],
                },
                "include_campaign_settings": {
                    "type": "boolean",
                    "default": False,
                    "description": (
                        "If true, attach campaign_settings list to "
                        "the response. Defaults to false to keep "
                        "payload small."
                    ),
                },
            },
            "required": ["date_range", "breakdown"],
        },
    ),
  • Tool dispatch in `call_tool`: routes the name 'get_google_ads_report' to call `get_google_ads_report_impl` with parsed arguments.
    if name == "get_google_ads_report":
        result = get_google_ads_report_impl(
            arguments["date_range"],
            arguments["breakdown"],
            include_campaign_settings=bool(arguments.get("include_campaign_settings", False)),
        )
  • Input schema for the tool: defines date_range (enum), breakdown (enum: account/campaign_type/ad), and optional include_campaign_settings boolean.
    inputSchema={
        "type": "object",
        "properties": {
            "date_range": {
                "type": "string",
                "enum": list(VALID_RANGES),
            },
            "breakdown": {
                "type": "string",
                "enum": ["account", "campaign_type", "ad"],
            },
            "include_campaign_settings": {
                "type": "boolean",
                "default": False,
                "description": (
                    "If true, attach campaign_settings list to "
                    "the response. Defaults to false to keep "
                    "payload small."
                ),
            },
        },
        "required": ["date_range", "breakdown"],
    },
Behavior4/5

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

No annotations provided, but the description details return components and the conditional behavior of include_campaign_settings (only for ENABLED campaigns).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences, no fluff, front-loaded with purpose and outputs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Description covers essential behavioral and parameter details despite lack of output schema; minor gaps in rate limits or authentication info.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is low (33%), but the description adds meaning to parameters by linking them to return elements (e.g., 'campaign-type breakdown' for breakdown enum).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Pull Google Ads performance' and lists specific outputs, distinguishing it from siblings like get_meta_ads_report and get_campaign_settings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies its use for Google Ads performance but does not explicitly guide when to use this tool over siblings or provide exclusions.

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/jmacaggi-gfm/ads-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server