Skip to main content
Glama
ZLeventer

google-ads-mcp

gads_device_performance

Analyze Google Ads performance across mobile, desktop, and tablet devices. Get clicks, cost, CTR, conversions, and CPA split per campaign for any date range.

Instructions

Clicks, cost, CTR, conversions, and CPA split by MOBILE / DESKTOP / TABLET per campaign. Default last 28 days.

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

Implementation Reference

  • The main handler function that executes the device performance logic. It queries Google Ads API for clicks, cost, CTR, conversions, and CPA split by MOBILE/DESKTOP/TABLET per campaign, using the provided customer_id, date range, and optional campaign filter.
    export async function devicePerformance(args: z.infer<z.ZodObject<typeof devicePerformanceSchema>>) {
      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,
          segments.device,
          metrics.impressions,
          metrics.clicks,
          metrics.ctr,
          metrics.cost_micros,
          metrics.conversions,
          metrics.conversions_value,
          metrics.cost_per_conversion
        FROM campaign
        WHERE segments.date BETWEEN '${start}' AND '${end}'
          ${campaignClause}
        ORDER BY campaign.name, segments.device
        LIMIT 500
      `);
      return { rowCount: rows.length, rows };
    }
  • Zod schema for the tool's input parameters: customer_id (optional), start_date (default last 28 days), end_date (default today), and optional campaign_id filter.
    export const devicePerformanceSchema = {
      ...baseArgs,
      campaign_id: z.string().optional().describe("Filter to a specific campaign ID"),
    };
  • src/index.ts:190-195 (registration)
    Registers 'gads_device_performance' as a tool on the MCP server with its description, schema, and handler.
    server.tool(
      "gads_device_performance",
      "Clicks, cost, CTR, conversions, and CPA split by MOBILE / DESKTOP / TABLET per campaign. Default last 28 days.",
      devicePerformanceSchema,
      async (args) => { try { return ok(await devicePerformance(args)); } catch (e) { return err(e); } }
    );
  • Base argument schema reused by devicePerformanceSchema, defining customer_id, start_date, and end_date.
    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"),
    };
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the default 28-day lookback, which is a behavioral trait. However, it does not mention read-only nature, data freshness, pagination, or other behaviors, which would be beneficial.

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 extremely concise with two short sentences, front-loading the key output dimensions. Every word adds value; no redundancy.

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?

Given the tool's simplicity, the description covers the main aspects: metrics, breakdown, and default period. It lacks details on output format or usage notes, but these are somewhat implied. The absence of an output schema slightly reduces completeness.

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 coverage is 100% with parameter descriptions. The tool description adds no additional meaning beyond the schema, so a baseline score of 3 is appropriate.

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 specific metrics (clicks, cost, CTR, conversions, CPA) broken down by device type (MOBILE/DESKTOP/TABLET) per campaign, with a default time range. This distinguishes it from siblings like gads_campaign_performance or gads_keyword_performance.

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

Usage Guidelines4/5

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

The description implies usage for device-level campaign performance analysis, but does not explicitly state when to use this tool over alternatives or provide exclusion criteria. The default period is mentioned, offering some context.

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