SCALIX help

← All tools

gads_list_ads

Google Ads read low risk

Part of the Google Ads Manager Agent.

What it does

List ads in an ad group, campaign, or account via GoogleAdsService.SearchStream over ad_group_ad, with optional filters (status, ad type, approval status) and optional performance metrics prior_period deltas via include_prior_period=true. Returns rows of ad_group_ad.ad.id, ad.type, status, policy_summary.approval_status, a creative summary (creative_summary: the first 3 headlines and first 2 descriptions with their counts, the long headline of a display ad, and the first final URL; the full assets come from gads_get_ad), and (when requested) impressions/clicks/ctr/cost_micros/conversions. Accuracy: cost is micros (/1e6, currency-labeled); segments multiply rows and must be summed; metrics reconcile to the UI within +/-1%; only ads visible to the account role are returned.

When to use it

When the user asks what ads exist or are running — across an ad group, a campaign, or the whole account — with status and approval.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped.
ad_group_idstringnoRestrict to one ad group.
campaign_idstringnoRestrict to one campaign.
status_filterstringnoAdGroupAdStatus filter ENABLED|PAUSED|REMOVED (enum-normalized). Omit or pass ALL for all statuses.
type_filterstringnoAdType filter (RESPONSIVE_SEARCH_AD, RESPONSIVE_DISPLAY_AD, ...). Enum-normalized.
approval_filterstringnoFilter on ad_group_ad.policy_summary.approval_status (APPROVED|DISAPPROVED|...).
include_metricsbooleannoAdd metrics.* over date_range + prior-period delta.
date_rangestringnoGAQL date macro or explicit range; used with include_metrics.
limitintegernoGAQL LIMIT; recommend ORDER BY metrics.cost_micros DESC when narrowing.
include_prior_periodbooleannoOpt-in: also run the equal-length preceding window and attach prior_period={date_range, metrics, delta_pct} to every row. Needs a translatable date_range (LAST_7/14/30_DAYS, TODAY, YESTERDAY, THIS_MONTH, LAST_MONTH, or explicit 'YYYY-MM-DD,YYYY-MM-DD'); untranslatable ranges skip with a warning.
manager_idstringnoOptional MCC login-customer-id.

Safeguards

Policy

Read-only; metrics must reconcile to the Google Ads UI within +/-1%. Report only the queried account's own ads; never pool creative across accounts.

Reminder

Per-account isolation (server-derived tenant context + RLS); do not retain or expose ad lists beyond this request.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDCustomer ID not found / unauthorized.Verify CID and authorization; re-auth if revoked.no
TOKEN_REVOKEDOAuth credential revoked/expired.Prompt reconnect (needs_reauth).no
INVALID_ARGUMENTGAQL filter rejected — surfacing Google's message.Surface exact error; fix filter, don't guess.no
PERMISSION_DENIEDScope/role does not permit reading this account.Confirm adwords scope and access; CID may be outside the bearer scope.no
RESOURCE_EXHAUSTEDRate/quota exceeded (429).Backoff 5->10->20s cap 60s; honor retryDelay.yes
PLATFORM_UNAVAILABLEGoogle Ads API 5xx.Retry after backoff.yes

Edge cases

  • No ads matching filters -> success:true, count:0, data:[].
  • Large result sets -> apply LIMIT + ORDER BY to narrow; tell the user it is capped, don't silently truncate.
  • include_metrics with segments multiplies rows — aggregate per ad for totals.
  • REMOVED ads excluded by default; include only when explicitly requested.
  • Creative summary fields vary by ad type — show the type-appropriate fields.
  • Expired token -> refresh once, retry.