gogcli-mcp-calendar 2.23.0 → 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,55 @@ 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
+ function truncationWarning(returned, count) {
31565
+ const scope = count.total !== void 0 ? `returned ${returned} of ${count.total} matches` : count.atLeast !== void 0 ? `returned ${returned} of at least ${count.atLeast} matches` : `returned ${returned} matches and MORE EXIST beyond this page`;
31566
+ return `INCOMPLETE RESULT SET: ${scope}. Do not report an absence of results based on this response. Page with nextPageToken or narrow the query.`;
31567
+ }
31568
+ function annotateTruncation(out, returned, count) {
31569
+ out.truncated = true;
31570
+ out.returned = returned;
31571
+ if (count.total !== void 0) out.totalMatches = count.total;
31572
+ if (count.atLeast !== void 0) out.totalMatchesAtLeast = count.atLeast;
31573
+ out.warning = truncationWarning(returned, count);
31574
+ }
31575
+ function hasMorePages(parsed) {
31576
+ return typeof parsed.nextPageToken === "string" && parsed.nextPageToken !== "";
31577
+ }
31578
+ function annotateTruncatedList(result, itemsKey) {
31579
+ const first = result.content[0];
31580
+ if (result.isError || first?.type !== "text") return result;
31581
+ let parsed;
31582
+ try {
31583
+ parsed = JSON.parse(first.text);
31584
+ } catch {
31585
+ return result;
31586
+ }
31587
+ const items = parsed[itemsKey];
31588
+ if (!Array.isArray(items) || !hasMorePages(parsed)) return result;
31589
+ const out = { ...parsed };
31590
+ annotateTruncation(out, items.length, {});
31591
+ return rawTextResult(JSON.stringify(out));
31592
+ }
31593
+
31545
31594
  // ../gogcli-mcp/src/tools/utils.ts
31546
31595
  var accountParam = external_exports.string().optional().describe(
31547
31596
  "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 +31619,19 @@ var ids = {
31570
31619
  // People API uses fully-qualified resource names ("people/c123") not bare IDs.
31571
31620
  person: external_exports.string().describe("Person resource name (people/...) or email")
31572
31621
  };
31622
+ var pageTokenParam = external_exports.string().optional().describe(
31623
+ "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."
31624
+ );
31625
+ var pageAliasParam = external_exports.string().optional().describe(
31626
+ "Deprecated alias for pageToken, accepted so existing callers keep working. Use pageToken \u2014 it matches the nextPageToken field in the response."
31627
+ );
31628
+ function resolvePageToken(p) {
31629
+ return p.pageToken ?? p.page;
31630
+ }
31573
31631
  var paginationParams = {
31574
31632
  max: external_exports.number().int().optional().describe("Max results"),
31575
- page: external_exports.string().optional().describe("Page token"),
31633
+ pageToken: pageTokenParam,
31634
+ page: pageAliasParam,
31576
31635
  all: external_exports.boolean().optional().describe("Fetch all pages")
31577
31636
  };
31578
31637
  function registerRunTool(server, options) {
@@ -31647,7 +31706,7 @@ ${accounts || "(none)"}${hint}`);
31647
31706
  async function runOrDiagnose(args, options) {
31648
31707
  try {
31649
31708
  const raw = await run(args, options);
31650
- return rawTextResult(options.lossless ? raw : normalizeTimestamps(raw));
31709
+ return rawTextResult(options.lossless ? raw : stripConsumedPageToken(normalizeTimestamps(raw)));
31651
31710
  } catch (err) {
31652
31711
  return diagnose(err);
31653
31712
  }
@@ -31821,7 +31880,7 @@ function authToolsFor(defaultServices) {
31821
31880
  // ../gogcli-mcp/src/tools/calendar.ts
31822
31881
  function registerCalendarTools(server) {
31823
31882
  server.registerTool("gog_calendar_events", {
31824
- description: "List calendar events. Filters can be combined (e.g. --from + --to for a range, or --today for just today).",
31883
+ description: 'List calendar events. Filters can be combined (e.g. --from + --to for a range, or --today for just today). gog returns only 10 events by default, so a wide date range is USUALLY INCOMPLETE: raise max, or page with pageToken until the response carries no nextPageToken. A response carrying "truncated": true is an incomplete view \u2014 never conclude an event does not exist from one.',
31825
31884
  annotations: { readOnlyHint: true },
31826
31885
  inputSchema: {
31827
31886
  calendarId: external_exports.string().optional().describe("Calendar ID (default: primary calendar)"),
@@ -31829,22 +31888,29 @@ function registerCalendarTools(server) {
31829
31888
  to: external_exports.string().optional().describe("End time filter (RFC3339, date, or natural language)"),
31830
31889
  today: external_exports.boolean().optional().describe("Only show today's events"),
31831
31890
  query: external_exports.string().optional().describe("Free text search within events"),
31832
- all: external_exports.boolean().optional().describe("Fetch events from all calendars"),
31891
+ max: external_exports.number().int().optional().describe("Max events to return. gog defaults to 10, which silently hides the rest \u2014 raise it, or page with pageToken."),
31892
+ pageToken: pageTokenParam,
31893
+ page: pageAliasParam,
31894
+ all: external_exports.boolean().optional().describe('Fetch events from ALL CALENDARS. NOTE: unlike the gmail search tools, this does NOT mean "all pages" \u2014 it widens the calendar set, not the page window. Use pageToken to reach later pages.'),
31833
31895
  eventTypes: external_exports.array(external_exports.enum(["default", "birthday", "focus-time", "from-gmail", "out-of-office", "working-location"])).optional().describe("Filter to specific event types (repeatable)"),
31834
31896
  timezone: external_exports.string().optional().describe(`Display timezone for event times (IANA name, e.g. America/New_York, or "local" for the system timezone). Default: each event's timezone, then its calendar's timezone.`),
31835
31897
  account: accountParam
31836
31898
  }
31837
- }, async ({ calendarId, from, to, today, query, all, eventTypes, timezone, account }) => {
31899
+ }, async ({ calendarId, from, to, today, query, max, pageToken, page, all, eventTypes, timezone, account }) => {
31838
31900
  const args = ["calendar", "events"];
31839
31901
  if (calendarId) args.push(calendarId);
31840
31902
  if (from) args.push(`--from=${from}`);
31841
31903
  if (to) args.push(`--to=${to}`);
31842
31904
  if (today) args.push("--today");
31843
31905
  if (query) args.push(`--query=${query}`);
31906
+ if (max !== void 0) args.push(`--max=${max}`);
31907
+ const token = resolvePageToken({ pageToken, page });
31908
+ if (token) args.push(`--page=${token}`);
31844
31909
  if (all) args.push("--all");
31845
31910
  if (eventTypes) for (const t of eventTypes) args.push(`--event-types=${t}`);
31846
31911
  if (timezone) args.push(`--timezone=${timezone}`);
31847
- return runOrDiagnose(args, { account });
31912
+ const result = await runOrDiagnose(args, { account });
31913
+ return annotateTruncatedList(result, "events");
31848
31914
  });
31849
31915
  server.registerTool("gog_calendar_get", {
31850
31916
  description: "Get a specific calendar event by ID.",
@@ -31961,7 +32027,7 @@ var failIfNotEmptyParam = external_exports.boolean().optional().describe(
31961
32027
  );
31962
32028
 
31963
32029
  // ../gogcli-mcp/src/server.ts
31964
- var VERSION = true ? "2.23.0" : "0.0.0";
32030
+ var VERSION = true ? "2.23.2" : "0.0.0";
31965
32031
 
31966
32032
  // ../gogcli-mcp/src/auth-log.ts
31967
32033
  var FAILURES = /* @__PURE__ */ new Set([
@@ -32502,14 +32568,16 @@ function registerExtraCalendarTools(server) {
32502
32568
  inputSchema: {
32503
32569
  meetingCode: external_exports.string().describe("Meeting code"),
32504
32570
  max: external_exports.number().optional().describe("Max results (default: 20)"),
32505
- page: external_exports.string().optional().describe("Page token"),
32571
+ pageToken: pageTokenParam,
32572
+ page: pageAliasParam,
32506
32573
  all: external_exports.boolean().optional().describe("Fetch all pages"),
32507
32574
  account: accountParam
32508
32575
  }
32509
- }, async ({ meetingCode, max, page, all, account }) => {
32576
+ }, async ({ meetingCode, max, pageToken, page, all, account }) => {
32510
32577
  const args = ["meet", "history", meetingCode];
32511
32578
  if (max !== void 0) args.push(`--max=${max}`);
32512
- if (page) args.push(`--page=${page}`);
32579
+ const token = resolvePageToken({ pageToken, page });
32580
+ if (token) args.push(`--page=${token}`);
32513
32581
  if (all) args.push("--all");
32514
32582
  return runOrDiagnose(args, { account });
32515
32583
  });
@@ -32548,14 +32616,16 @@ function registerExtraCalendarTools(server) {
32548
32616
  annotations: { readOnlyHint: true },
32549
32617
  inputSchema: {
32550
32618
  max: external_exports.number().optional().describe("Max results (default: 100)"),
32551
- page: external_exports.string().optional().describe("Page token"),
32619
+ pageToken: pageTokenParam,
32620
+ page: pageAliasParam,
32552
32621
  all: external_exports.boolean().optional().describe("Fetch all pages"),
32553
32622
  account: accountParam
32554
32623
  }
32555
- }, async ({ max, page, all, account }) => {
32624
+ }, async ({ max, pageToken, page, all, account }) => {
32556
32625
  const args = ["calendar", "calendars"];
32557
32626
  if (max !== void 0) args.push(`--max=${max}`);
32558
- if (page) args.push(`--page=${page}`);
32627
+ const token = resolvePageToken({ pageToken, page });
32628
+ if (token) args.push(`--page=${token}`);
32559
32629
  if (all) args.push("--all");
32560
32630
  return runOrDiagnose(args, { account });
32561
32631
  });
@@ -32641,14 +32711,16 @@ function registerExtraCalendarTools(server) {
32641
32711
  inputSchema: {
32642
32712
  calendarId: external_exports.string().describe("Calendar ID"),
32643
32713
  max: external_exports.number().optional().describe("Max results (default: 100)"),
32644
- page: external_exports.string().optional().describe("Page token"),
32714
+ pageToken: pageTokenParam,
32715
+ page: pageAliasParam,
32645
32716
  all: external_exports.boolean().optional().describe("Fetch all pages"),
32646
32717
  account: accountParam
32647
32718
  }
32648
- }, async ({ calendarId, max, page, all, account }) => {
32719
+ }, async ({ calendarId, max, pageToken, page, all, account }) => {
32649
32720
  const args = ["calendar", "acl", calendarId];
32650
32721
  if (max !== void 0) args.push(`--max=${max}`);
32651
- if (page) args.push(`--page=${page}`);
32722
+ const token = resolvePageToken({ pageToken, page });
32723
+ if (token) args.push(`--page=${token}`);
32652
32724
  if (all) args.push("--all");
32653
32725
  return runOrDiagnose(args, { account });
32654
32726
  });
@@ -32716,15 +32788,17 @@ function registerExtraCalendarTools(server) {
32716
32788
  meetingCode: external_exports.string().describe("Meeting code"),
32717
32789
  conference: external_exports.string().optional().describe("Specific conference ID (default: most recent)"),
32718
32790
  max: external_exports.number().optional().describe("Max results (default: 50)"),
32719
- page: external_exports.string().optional().describe("Page token"),
32791
+ pageToken: pageTokenParam,
32792
+ page: pageAliasParam,
32720
32793
  all: external_exports.boolean().optional().describe("Fetch all pages"),
32721
32794
  account: accountParam
32722
32795
  }
32723
- }, async ({ meetingCode, conference, max, page, all, account }) => {
32796
+ }, async ({ meetingCode, conference, max, pageToken, page, all, account }) => {
32724
32797
  const args = ["meet", "participants", meetingCode];
32725
32798
  if (conference) args.push(`--conference=${conference}`);
32726
32799
  if (max !== void 0) args.push(`--max=${max}`);
32727
- if (page) args.push(`--page=${page}`);
32800
+ const token = resolvePageToken({ pageToken, page });
32801
+ if (token) args.push(`--page=${token}`);
32728
32802
  if (all) args.push("--all");
32729
32803
  return runOrDiagnose(args, { account });
32730
32804
  });
package/manifest.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifest_version": "0.3",
4
4
  "name": "gogcli-mcp-calendar",
5
5
  "display_name": "gogcli (Calendar)",
6
- "version": "2.23.0",
6
+ "version": "2.23.2",
7
7
  "description": "Extended Google Calendar for Claude via gogcli — auth + Calendar events + Meet space management",
8
8
  "author": {
9
9
  "name": "Chris Hall",
@@ -88,7 +88,7 @@
88
88
  },
89
89
  {
90
90
  "name": "gog_calendar_events",
91
- "description": "List calendar events with optional filters"
91
+ "description": "List calendar events; paginated (gog returns only 10 by default) and flags a truncated range"
92
92
  },
93
93
  {
94
94
  "name": "gog_calendar_get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gogcli-mcp-calendar",
3
- "version": "2.23.0",
3
+ "version": "2.23.2",
4
4
  "mcpName": "io.github.chrischall/gogcli-mcp-calendar",
5
5
  "description": "Extended Google Calendar + Meet MCP server via gogcli — auth + Calendar events + Meet space management",
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
  const meetAccess = z.enum(['open', 'trusted', 'restricted']);
6
6
 
@@ -63,14 +63,16 @@ export function registerExtraCalendarTools(server: McpServer): void {
63
63
  inputSchema: {
64
64
  meetingCode: z.string().describe('Meeting code'),
65
65
  max: z.number().optional().describe('Max results (default: 20)'),
66
- page: z.string().optional().describe('Page token'),
66
+ pageToken: pageTokenParam,
67
+ page: pageAliasParam,
67
68
  all: z.boolean().optional().describe('Fetch all pages'),
68
69
  account: accountParam,
69
70
  },
70
- }, async ({ meetingCode, max, page, all, account }) => {
71
+ }, async ({ meetingCode, max, pageToken, page, all, account }) => {
71
72
  const args = ['meet', 'history', meetingCode];
72
73
  if (max !== undefined) args.push(`--max=${max}`);
73
- if (page) args.push(`--page=${page}`);
74
+ const token = resolvePageToken({ pageToken, page });
75
+ if (token) args.push(`--page=${token}`);
74
76
  if (all) args.push('--all');
75
77
  return runOrDiagnose(args, { account });
76
78
  });
@@ -117,14 +119,16 @@ export function registerExtraCalendarTools(server: McpServer): void {
117
119
  annotations: { readOnlyHint: true },
118
120
  inputSchema: {
119
121
  max: z.number().optional().describe('Max results (default: 100)'),
120
- page: z.string().optional().describe('Page token'),
122
+ pageToken: pageTokenParam,
123
+ page: pageAliasParam,
121
124
  all: z.boolean().optional().describe('Fetch all pages'),
122
125
  account: accountParam,
123
126
  },
124
- }, async ({ max, page, all, account }) => {
127
+ }, async ({ max, pageToken, page, all, account }) => {
125
128
  const args = ['calendar', 'calendars'];
126
129
  if (max !== undefined) args.push(`--max=${max}`);
127
- if (page) args.push(`--page=${page}`);
130
+ const token = resolvePageToken({ pageToken, page });
131
+ if (token) args.push(`--page=${token}`);
128
132
  if (all) args.push('--all');
129
133
  return runOrDiagnose(args, { account });
130
134
  });
@@ -215,14 +219,16 @@ export function registerExtraCalendarTools(server: McpServer): void {
215
219
  inputSchema: {
216
220
  calendarId: z.string().describe('Calendar ID'),
217
221
  max: z.number().optional().describe('Max results (default: 100)'),
218
- page: z.string().optional().describe('Page token'),
222
+ pageToken: pageTokenParam,
223
+ page: pageAliasParam,
219
224
  all: z.boolean().optional().describe('Fetch all pages'),
220
225
  account: accountParam,
221
226
  },
222
- }, async ({ calendarId, max, page, all, account }) => {
227
+ }, async ({ calendarId, max, pageToken, page, all, account }) => {
223
228
  const args = ['calendar', 'acl', calendarId];
224
229
  if (max !== undefined) args.push(`--max=${max}`);
225
- if (page) args.push(`--page=${page}`);
230
+ const token = resolvePageToken({ pageToken, page });
231
+ if (token) args.push(`--page=${token}`);
226
232
  if (all) args.push('--all');
227
233
  return runOrDiagnose(args, { account });
228
234
  });
@@ -295,15 +301,17 @@ export function registerExtraCalendarTools(server: McpServer): void {
295
301
  meetingCode: z.string().describe('Meeting code'),
296
302
  conference: z.string().optional().describe('Specific conference ID (default: most recent)'),
297
303
  max: z.number().optional().describe('Max results (default: 50)'),
298
- page: z.string().optional().describe('Page token'),
304
+ pageToken: pageTokenParam,
305
+ page: pageAliasParam,
299
306
  all: z.boolean().optional().describe('Fetch all pages'),
300
307
  account: accountParam,
301
308
  },
302
- }, async ({ meetingCode, conference, max, page, all, account }) => {
309
+ }, async ({ meetingCode, conference, max, pageToken, page, all, account }) => {
303
310
  const args = ['meet', 'participants', meetingCode];
304
311
  if (conference) args.push(`--conference=${conference}`);
305
312
  if (max !== undefined) args.push(`--max=${max}`);
306
- if (page) args.push(`--page=${page}`);
313
+ const token = resolvePageToken({ pageToken, page });
314
+ if (token) args.push(`--page=${token}`);
307
315
  if (all) args.push('--all');
308
316
  return runOrDiagnose(args, { account });
309
317
  });