gads_list_accessible_customers
Google Ads read low risk
Part of the Multi-Account Agent.
What it does
List the Google Ads accounts Claude can use, WITH NAMES and hierarchy: every account the user has turned ON for Claude in the Scalix dashboard - manager (MCC) accounts, their child accounts, and standalone accounts alike. Rows are {customer_id, name, is_manager, manager_id}; name comes from the connection's account discovery. A null name means Google returned none, as it does for an account that is not enabled (CUSTOMER_NOT_ENABLED) or that this login cannot read: such a row carries note:'not enabled or not readable' and a warning says so (gads_get_account_info on it says which). Exact-set contract: an enabled account ALWAYS appears regardless of its position in a manager hierarchy (an enabled child shows even when its MCC is toggled off), and an account turned OFF for Claude never appears as a row (a warning reports how many were hidden). This is the DISCOVERED set, not Google's raw direct-access list - children reachable only through an MCC are included. If an expected account is missing (e.g. just added under the MCC), call again with refresh=true to re-sync from Google; per-account ON/OFF selections are preserved across refreshes. Returns {success, data:[rows], count, warnings}. Use this first when no account context is known; call gads_get_account_info for currency/timezone details.
When to use it
When the user asks which customer accounts are accessible. First call of any session where the target account is unknown, or whenever the user asks what accounts are available. If the user names an account you cannot see, retry once with refresh=true before concluding it is unavailable.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | no | Optional filter: return only this account's row (dashes stripped) — e.g. to confirm one account is enabled for Claude. Omit to list every enabled account. |
manager_id | string | no | Accepted for backward compatibility; not used - manager children are already included in the listing. |
refresh | boolean | no | Default false (fast, serves the last synced set). Set true to re-run account discovery against Google right now - use when the user says an account is missing (e.g. newly added under their MCC). Per-account ON/OFF selections are preserved. An empty account list auto-refreshes once even without this flag. |
Safeguards
Policy
Returns only accounts the authenticated user is genuinely authorized for; the result set is bounded by the bearer token / tenant context - never merge, cache, or expose another tenant's accessible-customer list. Account IDs are tenant-scoped identifiers under strict per-account isolation (server-derived tenant context + Postgres RLS).
Reminder
Present accounts to the user BY NAME (the id in parentheses) - never as bare numbers. If an account the user mentions is not listed, it is either turned OFF in the Scalix dashboard (say so - the warning carries the hidden count) or not yet synced (offer refresh=true).
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
NOT_ADS_USER | AuthenticationError.NOT_ADS_USER - the Google account is not linked to any Google Ads account. | Tell the user to create/associate a Google Ads account at ads.google.com, then reconnect via OAuth; do not retry. | no |
TOKEN_REVOKED | The OAuth token is expired, invalid, or revoked (UNAUTHENTICATED / AuthenticationError.OAUTH_TOKEN_REVOKED). | Refresh once and retry; if still failing, prompt re-authorization (needs_reauth). | yes |
PERMISSION_DENIED | Developer token not approved or login lacks permission (AuthorizationError.DEVELOPER_TOKEN_NOT_APPROVED / USER_PERMISSION_DENIED). | If a developer-token issue, this is a server-config problem for the admin (Standard/Basic access); otherwise verify the login identity. Do not retry blindly. | no |
RESOURCE_EXHAUSTED | Daily-operations quota exceeded (QuotaError, HTTP 429). | If a daily cap, stop until reset; otherwise backoff 5/10/20s (cap 60s) honoring retryDelay, then retry. | yes |
RESOURCE_TEMPORARILY_EXHAUSTED | Per-second QPS rate limit hit (HTTP 429). | Backoff 5/10/20s (cap 60s), then retry; throttle concurrency. | yes |
PLATFORM_UNAVAILABLE | Google internal/transient error (HTTP 5xx, INTERNAL_ERROR/TRANSIENT_ERROR). | Retry with backoff; report transient Google-side issue if persistent. | yes |
Edge cases
- User has access but to zero accounts -> success:true, count:0, data:[] with a note to create or get invited to a Google Ads account.
- Only an MCC is directly accessible -> its child accounts are listed too (discovery walks every manager's tree), each with manager_id set.
- Returned ids are unhyphenated 10-digit strings; names are included, currency and timezone are not - get them with gads_get_account_info.
- Expired token -> refresh once and retry before surfacing needs_reauth.
- An account Google returned no name for (not enabled, e.g. CUSTOMER_NOT_ENABLED, or not readable by this login) is listed with name null and note 'not enabled or not readable'.