gogcli-mcp-contacts 2.23.1 → 2.23.2

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/dist/index.js CHANGED
@@ -31542,6 +31542,26 @@ function normalizeTimestamps(text, tz = displayTimeZone(), naiveTz = naiveSource
31542
31542
  return JSON.stringify(parsed, null, detectIndent(text));
31543
31543
  }
31544
31544
 
31545
+ // ../gogcli-mcp/src/pagination.ts
31546
+ function detectIndent2(text) {
31547
+ const match = /\n(\s+)\S/.exec(text);
31548
+ return match ? match[1].replace(/\t/g, " ").length : 0;
31549
+ }
31550
+ function stripConsumedPageToken(text) {
31551
+ const trimmed = text.trim();
31552
+ if (trimmed === "" || !trimmed.startsWith("{")) return text;
31553
+ let parsed;
31554
+ try {
31555
+ parsed = JSON.parse(trimmed);
31556
+ } catch {
31557
+ return text;
31558
+ }
31559
+ const obj = parsed;
31560
+ if (obj.nextPageToken !== "") return text;
31561
+ delete obj.nextPageToken;
31562
+ return JSON.stringify(obj, null, detectIndent2(text));
31563
+ }
31564
+
31545
31565
  // ../gogcli-mcp/src/tools/utils.ts
31546
31566
  var accountParam = external_exports.string().optional().describe(
31547
31567
  "Google account email to use, e.g. you@gmail.com \u2014 must be the full address, not a bare username. Overrides the GOG_ACCOUNT env var. Omit to use the single configured account."
@@ -31570,9 +31590,19 @@ var ids = {
31570
31590
  // People API uses fully-qualified resource names ("people/c123") not bare IDs.
31571
31591
  person: external_exports.string().describe("Person resource name (people/...) or email")
31572
31592
  };
31593
+ var pageTokenParam = external_exports.string().optional().describe(
31594
+ "Cursor for the NEXT page. Pass back the nextPageToken from a previous response verbatim, keeping the query and max identical: call once, then call again with pageToken=<that value>. A response with NO nextPageToken is the last page."
31595
+ );
31596
+ var pageAliasParam = external_exports.string().optional().describe(
31597
+ "Deprecated alias for pageToken, accepted so existing callers keep working. Use pageToken \u2014 it matches the nextPageToken field in the response."
31598
+ );
31599
+ function resolvePageToken(p) {
31600
+ return p.pageToken ?? p.page;
31601
+ }
31573
31602
  var paginationParams = {
31574
31603
  max: external_exports.number().int().optional().describe("Max results"),
31575
- page: external_exports.string().optional().describe("Page token"),
31604
+ pageToken: pageTokenParam,
31605
+ page: pageAliasParam,
31576
31606
  all: external_exports.boolean().optional().describe("Fetch all pages")
31577
31607
  };
31578
31608
  function registerRunTool(server, options) {
@@ -31647,7 +31677,7 @@ ${accounts || "(none)"}${hint}`);
31647
31677
  async function runOrDiagnose(args, options) {
31648
31678
  try {
31649
31679
  const raw = await run(args, options);
31650
- return rawTextResult(options.lossless ? raw : normalizeTimestamps(raw));
31680
+ return rawTextResult(options.lossless ? raw : stripConsumedPageToken(normalizeTimestamps(raw)));
31651
31681
  } catch (err) {
31652
31682
  return diagnose(err);
31653
31683
  }
@@ -31883,7 +31913,7 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
31883
31913
  );
31884
31914
 
31885
31915
  // ../gogcli-mcp/src/server.ts
31886
- var VERSION = true ? "2.23.1" : "0.0.0";
31916
+ var VERSION = true ? "2.23.2" : "0.0.0";
31887
31917
 
31888
31918
  // ../gogcli-mcp/src/auth-log.ts
31889
31919
  var FAILURES = /* @__PURE__ */ new Set([
@@ -32396,14 +32426,16 @@ function registerExtraContactsTools(server) {
32396
32426
  inputSchema: {
32397
32427
  query: external_exports.string().describe("Search query (name, email, etc.)"),
32398
32428
  max: external_exports.number().optional().describe("Max results (default: 50)"),
32399
- page: external_exports.string().optional().describe("Page token"),
32429
+ pageToken: pageTokenParam,
32430
+ page: pageAliasParam,
32400
32431
  all: external_exports.boolean().optional().describe("Fetch all pages"),
32401
32432
  account: accountParam
32402
32433
  }
32403
- }, async ({ query, max, page, all, account }) => {
32434
+ }, async ({ query, max, pageToken, page, all, account }) => {
32404
32435
  const args = ["people", "search", query];
32405
32436
  if (max !== void 0) args.push(`--max=${max}`);
32406
- if (page) args.push(`--page=${page}`);
32437
+ const token = resolvePageToken({ pageToken, page });
32438
+ if (token) args.push(`--page=${token}`);
32407
32439
  if (all) args.push("--all");
32408
32440
  return runOrDiagnose(args, { account });
32409
32441
  });
@@ -32472,17 +32504,19 @@ function registerExtraContactsTools(server) {
32472
32504
  all: external_exports.boolean().optional().describe("Export all personal contacts"),
32473
32505
  out: external_exports.string().optional().describe("Output path (.vcf), or - for stdout (default: stdout)"),
32474
32506
  max: external_exports.number().optional().describe("Max results for query (1-30)"),
32475
- page: external_exports.string().optional().describe("Start page token for all"),
32507
+ pageToken: pageTokenParam,
32508
+ page: pageAliasParam,
32476
32509
  account: accountParam
32477
32510
  }
32478
- }, async ({ selector, query, all, out, max, page, account }) => {
32511
+ }, async ({ selector, query, all, out, max, pageToken, page, account }) => {
32479
32512
  const args = ["contacts", "export"];
32480
32513
  if (selector) args.push(selector);
32481
32514
  if (query) args.push(`--query=${query}`);
32482
32515
  if (all) args.push("--all");
32483
32516
  if (out) args.push(`--out=${out}`);
32484
32517
  if (max !== void 0) args.push(`--max=${max}`);
32485
- if (page) args.push(`--page=${page}`);
32518
+ const token = resolvePageToken({ pageToken, page });
32519
+ if (token) args.push(`--page=${token}`);
32486
32520
  return runOrDiagnose(args, { account });
32487
32521
  });
32488
32522
  server.registerTool("gog_contacts_dedupe", {
@@ -32511,14 +32545,16 @@ function registerExtraContactsTools(server) {
32511
32545
  annotations: { readOnlyHint: true },
32512
32546
  inputSchema: {
32513
32547
  max: external_exports.number().optional().describe("Max results (default: 50)"),
32514
- page: external_exports.string().optional().describe("Page token"),
32548
+ pageToken: pageTokenParam,
32549
+ page: pageAliasParam,
32515
32550
  all: external_exports.boolean().optional().describe("Fetch all pages"),
32516
32551
  account: accountParam
32517
32552
  }
32518
- }, async ({ max, page, all, account }) => {
32553
+ }, async ({ max, pageToken, page, all, account }) => {
32519
32554
  const args = ["contacts", "directory", "list"];
32520
32555
  if (max !== void 0) args.push(`--max=${max}`);
32521
- if (page) args.push(`--page=${page}`);
32556
+ const token = resolvePageToken({ pageToken, page });
32557
+ if (token) args.push(`--page=${token}`);
32522
32558
  if (all) args.push("--all");
32523
32559
  return runOrDiagnose(args, { account });
32524
32560
  });
@@ -32527,14 +32563,16 @@ function registerExtraContactsTools(server) {
32527
32563
  annotations: { readOnlyHint: true },
32528
32564
  inputSchema: {
32529
32565
  max: external_exports.number().optional().describe("Max results (default: 100)"),
32530
- page: external_exports.string().optional().describe("Page token"),
32566
+ pageToken: pageTokenParam,
32567
+ page: pageAliasParam,
32531
32568
  all: external_exports.boolean().optional().describe("Fetch all pages"),
32532
32569
  account: accountParam
32533
32570
  }
32534
- }, async ({ max, page, all, account }) => {
32571
+ }, async ({ max, pageToken, page, all, account }) => {
32535
32572
  const args = ["contacts", "other", "list"];
32536
32573
  if (max !== void 0) args.push(`--max=${max}`);
32537
- if (page) args.push(`--page=${page}`);
32574
+ const token = resolvePageToken({ pageToken, page });
32575
+ if (token) args.push(`--page=${token}`);
32538
32576
  if (all) args.push("--all");
32539
32577
  return runOrDiagnose(args, { account });
32540
32578
  });
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "gogcli-mcp-contacts",
5
5
  "display_name": "gogcli (Contacts)",
6
- "version": "2.23.1",
6
+ "version": "2.23.2",
7
7
  "description": "Extended Google Contacts for Claude via gogcli — auth + Contacts + Workspace directory (People API)",
8
8
  "author": {
9
9
  "name": "Chris Hall",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-contacts",
3
- "version": "2.23.1",
3
+ "version": "2.23.2",
4
4
  "mcpName": "io.github.chrischall/gogcli-mcp-contacts",
5
5
  "description": "Extended Google Contacts + People MCP server via gogcli — auth + Contacts + Workspace directory (People API)",
6
6
  "author": "Claude Code (AI) <https://www.anthropic.com/claude>",
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import { accountParam, runOrDiagnose } from '../../../gogcli-mcp/src/lib.js';
3
+ import { accountParam, runOrDiagnose, pageTokenParam, pageAliasParam, resolvePageToken} from '../../../gogcli-mcp/src/lib.js';
4
4
 
5
5
  // People is the richer API behind Google Contacts: Workspace directory
6
6
  // search, profile fields, and relations.
@@ -32,14 +32,16 @@ export function registerExtraContactsTools(server: McpServer): void {
32
32
  inputSchema: {
33
33
  query: z.string().describe('Search query (name, email, etc.)'),
34
34
  max: z.number().optional().describe('Max results (default: 50)'),
35
- page: z.string().optional().describe('Page token'),
35
+ pageToken: pageTokenParam,
36
+ page: pageAliasParam,
36
37
  all: z.boolean().optional().describe('Fetch all pages'),
37
38
  account: accountParam,
38
39
  },
39
- }, async ({ query, max, page, all, account }) => {
40
+ }, async ({ query, max, pageToken, page, all, account }) => {
40
41
  const args = ['people', 'search', query];
41
42
  if (max !== undefined) args.push(`--max=${max}`);
42
- if (page) args.push(`--page=${page}`);
43
+ const token = resolvePageToken({ pageToken, page });
44
+ if (token) args.push(`--page=${token}`);
43
45
  if (all) args.push('--all');
44
46
  return runOrDiagnose(args, { account });
45
47
  });
@@ -112,17 +114,19 @@ export function registerExtraContactsTools(server: McpServer): void {
112
114
  all: z.boolean().optional().describe('Export all personal contacts'),
113
115
  out: z.string().optional().describe('Output path (.vcf), or - for stdout (default: stdout)'),
114
116
  max: z.number().optional().describe('Max results for query (1-30)'),
115
- page: z.string().optional().describe('Start page token for all'),
117
+ pageToken: pageTokenParam,
118
+ page: pageAliasParam,
116
119
  account: accountParam,
117
120
  },
118
- }, async ({ selector, query, all, out, max, page, account }) => {
121
+ }, async ({ selector, query, all, out, max, pageToken, page, account }) => {
119
122
  const args = ['contacts', 'export'];
120
123
  if (selector) args.push(selector);
121
124
  if (query) args.push(`--query=${query}`);
122
125
  if (all) args.push('--all');
123
126
  if (out) args.push(`--out=${out}`);
124
127
  if (max !== undefined) args.push(`--max=${max}`);
125
- if (page) args.push(`--page=${page}`);
128
+ const token = resolvePageToken({ pageToken, page });
129
+ if (token) args.push(`--page=${token}`);
126
130
  return runOrDiagnose(args, { account });
127
131
  });
128
132
 
@@ -153,14 +157,16 @@ export function registerExtraContactsTools(server: McpServer): void {
153
157
  annotations: { readOnlyHint: true },
154
158
  inputSchema: {
155
159
  max: z.number().optional().describe('Max results (default: 50)'),
156
- page: z.string().optional().describe('Page token'),
160
+ pageToken: pageTokenParam,
161
+ page: pageAliasParam,
157
162
  all: z.boolean().optional().describe('Fetch all pages'),
158
163
  account: accountParam,
159
164
  },
160
- }, async ({ max, page, all, account }) => {
165
+ }, async ({ max, pageToken, page, all, account }) => {
161
166
  const args = ['contacts', 'directory', 'list'];
162
167
  if (max !== undefined) args.push(`--max=${max}`);
163
- if (page) args.push(`--page=${page}`);
168
+ const token = resolvePageToken({ pageToken, page });
169
+ if (token) args.push(`--page=${token}`);
164
170
  if (all) args.push('--all');
165
171
  return runOrDiagnose(args, { account });
166
172
  });
@@ -170,14 +176,16 @@ export function registerExtraContactsTools(server: McpServer): void {
170
176
  annotations: { readOnlyHint: true },
171
177
  inputSchema: {
172
178
  max: z.number().optional().describe('Max results (default: 100)'),
173
- page: z.string().optional().describe('Page token'),
179
+ pageToken: pageTokenParam,
180
+ page: pageAliasParam,
174
181
  all: z.boolean().optional().describe('Fetch all pages'),
175
182
  account: accountParam,
176
183
  },
177
- }, async ({ max, page, all, account }) => {
184
+ }, async ({ max, pageToken, page, all, account }) => {
178
185
  const args = ['contacts', 'other', 'list'];
179
186
  if (max !== undefined) args.push(`--max=${max}`);
180
- if (page) args.push(`--page=${page}`);
187
+ const token = resolvePageToken({ pageToken, page });
188
+ if (token) args.push(`--page=${token}`);
181
189
  if (all) args.push('--all');
182
190
  return runOrDiagnose(args, { account });
183
191
  });