Skip to main content
Glama
ZLeventer

google-ads-mcp

gads_geo_performance

Analyze Google Ads performance by geographic location. Identify top and bottom performing countries, regions, and cities based on cost and conversions to optimize campaign targeting.

Instructions

Performance broken down by geographic location (country, region, city). Surfaces top and bottom geo segments by cost and conversions.

Input Schema

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

Implementation Reference

  • The main handler function for the 'gads_geo_performance' tool. Queries Google Ads geographic_view table for performance broken down by location (city, region, country). Accepts optional customer_id, start_date, end_date, campaign_id, and limit parameters.
    export async function geoPerformance(args: z.infer<z.ZodObject<typeof geoPerformanceSchema>>) {
      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 rows = await customer.query(`
        SELECT
          campaign.id,
          campaign.name,
          geographic_view.country_criterion_id,
          geographic_view.location_type,
          segments.geo_target_city,
          segments.geo_target_region,
          segments.geo_target_country,
          metrics.impressions,
          metrics.clicks,
          metrics.ctr,
          metrics.cost_micros,
          metrics.conversions,
          metrics.conversions_value
        FROM geographic_view
        WHERE segments.date BETWEEN '${start}' AND '${end}'
          ${campaignClause}
        ORDER BY metrics.cost_micros DESC
        LIMIT ${args.limit}
      `);
      return { rowCount: rows.length, rows };
    }
  • Zod schema for geoPerformance: defines input validation for customer_id, start_date, end_date, campaign_id (optional filter), and limit (default 100, max 10000).
    export const geoPerformanceSchema = {
      ...baseArgs,
      campaign_id: z.string().optional().describe("Filter to a specific campaign ID"),
      limit: z.number().int().positive().max(10000).default(100),
    };
  • src/index.ts:183-188 (registration)
    Registration of the 'gads_geo_performance' tool with the MCP server, including its description and wiring to the geoPerformance handler and geoPerformanceSchema.
    server.tool(
      "gads_geo_performance",
      "Performance broken down by geographic location (country, region, city). Surfaces top and bottom geo segments by cost and conversions.",
      geoPerformanceSchema,
      async (args) => { try { return ok(await geoPerformance(args)); } catch (e) { return err(e); } }
    );
  • Base schema arguments (customer_id, start_date, end_date) reused by geoPerformanceSchema via spread operator.
    const baseArgs = {
      customer_id: z.string().optional().describe("Override GOOGLE_ADS_CUSTOMER_ID for this call"),
      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"),
    };
Behavior2/5

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

No annotations provided, and the description lacks behavioral details such as data freshness, pagination behavior, sorting, or how top/bottom segments are determined. Minimal beyond schema.

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?

Two sentences, direct and clear. No unnecessary words. Front-loaded with essential purpose.

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?

With 5 parameters and no output schema, the description is too brief. Lacks details on output structure, interpretation of segments, and how limit affects results. Incomplete for a performance report tool.

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 description coverage is 80% (4 of 5 parameters described). Description adds context that output includes top/bottom segments by cost and conversions, which is not in schema. Baseline 3 with minor added value.

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?

Description clearly states it provides performance broken down by geographic location and mentions specific metrics (cost, conversions) and segments (top/bottom). This distinguishes it from sibling tools like device or campaign performance.

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?

Implied usage for geographic performance analysis, but no explicit guidance on when to use versus alternatives or when not to use. Does not mention limitations or prerequisites.

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