Skip to content

Commit 129de50

Browse files
committed
fix(google-ads): remove deprecated pageSize param, fix searchSettings nesting, add missing date ranges
1 parent 1b0fb52 commit 129de50

File tree

4 files changed

+12
-29
lines changed

4 files changed

+12
-29
lines changed

apps/docs/content/docs/en/tools/google_ads.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Run a custom Google Ads Query Language (GAQL) query
5454
| `developerToken` | string | Yes | Google Ads API developer token |
5555
| `managerCustomerId` | string | No | Manager account customer ID \(if accessing via manager account\) |
5656
| `query` | string | Yes | GAQL query to execute |
57-
| `pageSize` | number | No | Maximum number of results per page \(max 10000\) |
5857
| `pageToken` | string | No | Page token for pagination |
5958

6059
#### Output

apps/sim/blocks/blocks/google_ads.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,6 @@ Return ONLY the GAQL query - no explanations, no quotes, no extra text.`,
188188
required: { field: 'dateRange', value: 'CUSTOM' },
189189
},
190190

191-
{
192-
id: 'pageSize',
193-
title: 'Page Size',
194-
type: 'short-input',
195-
placeholder: 'Max results per page (default 10000)',
196-
mode: 'advanced',
197-
condition: { field: 'operation', value: 'search' },
198-
},
199-
200191
{
201192
id: 'pageToken',
202193
title: 'Page Token',
@@ -230,7 +221,7 @@ Return ONLY the GAQL query - no explanations, no quotes, no extra text.`,
230221
config: {
231222
tool: (params) => `google_ads_${params.operation}`,
232223
params: (params) => {
233-
const { oauthCredential, dateRange, pageSize, limit, ...rest } = params
224+
const { oauthCredential, dateRange, limit, ...rest } = params
234225

235226
const result: Record<string, unknown> = {
236227
...rest,
@@ -241,10 +232,6 @@ Return ONLY the GAQL query - no explanations, no quotes, no extra text.`,
241232
result.dateRange = dateRange
242233
}
243234

244-
if (pageSize !== undefined && pageSize !== '') {
245-
result.pageSize = Number(pageSize)
246-
}
247-
248235
if (limit !== undefined && limit !== '') {
249236
result.limit = Number(limit)
250237
}
@@ -266,7 +253,6 @@ Return ONLY the GAQL query - no explanations, no quotes, no extra text.`,
266253
dateRange: { type: 'string', description: 'Date range for performance queries' },
267254
startDate: { type: 'string', description: 'Custom start date (YYYY-MM-DD)' },
268255
endDate: { type: 'string', description: 'Custom end date (YYYY-MM-DD)' },
269-
pageSize: { type: 'number', description: 'Max results per page (max 10000)' },
270256
pageToken: { type: 'string', description: 'Pagination token' },
271257
limit: { type: 'number', description: 'Maximum results to return' },
272258
},

apps/sim/tools/google_ads/search.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ export const googleAdsSearchTool: ToolConfig<GoogleAdsSearchParams, GoogleAdsSea
4444
visibility: 'user-or-llm',
4545
description: 'GAQL query to execute',
4646
},
47-
pageSize: {
48-
type: 'number',
49-
required: false,
50-
visibility: 'user-or-llm',
51-
description: 'Maximum number of results per page (max 10000)',
52-
},
5347
pageToken: {
5448
type: 'string',
5549
required: false,
@@ -78,10 +72,9 @@ export const googleAdsSearchTool: ToolConfig<GoogleAdsSearchParams, GoogleAdsSea
7872
body: (params) => {
7973
const body: Record<string, unknown> = {
8074
query: params.query,
81-
returnTotalResultsCount: true,
82-
}
83-
if (params.pageSize) {
84-
body.pageSize = params.pageSize
75+
searchSettings: {
76+
returnTotalResultsCount: true,
77+
},
8578
}
8679
if (params.pageToken) {
8780
body.pageToken = params.pageToken

apps/sim/tools/google_ads/types.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ const NUMERIC_ID_REGEX = /^\d+$/
44
const DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/
55
const VALID_STATUSES = new Set(['ENABLED', 'PAUSED', 'REMOVED'])
66
const VALID_DATE_RANGES = new Set([
7+
'TODAY',
8+
'YESTERDAY',
79
'LAST_7_DAYS',
10+
'LAST_14_DAYS',
811
'LAST_30_DAYS',
12+
'LAST_BUSINESS_WEEK',
913
'THIS_MONTH',
1014
'LAST_MONTH',
11-
'TODAY',
12-
'YESTERDAY',
15+
'THIS_WEEK_SUN_TODAY',
16+
'THIS_WEEK_MON_TODAY',
17+
'LAST_WEEK_SUN_SAT',
18+
'LAST_WEEK_MON_SUN',
1319
])
1420

1521
/** Validates that a value is a numeric ID (digits only). */
@@ -61,7 +67,6 @@ export interface GoogleAdsListCustomersParams {
6167

6268
export interface GoogleAdsSearchParams extends GoogleAdsBaseParams {
6369
query: string
64-
pageSize?: number
6570
pageToken?: string
6671
}
6772

0 commit comments

Comments
 (0)