Skip to main content
Glama
ZLeventer

google-ads-mcp

gads_ad_group_performance

Analyze ad group performance with campaign context. Filter by campaign ID, date range, or status. Default returns last 28 days of enabled ad groups.

Instructions

Ad group performance with campaign context. Optional campaign_id filter. Default last 28 days, enabled ad groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNoStart date: YYYY-MM-DD, NdaysAgo, yesterday, or today28daysAgo
end_dateNoEnd date: YYYY-MM-DD, NdaysAgo, yesterday, or todayyesterday
customer_idNoOverride GOOGLE_ADS_CUSTOMER_ID for this call
limitNoMax rows to return
campaign_idNoFilter to a specific campaign ID
statusNoENABLED

Implementation Reference

  • The main handler function that executes the 'gads_ad_group_performance' tool logic. It builds a GAQL query to fetch ad group performance data (impressions, clicks, CTR, avg CPC, cost, conversions, conversion value) filtered by date range, campaign ID, and status, with results ordered by cost descending.
    export async function adGroupPerformance(args: z.infer<z.ZodObject<typeof adGroupPerformanceSchema>>) {
      const customer = getCustomer(args.customer_id);
      const start = resolveDate(args.start_date);
      const end = resolveDate(args.end_date);
      const campaignClause = args.campaign_id ? `AND campaign.id = ${args.campaign_id}` : "";
      const statusClause = args.status === "ALL" ? "" : `AND ad_group.status = '${args.status}'`;
      const rows = await customer.query(`
        SELECT
          campaign.id,
          campaign.name,
          ad_group.id,
          ad_group.name,
          ad_group.status,
          metrics.impressions,
          metrics.clicks,
          metrics.ctr,
          metrics.average_cpc,
          metrics.cost_micros,
          metrics.conversions,
          metrics.conversions_value
        FROM ad_group
        WHERE segments.date BETWEEN '${start}' AND '${end}'
          ${campaignClause}
          ${statusClause}
        ORDER BY metrics.cost_micros DESC
        LIMIT ${args.limit}
      `);
      return { rowCount: rows.length, rows };
    }
  • Input schema (Zod-based) for the ad group performance tool. Includes dateRange fields (start_date, end_date, customer_id, limit), optional campaign_id filter, and status filter (defaults to ENABLED).
    export const adGroupPerformanceSchema = {
      ...dateRange,
      campaign_id: z.string().optional().describe("Filter to a specific campaign ID"),
      status: z.enum(["ENABLED", "PAUSED", "REMOVED", "ALL"]).default("ENABLED"),
    };
  • src/index.ts:94-99 (registration)
    Registration of the 'gads_ad_group_performance' tool with the MCP server. Maps the tool name to its schema (adGroupPerformanceSchema) and handler (adGroupPerformance function) with a description.
    server.tool(
      "gads_ad_group_performance",
      "Ad group performance with campaign context. Optional campaign_id filter. Default last 28 days, enabled ad groups.",
      adGroupPerformanceSchema,
      async (args) => { try { return ok(await adGroupPerformance(args)); } catch (e) { return err(e); } }
    );
  • The dateRange helper object reused by the ad group performance schema, defining start_date, end_date, customer_id, and limit fields with defaults.
    const dateRange = {
      start_date: z.string().default(DEFAULT_START).describe("Start date: YYYY-MM-DD, NdaysAgo, yesterday, or today"),
      end_date: z.string().default(DEFAULT_END).describe("End date: YYYY-MM-DD, NdaysAgo, yesterday, or today"),
      customer_id: z.string().optional().describe("Override GOOGLE_ADS_CUSTOMER_ID for this call"),
      limit: z.number().int().positive().max(10000).default(50).describe("Max rows to return"),
    };
  • Utility helper microsToDollars used to convert micro-amounts (used in the campaign performance handler but available in the same module).
    function microsToDollars(micros: number | string | undefined): number {
      const n = Number(micros ?? 0);
      return Number.isFinite(n) ? n / 1_000_000 : 0;
    }
Behavior3/5

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

Lacking annotations, the description carries the burden but only mentions defaults and optional filters. It does not disclose read-only nature, pagination, or any side effects, though it provides some behavioral hints.

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?

The description is a single focused sentence with no redundancy. Every word adds value, stating the core purpose, optional filter, and defaults.

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?

Given no output schema and no annotations, the description is too brief. It fails to explain return fields, metrics included, or how 'campaign context' is presented, which is essential for a performance report.

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

Parameters3/5

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

Schema has 83% coverage for 6 parameters; description adds little beyond summarizing defaults and the campaign_id filter. Baseline is appropriate as the schema already explains most parameters.

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 the tool returns 'Ad group performance with campaign context' and specifies optional filters and defaults. It distinguishes from siblings like 'gads_campaign_performance' by focusing on ad group level.

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?

The description does not explicitly guide when to use this tool versus alternatives. No when-to-use or when-not-to-use scenarios are mentioned, and no sibling differentiation is provided.

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/ZLeventer/google-ads-mcp'

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