gads_list_conversion_actions
List all conversion actions configured in your Google Ads account, including name, category, type, conversion metric inclusion, and counting type, with optional status filter.
Instructions
List all conversion actions configured in the account: name, category, type, whether included in Conversions metric, counting type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer_id | No | ||
| status | No | ENABLED |
Implementation Reference
- src/index.ts:126-131 (registration)Registration of the 'gads_list_conversion_actions' tool with the MCP server, binding it to listConversionActionsSchema and the listConversionActions handler.
server.tool( "gads_list_conversion_actions", "List all conversion actions configured in the account: name, category, type, whether included in Conversions metric, counting type.", listConversionActionsSchema, async (args) => { try { return ok(await listConversionActions(args)); } catch (e) { return err(e); } } ); - src/tools/conversions.ts:33-36 (schema)Input schema for the tool: optional customer_id and optional status filter (ENABLED, REMOVED, HIDDEN, ALL) defaulting to ENABLED.
export const listConversionActionsSchema = { customer_id: z.string().optional(), status: z.enum(["ENABLED", "REMOVED", "HIDDEN", "ALL"]).default("ENABLED"), }; - src/tools/conversions.ts:38-56 (handler)Handler function that queries the Google Ads API for conversion actions, returning id, name, status, category, type, include_in_conversions_metric, counting_type, and primary_for_goal.
export async function listConversionActions(args: z.infer<z.ZodObject<typeof listConversionActionsSchema>>) { const customer = getCustomer(args.customer_id); const statusClause = args.status === "ALL" ? "" : `WHERE conversion_action.status = '${args.status}'`; const rows = await customer.query(` SELECT conversion_action.id, conversion_action.name, conversion_action.status, conversion_action.category, conversion_action.type, conversion_action.include_in_conversions_metric, conversion_action.counting_type, conversion_action.primary_for_goal FROM conversion_action ${statusClause} ORDER BY conversion_action.name `); return { rowCount: rows.length, rows }; } - src/client.ts:24-31 (helper)The getCustomer helper that resolves the Google Ads customer object used by the handler.
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 }); }