@digestseo/mcp-gsc 0.4.32 → 0.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/index.ts +40 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.33] - 2026-09-24
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- `analytics.query` responses now echo the ordered requested `dimensions` and `search_type`, so `rows[].keys` remain self-describing when responses are saved, forwarded, or consumed outside the original request context.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- `analytics.query` now rejects duplicate grouping dimensions and mixed `searchAppearance` grouping at MCP input validation, before local rate-limit, Google credential, or provider work.
|
|
17
|
+
|
|
10
18
|
## [0.4.32] - 2026-09-24
|
|
11
19
|
|
|
12
20
|
### Added
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -365,6 +365,24 @@ const SEARCH_ANALYTICS_OUTPUT_SCHEMA = {
|
|
|
365
365
|
row_count: z.number().int().nonnegative(),
|
|
366
366
|
start_row: z.number().int().nonnegative(),
|
|
367
367
|
rows: z.array(z.object(SEARCH_ROW_OUTPUT_SCHEMA)),
|
|
368
|
+
dimensions: z
|
|
369
|
+
.array(
|
|
370
|
+
z.enum([
|
|
371
|
+
'query',
|
|
372
|
+
'page',
|
|
373
|
+
'country',
|
|
374
|
+
'device',
|
|
375
|
+
'date',
|
|
376
|
+
'hour',
|
|
377
|
+
'searchAppearance',
|
|
378
|
+
]),
|
|
379
|
+
)
|
|
380
|
+
.describe(
|
|
381
|
+
'Ordered labels for rows[].keys. Each key position corresponds to the dimension at the same index. Empty for aggregate dimensions: [] queries.',
|
|
382
|
+
),
|
|
383
|
+
search_type: z
|
|
384
|
+
.enum(['web', 'image', 'video', 'news', 'discover', 'googleNews'])
|
|
385
|
+
.describe('The Search Analytics search type requested for this response.'),
|
|
368
386
|
data_state: z.enum(['all', 'final', 'hourly_all']).describe(
|
|
369
387
|
'The Search Analytics dataState requested from Google for this response.',
|
|
370
388
|
),
|
|
@@ -1188,10 +1206,13 @@ class GscMcpRuntime {
|
|
|
1188
1206
|
title: 'Query search analytics',
|
|
1189
1207
|
description: [
|
|
1190
1208
|
'Query Google Search Console search analytics data. Returns',
|
|
1191
|
-
'{ row_count, start_row, rows,
|
|
1192
|
-
' provider_note, has_more,
|
|
1209
|
+
'{ row_count, start_row, rows, dimensions, search_type,',
|
|
1210
|
+
' provider_exhaustiveness_guaranteed, provider_note, has_more,',
|
|
1211
|
+
' truncated, byte_limit_reached }',
|
|
1193
1212
|
'where dimensioned rows have keys plus clicks, impressions, ctr, and',
|
|
1194
|
-
'position.
|
|
1213
|
+
'position. The echoed dimensions array labels rows[].keys in order,',
|
|
1214
|
+
'so saved or forwarded responses remain self-describing. Aggregate',
|
|
1215
|
+
'rows from dimensions: [] may omit keys because',
|
|
1195
1216
|
'Google itself omits that field. When has_more is true, the response',
|
|
1196
1217
|
'includes next_start_row — pass it back as start_row to fetch the next',
|
|
1197
1218
|
'safe page. Large requested row_limit values are automatically split',
|
|
@@ -1292,6 +1313,20 @@ class GscMcpRuntime {
|
|
|
1292
1313
|
'searchAppearance',
|
|
1293
1314
|
]),
|
|
1294
1315
|
)
|
|
1316
|
+
.superRefine((dimensions, ctx) => {
|
|
1317
|
+
if (new Set(dimensions).size !== dimensions.length) {
|
|
1318
|
+
ctx.addIssue({
|
|
1319
|
+
code: 'custom',
|
|
1320
|
+
message: 'Search Analytics dimensions must not contain duplicates.',
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
if (dimensions.includes('searchAppearance') && dimensions.length > 1) {
|
|
1324
|
+
ctx.addIssue({
|
|
1325
|
+
code: 'custom',
|
|
1326
|
+
message: 'Search Analytics searchAppearance must be the only grouping dimension.',
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
})
|
|
1295
1330
|
.default(['query'])
|
|
1296
1331
|
.describe(
|
|
1297
1332
|
"Dimensions to group rows by. Pass [] (empty array) to get a single row of true site-level totals. searchAppearance must be the only grouping dimension; discover an appearance value with ['searchAppearance'], then filter to that value in a separate query when grouping by another dimension. The 'hour' dimension requires data_state 'hourly_all' and an inclusive date range of at most 10 days. Google Discover and Google News do not support the query dimension.",
|
|
@@ -1386,6 +1421,8 @@ class GscMcpRuntime {
|
|
|
1386
1421
|
row_count: bounded.items.length,
|
|
1387
1422
|
start_row,
|
|
1388
1423
|
rows: bounded.items,
|
|
1424
|
+
dimensions,
|
|
1425
|
+
search_type,
|
|
1389
1426
|
data_state,
|
|
1390
1427
|
preliminary_data_possible: data_state !== 'final',
|
|
1391
1428
|
position_supported:
|