Skip to main content
Glama
ZLeventer

google-ads-mcp

gads_list_campaigns

List Google Ads campaigns with name, status, channel type, bidding strategy, and date range. Filter by status (default ENABLED) and limit results.

Instructions

List campaigns in the account with name, status, channel type, bidding strategy, and date range. Filter by status (default ENABLED).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by campaign statusENABLED
customer_idNo
limitNo

Implementation Reference

  • src/index.ts:80-85 (registration)
    Registration of the gads_list_campaigns tool on the MCP server, linking the name to its schema and handler.
    server.tool(
      "gads_list_campaigns",
      "List campaigns in the account with name, status, channel type, bidding strategy, and date range. Filter by status (default ENABLED).",
      listCampaignsSchema,
      async (args) => { try { return ok(await listCampaigns(args)); } catch (e) { return err(e); } }
    );
  • Zod schema for listCampaigns: status filter (default ENABLED), optional customer_id override, and limit (default 100).
    export const listCampaignsSchema = {
      status: z.enum(["ENABLED", "PAUSED", "REMOVED", "ALL"]).default("ENABLED").describe("Filter by campaign status"),
      customer_id: z.string().optional(),
      limit: z.number().int().positive().max(10000).default(100),
    };
  • Handler that executes a GAQL query against the Google Ads API to list campaigns with their id, name, status, channel type, bidding strategy, and dates.
    export async function listCampaigns(args: z.infer<z.ZodObject<typeof listCampaignsSchema>>) {
      const customer = getCustomer(args.customer_id);
      const statusClause = args.status === "ALL" ? "" : `WHERE campaign.status = '${args.status}'`;
      const rows = await customer.query(`
        SELECT
          campaign.id,
          campaign.name,
          campaign.status,
          campaign.advertising_channel_type,
          campaign.advertising_channel_sub_type,
          campaign.bidding_strategy_type,
          campaign.start_date,
          campaign.end_date
        FROM campaign
        ${statusClause}
        ORDER BY campaign.name
        LIMIT ${args.limit}
      `);
      return { rowCount: rows.length, rows };
    }
  • getCustomer helper that initializes the Google Ads API client with credentials and returns a Customer instance used by the handler to run queries.
    export function getCustomer(override?: string): Customer {
      const refresh_token = process.env.GOOGLE_ADS_REFRESH_TOKEN;
      if (!refresh_token) throw new GoogleAdsError("GOOGLE_ADS_REFRESH_TOKEN is not set");
      const customer_id = (override ?? process.env.GOOGLE_ADS_CUSTOMER_ID ?? "").replace(/-/g, "");
      if (!customer_id) throw new GoogleAdsError("GOOGLE_ADS_CUSTOMER_ID is not set and no customer_id was passed");
      const login_customer_id = process.env.GOOGLE_ADS_LOGIN_CUSTOMER_ID?.replace(/-/g, "") || undefined;
      return getApi().Customer({ customer_id, login_customer_id, refresh_token });
    }
Behavior2/5

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

Without annotations, the description only states it lists campaigns with certain fields. It does not disclose pagination behavior, authentication needs, rate limits, or what happens when limit is exceeded.

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

Conciseness4/5

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

Two sentences with no fluff, but could be more efficient by omitting the date range mention if it's not a parameter.

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 annotations, output schema, and low parameter coverage, the description lacks information on return format, error handling, or precondition (e.g., account selection via customer_id).

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

Parameters2/5

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

Schema coverage is only 33% (status described). The description adds value for status (default ENABLED) but does not explain customer_id or limit, leaving significant gaps.

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 'List campaigns' with specific fields (name, status, channel type, bidding strategy, date range), effectively distinguishing it from sibling tools like gads_list_accounts or gads_list_assets.

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?

No explicit guidance on when to use this tool versus alternatives like gads_campaign_performance. The description implies filtering by status but does not compare with other campaign-related tools.

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