Google Ads: Run Query
gads_queryRun a read-only Google Ads Query Language (GAQL) SELECT against the account and return the raw rows. Use this for reporting questions the typed tools do not cover — a breakdown by device and day of week, impression share lost to rank, month-over-month by network, ad approval status. Prefer the typed tools where one fits: gads_get_insights for standard performance, gads_list_campaigns, gads_list_ads, gads_list_keywords, gads_list_search_terms. This tool cannot change anything; every write has its own tool. Call gads_get_resource_metadata first when unsure which fields a resource has. Note the case difference: the query is written in snake_case (campaign.name, metrics.cost_micros) and the rows come back in camelCase (campaign.name, metrics.costMicros), because that is what the API returns. Money arrives in micros — divide by 1,000,000. A query with no LIMIT gets LIMIT 100, and LIMIT above 1000 is lowered to it. GAQL has no OR and no parentheses: use IN, REGEXP_MATCH, or separate queries. Campaign dates are campaign.start_date_time and campaign.end_date_time. change_event only reaches back 30 days and needs a LIMIT. Not every resource accepts segments.date — check gads_get_resource_metadata first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "gads_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The GAQL statement, e.g. "SELECT campaign.name, segments.device, metrics.cost_micros, metrics.conversions FROM campaign WHERE segments.date DURING LAST_30_DAYS ORDER BY metrics.cost_micros DESC". One SELECT, no semicolon. Date ranges use segments.date with DURING or BETWEEN. | |
| customer_id | No | Google Ads account to read: customer id or account name (from gads_list_ad_accounts). Pass it whenever the conversation is about a particular account; omitted, the only account or the stored default is used. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | One object per result row, nested exactly as the Google Ads REST API returns it (camelCase field paths). | |
| query | Yes | The query as actually sent, which differs from the one passed in when a LIMIT was added or lowered. | |
| rowCount | Yes | Number of rows returned. | |
| fieldMask | No | Google's own comma-separated list of the field paths present in the rows. | |
| truncated | Yes | True when the row cap was reached, so more rows match than were returned. | |
| customerId | Yes | Customer account the query ran against. |