@jezweb/mcp-integrations 0.1.1

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.
Files changed (42) hide show
  1. package/README.md +78 -0
  2. package/dist/google/calendar/index.d.ts +29 -0
  3. package/dist/google/calendar/index.d.ts.map +1 -0
  4. package/dist/google/calendar/index.js +33 -0
  5. package/dist/google/calendar/index.js.map +1 -0
  6. package/dist/google/calendar/prompts.d.ts +65 -0
  7. package/dist/google/calendar/prompts.d.ts.map +1 -0
  8. package/dist/google/calendar/prompts.js +88 -0
  9. package/dist/google/calendar/prompts.js.map +1 -0
  10. package/dist/google/calendar/resources.d.ts +9 -0
  11. package/dist/google/calendar/resources.d.ts.map +1 -0
  12. package/dist/google/calendar/resources.js +56 -0
  13. package/dist/google/calendar/resources.js.map +1 -0
  14. package/dist/google/calendar/tools/calendars.d.ts +36 -0
  15. package/dist/google/calendar/tools/calendars.d.ts.map +1 -0
  16. package/dist/google/calendar/tools/calendars.js +77 -0
  17. package/dist/google/calendar/tools/calendars.js.map +1 -0
  18. package/dist/google/calendar/tools/events.d.ts +118 -0
  19. package/dist/google/calendar/tools/events.d.ts.map +1 -0
  20. package/dist/google/calendar/tools/events.js +281 -0
  21. package/dist/google/calendar/tools/events.js.map +1 -0
  22. package/dist/google/calendar/tools/index.d.ts +280 -0
  23. package/dist/google/calendar/tools/index.d.ts.map +1 -0
  24. package/dist/google/calendar/tools/index.js +24 -0
  25. package/dist/google/calendar/tools/index.js.map +1 -0
  26. package/dist/google/index.d.ts +13 -0
  27. package/dist/google/index.d.ts.map +1 -0
  28. package/dist/google/index.js +13 -0
  29. package/dist/google/index.js.map +1 -0
  30. package/dist/helpers.d.ts +84 -0
  31. package/dist/helpers.d.ts.map +1 -0
  32. package/dist/helpers.js +111 -0
  33. package/dist/helpers.js.map +1 -0
  34. package/dist/index.d.ts +21 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +21 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/types.d.ts +179 -0
  39. package/dist/types.d.ts.map +1 -0
  40. package/dist/types.js +2 -0
  41. package/dist/types.js.map +1 -0
  42. package/package.json +70 -0
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # @jezweb/mcp-integrations
2
+
3
+ Reusable MCP tools, resources, and prompts for backend service integrations.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @jezweb/mcp-integrations
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { tools, resources, prompts } from '@jezweb/mcp-integrations/google/calendar';
15
+
16
+ // Register calendar tools with your MCP server
17
+ tools.all.forEach(tool => {
18
+ server.tool(tool.name, tool.description, tool.parameters,
19
+ (params) => tool.handler(params, { authorizedFetch })
20
+ );
21
+ });
22
+ ```
23
+
24
+ ## Available Integrations
25
+
26
+ | Integration | Import Path | Tools | Status |
27
+ |-------------|-------------|-------|--------|
28
+ | Google Calendar | `@jezweb/mcp-integrations/google/calendar` | 5 | ✅ Ready |
29
+ | Google Gmail | `@jezweb/mcp-integrations/google/gmail` | - | 🔜 Planned |
30
+ | Google Sheets | `@jezweb/mcp-integrations/google/sheets` | - | 🔜 Planned |
31
+ | Xero | `@jezweb/mcp-integrations/xero` | - | 🔜 Planned |
32
+
33
+ ## Tool Presets
34
+
35
+ Each integration exports tool presets for different access levels:
36
+
37
+ ```typescript
38
+ import { tools } from '@jezweb/mcp-integrations/google/calendar';
39
+
40
+ tools.all; // All tools
41
+ tools.readOnly; // List operations only
42
+ tools.fullAccess; // All CRUD operations
43
+ tools.alwaysVisible; // Core tools (for Tool Search)
44
+ ```
45
+
46
+ ## Tool Search Support
47
+
48
+ All tools include metadata for Anthropic's Tool Search pattern:
49
+
50
+ - `category`: Logical grouping (e.g., "calendar", "email")
51
+ - `tags`: Searchable keywords
52
+ - `alwaysVisible`: Whether tool is always shown or discoverable via search
53
+
54
+ ## ToolContext
55
+
56
+ Tools receive a `ToolContext` with:
57
+
58
+ ```typescript
59
+ interface ToolContext {
60
+ authorizedFetch: (url: string, init?: RequestInit) => Promise<Response>;
61
+ userId?: string;
62
+ userEmail?: string;
63
+ }
64
+ ```
65
+
66
+ Your MCP server provides `authorizedFetch` with OAuth token handling.
67
+
68
+ ## Development
69
+
70
+ ```bash
71
+ npm install
72
+ npm run build
73
+ npm run dev # Watch mode
74
+ ```
75
+
76
+ ## License
77
+
78
+ MIT
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Google Calendar Integration
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { tools, resources, prompts } from '@jezweb/mcp-integrations/google/calendar';
7
+ *
8
+ * // Register all calendar tools
9
+ * tools.all.forEach(tool => {
10
+ * server.tool(tool.name, tool.description, tool.parameters,
11
+ * (params) => tool.handler(params, ctx)
12
+ * );
13
+ * });
14
+ *
15
+ * // Or use selective presets
16
+ * tools.readOnly.forEach(tool => { ... }); // Just listEvents
17
+ * tools.fullAccess.forEach(tool => { ... }); // All CRUD operations
18
+ * ```
19
+ */
20
+ export * as tools from './tools';
21
+ export { listCalendars, listEvents, createEvent, updateEvent, deleteEvent, quickAddEvent, } from './tools';
22
+ export * as resources from './resources';
23
+ export { calendarList } from './resources';
24
+ export * as prompts from './prompts';
25
+ export { scheduleAssistant, dailyAgenda } from './prompts';
26
+ export { all as allTools, alwaysVisible, readOnly, fullAccess } from './tools';
27
+ export { all as allResources } from './resources';
28
+ export { all as allPrompts } from './prompts';
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/google/calendar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,EAAE,GAAG,IAAI,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,GAAG,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Google Calendar Integration
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { tools, resources, prompts } from '@jezweb/mcp-integrations/google/calendar';
7
+ *
8
+ * // Register all calendar tools
9
+ * tools.all.forEach(tool => {
10
+ * server.tool(tool.name, tool.description, tool.parameters,
11
+ * (params) => tool.handler(params, ctx)
12
+ * );
13
+ * });
14
+ *
15
+ * // Or use selective presets
16
+ * tools.readOnly.forEach(tool => { ... }); // Just listEvents
17
+ * tools.fullAccess.forEach(tool => { ... }); // All CRUD operations
18
+ * ```
19
+ */
20
+ // Tools
21
+ export * as tools from './tools';
22
+ export { listCalendars, listEvents, createEvent, updateEvent, deleteEvent, quickAddEvent, } from './tools';
23
+ // Resources
24
+ export * as resources from './resources';
25
+ export { calendarList } from './resources';
26
+ // Prompts
27
+ export * as prompts from './prompts';
28
+ export { scheduleAssistant, dailyAgenda } from './prompts';
29
+ // Re-export presets for convenience
30
+ export { all as allTools, alwaysVisible, readOnly, fullAccess } from './tools';
31
+ export { all as allResources } from './resources';
32
+ export { all as allPrompts } from './prompts';
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/google/calendar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,QAAQ;AACR,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,EACL,aAAa,EACb,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,YAAY;AACZ,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,UAAU;AACV,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE3D,oCAAoC;AACpC,OAAO,EAAE,GAAG,IAAI,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,GAAG,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Google Calendar Prompts
3
+ */
4
+ import { z } from 'zod';
5
+ /**
6
+ * Schedule assistant prompt
7
+ */
8
+ export declare const scheduleAssistant: import("../..").PromptDefinition<z.ZodObject<{
9
+ topic: z.ZodString;
10
+ duration: z.ZodDefault<z.ZodString>;
11
+ attendees: z.ZodOptional<z.ZodString>;
12
+ preferredTime: z.ZodOptional<z.ZodString>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ topic: string;
15
+ duration: string;
16
+ attendees?: string | undefined;
17
+ preferredTime?: string | undefined;
18
+ }, {
19
+ topic: string;
20
+ attendees?: string | undefined;
21
+ duration?: string | undefined;
22
+ preferredTime?: string | undefined;
23
+ }>>;
24
+ /**
25
+ * Daily agenda prompt
26
+ */
27
+ export declare const dailyAgenda: import("../..").PromptDefinition<z.ZodObject<{
28
+ date: z.ZodOptional<z.ZodString>;
29
+ includePrep: z.ZodDefault<z.ZodBoolean>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ includePrep: boolean;
32
+ date?: string | undefined;
33
+ }, {
34
+ date?: string | undefined;
35
+ includePrep?: boolean | undefined;
36
+ }>>;
37
+ /**
38
+ * All calendar prompts
39
+ */
40
+ export declare const all: (import("../..").PromptDefinition<z.ZodObject<{
41
+ topic: z.ZodString;
42
+ duration: z.ZodDefault<z.ZodString>;
43
+ attendees: z.ZodOptional<z.ZodString>;
44
+ preferredTime: z.ZodOptional<z.ZodString>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ topic: string;
47
+ duration: string;
48
+ attendees?: string | undefined;
49
+ preferredTime?: string | undefined;
50
+ }, {
51
+ topic: string;
52
+ attendees?: string | undefined;
53
+ duration?: string | undefined;
54
+ preferredTime?: string | undefined;
55
+ }>> | import("../..").PromptDefinition<z.ZodObject<{
56
+ date: z.ZodOptional<z.ZodString>;
57
+ includePrep: z.ZodDefault<z.ZodBoolean>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ includePrep: boolean;
60
+ date?: string | undefined;
61
+ }, {
62
+ date?: string | undefined;
63
+ includePrep?: boolean | undefined;
64
+ }>>)[];
65
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/google/calendar/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;GA0C5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;GAgCtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;MAAmC,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Google Calendar Prompts
3
+ */
4
+ import { z } from 'zod';
5
+ import { definePrompt } from '../../helpers';
6
+ /**
7
+ * Schedule assistant prompt
8
+ */
9
+ export const scheduleAssistant = definePrompt({
10
+ name: 'schedule_meeting',
11
+ description: 'Help schedule a meeting by finding available times and creating the event',
12
+ category: 'calendar',
13
+ tags: ['google', 'calendar', 'schedule', 'meeting', 'assistant'],
14
+ arguments: z.object({
15
+ topic: z.string().describe('Meeting topic or purpose'),
16
+ duration: z
17
+ .string()
18
+ .default('30 minutes')
19
+ .describe('Meeting duration (e.g., "30 minutes", "1 hour")'),
20
+ attendees: z
21
+ .string()
22
+ .optional()
23
+ .describe('Comma-separated list of attendee emails'),
24
+ preferredTime: z
25
+ .string()
26
+ .optional()
27
+ .describe('Preferred time of day (e.g., "morning", "afternoon", "2pm")'),
28
+ }),
29
+ handler: async (args) => ({
30
+ messages: [
31
+ {
32
+ role: 'user',
33
+ content: {
34
+ type: 'text',
35
+ text: `Help me schedule a meeting about "${args.topic}".
36
+
37
+ Duration: ${args.duration}
38
+ ${args.attendees ? `Attendees: ${args.attendees}` : ''}
39
+ ${args.preferredTime ? `Preferred time: ${args.preferredTime}` : ''}
40
+
41
+ Please:
42
+ 1. Check my calendar for available slots in the next few days
43
+ 2. Suggest 2-3 good times for this meeting
44
+ 3. Once I pick a time, create the event with appropriate details`,
45
+ },
46
+ },
47
+ ],
48
+ }),
49
+ });
50
+ /**
51
+ * Daily agenda prompt
52
+ */
53
+ export const dailyAgenda = definePrompt({
54
+ name: 'daily_agenda',
55
+ description: 'Get a summary of today\'s calendar events with preparation notes',
56
+ category: 'calendar',
57
+ tags: ['google', 'calendar', 'agenda', 'daily', 'summary'],
58
+ arguments: z.object({
59
+ date: z
60
+ .string()
61
+ .optional()
62
+ .describe('Date to check (YYYY-MM-DD, default: today)'),
63
+ includePrep: z
64
+ .boolean()
65
+ .default(true)
66
+ .describe('Include preparation notes for meetings'),
67
+ }),
68
+ handler: async (args) => ({
69
+ messages: [
70
+ {
71
+ role: 'user',
72
+ content: {
73
+ type: 'text',
74
+ text: `Show me my agenda for ${args.date || 'today'}.
75
+
76
+ ${args.includePrep ? 'For each meeting, please include:\n- Brief preparation notes\n- Key topics to cover\n- Any action items from previous meetings if relevant' : ''}
77
+
78
+ Format it as a clear timeline I can follow throughout the day.`,
79
+ },
80
+ },
81
+ ],
82
+ }),
83
+ });
84
+ /**
85
+ * All calendar prompts
86
+ */
87
+ export const all = [scheduleAssistant, dailyAgenda];
88
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/google/calendar/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;IAC5C,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,2EAA2E;IACxF,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC;IAEhE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC;QAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QACtD,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,OAAO,CAAC,YAAY,CAAC;aACrB,QAAQ,CAAC,iDAAiD,CAAC;QAC9D,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,yCAAyC,CAAC;QACtD,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;KAC3E,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACxB,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,qCAAqC,IAAI,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's calendars
3
+ */
4
+ export declare const calendarList: import("../..").ResourceDefinition;
5
+ /**
6
+ * All calendar resources
7
+ */
8
+ export declare const all: import("../..").ResourceDefinition[];
9
+ //# sourceMappingURL=resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/google/calendar/resources.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,eAAO,MAAM,YAAY,oCA+CvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG,sCAAiB,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Google Calendar Resources
3
+ */
4
+ import { defineResource } from '../../helpers';
5
+ const CALENDAR_API = 'https://www.googleapis.com/calendar/v3';
6
+ /**
7
+ * List of user's calendars
8
+ */
9
+ export const calendarList = defineResource({
10
+ name: 'google_calendar_list',
11
+ uri: 'mcp://google/calendar/list',
12
+ metadata: {
13
+ description: "List of user's Google calendars with IDs and access roles",
14
+ mimeType: 'application/json',
15
+ },
16
+ category: 'calendar',
17
+ tags: ['google', 'calendar', 'list', 'calendars'],
18
+ handler: async (uri, ctx) => {
19
+ const response = await ctx.authorizedFetch(`${CALENDAR_API}/users/me/calendarList`);
20
+ if (!response.ok) {
21
+ const error = await response.text();
22
+ return {
23
+ contents: [
24
+ {
25
+ uri: uri.href,
26
+ mimeType: 'application/json',
27
+ text: JSON.stringify({ error: `Failed to fetch calendars: ${error}` }),
28
+ },
29
+ ],
30
+ };
31
+ }
32
+ const data = (await response.json());
33
+ const calendars = data.items?.map((c) => ({
34
+ id: c.id,
35
+ name: c.summary,
36
+ description: c.description,
37
+ primary: c.primary || false,
38
+ accessRole: c.accessRole,
39
+ timeZone: c.timeZone,
40
+ })) || [];
41
+ return {
42
+ contents: [
43
+ {
44
+ uri: uri.href,
45
+ mimeType: 'application/json',
46
+ text: JSON.stringify(calendars, null, 2),
47
+ },
48
+ ],
49
+ };
50
+ },
51
+ });
52
+ /**
53
+ * All calendar resources
54
+ */
55
+ export const all = [calendarList];
56
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/google/calendar/resources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,YAAY,GAAG,wCAAwC,CAAC;AAgB9D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;IACzC,IAAI,EAAE,sBAAsB;IAC5B,GAAG,EAAE,4BAA4B;IACjC,QAAQ,EAAE;QACR,WAAW,EAAE,2DAA2D;QACxE,QAAQ,EAAE,kBAAkB;KAC7B;IACD,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC;IAEjD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,GAAgB,EAAE,EAAE;QACvC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,GAAG,YAAY,wBAAwB,CAAC,CAAC;QAEpF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpC,OAAO;gBACL,QAAQ,EAAE;oBACR;wBACE,GAAG,EAAE,GAAG,CAAC,IAAI;wBACb,QAAQ,EAAE,kBAAkB;wBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,8BAA8B,KAAK,EAAE,EAAE,CAAC;qBACvE;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAyB,CAAC;QAC7D,MAAM,SAAS,GACb,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACtB,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,OAAO;YACf,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK;YAC3B,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC,CAAC,IAAI,EAAE,CAAC;QAEZ,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,GAAG,CAAC,IAAI;oBACb,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;iBACzC;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Google Calendar List Tools
3
+ */
4
+ import { z } from 'zod';
5
+ /**
6
+ * List all calendars the user has access to
7
+ *
8
+ * This is essential for:
9
+ * - Discovering shared calendars (team calendars, meeting rooms)
10
+ * - Finding the correct calendarId for operations
11
+ * - Understanding access roles (owner, writer, reader)
12
+ */
13
+ export declare const listCalendars: import("../../..").ToolDefinition<z.ZodObject<{
14
+ showHidden: z.ZodDefault<z.ZodBoolean>;
15
+ showDeleted: z.ZodDefault<z.ZodBoolean>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ showHidden: boolean;
18
+ showDeleted: boolean;
19
+ }, {
20
+ showHidden?: boolean | undefined;
21
+ showDeleted?: boolean | undefined;
22
+ }>>;
23
+ /**
24
+ * All calendar list tools
25
+ */
26
+ export declare const all: import("../../..").ToolDefinition<z.ZodObject<{
27
+ showHidden: z.ZodDefault<z.ZodBoolean>;
28
+ showDeleted: z.ZodDefault<z.ZodBoolean>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ showHidden: boolean;
31
+ showDeleted: boolean;
32
+ }, {
33
+ showHidden?: boolean | undefined;
34
+ showDeleted?: boolean | undefined;
35
+ }>>[];
36
+ //# sourceMappingURL=calendars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendars.d.ts","sourceRoot":"","sources":["../../../../src/google/calendar/tools/calendars.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;;;;GAkExB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;KAAkB,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Google Calendar List Tools
3
+ */
4
+ import { z } from 'zod';
5
+ import { defineTool, jsonResult, errorResult } from '../../../helpers';
6
+ const CALENDAR_API = 'https://www.googleapis.com/calendar/v3';
7
+ /**
8
+ * List all calendars the user has access to
9
+ *
10
+ * This is essential for:
11
+ * - Discovering shared calendars (team calendars, meeting rooms)
12
+ * - Finding the correct calendarId for operations
13
+ * - Understanding access roles (owner, writer, reader)
14
+ */
15
+ export const listCalendars = defineTool({
16
+ name: 'google_calendar_list_calendars',
17
+ description: 'List all calendars the user has access to, including shared and subscribed calendars. Returns calendar IDs needed for other operations.',
18
+ category: 'calendar',
19
+ tags: ['google', 'calendar', 'list', 'discover', 'shared', 'read'],
20
+ alwaysVisible: true,
21
+ parameters: z.object({
22
+ showHidden: z
23
+ .boolean()
24
+ .default(false)
25
+ .describe('Whether to show hidden calendars'),
26
+ showDeleted: z
27
+ .boolean()
28
+ .default(false)
29
+ .describe('Whether to show deleted calendars'),
30
+ }),
31
+ handler: async (params, ctx) => {
32
+ const url = new URL(`${CALENDAR_API}/users/me/calendarList`);
33
+ if (params.showHidden) {
34
+ url.searchParams.set('showHidden', 'true');
35
+ }
36
+ if (params.showDeleted) {
37
+ url.searchParams.set('showDeleted', 'true');
38
+ }
39
+ const response = await ctx.authorizedFetch(url.toString());
40
+ if (!response.ok) {
41
+ const error = await response.text();
42
+ return errorResult(`Calendar API error: ${response.status} - ${error}`);
43
+ }
44
+ const data = (await response.json());
45
+ const calendars = data.items || [];
46
+ if (calendars.length === 0) {
47
+ return { content: [{ type: 'text', text: 'No calendars found.' }] };
48
+ }
49
+ // Sort: primary first, then by name
50
+ const sorted = calendars.sort((a, b) => {
51
+ if (a.primary && !b.primary)
52
+ return -1;
53
+ if (!a.primary && b.primary)
54
+ return 1;
55
+ return (a.summary || '').localeCompare(b.summary || '');
56
+ });
57
+ const formatted = sorted.map((c) => ({
58
+ id: c.id,
59
+ name: c.summary,
60
+ description: c.description,
61
+ primary: c.primary || false,
62
+ accessRole: c.accessRole,
63
+ timeZone: c.timeZone,
64
+ color: c.backgroundColor,
65
+ }));
66
+ return jsonResult({
67
+ count: formatted.length,
68
+ calendars: formatted,
69
+ hint: 'Use the calendar "id" as the calendarId parameter in other tools. The "primary" calendar is your main calendar.',
70
+ });
71
+ },
72
+ });
73
+ /**
74
+ * All calendar list tools
75
+ */
76
+ export const all = [listCalendars];
77
+ //# sourceMappingURL=calendars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendars.js","sourceRoot":"","sources":["../../../../src/google/calendar/tools/calendars.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGvE,MAAM,YAAY,GAAG,wCAAwC,CAAC;AAoB9D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,gCAAgC;IACtC,WAAW,EACT,yIAAyI;IAC3I,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC;IAClE,aAAa,EAAE,IAAI;IAEnB,UAAU,EAAE,CAAC,CAA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CAAC;QAED,oCAAoC;QACpC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO;gBAAE,OAAO,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO;gBAAE,OAAO,CAAC,CAAC;YACtC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnC,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,OAAO;YACf,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK;YAC3B,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,KAAK,EAAE,CAAC,CAAC,eAAe;SACzB,CAAC,CAAC,CAAC;QAEJ,OAAO,UAAU,CAAC;YAChB,KAAK,EAAE,SAAS,CAAC,MAAM;YACvB,SAAS,EAAE,SAAS;YACpB,IAAI,EAAE,iHAAiH;SACxH,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Google Calendar Event Tools
3
+ */
4
+ import { z } from 'zod';
5
+ /**
6
+ * List events from Google Calendar
7
+ */
8
+ export declare const listEvents: import("../../..").ToolDefinition<z.ZodObject<{
9
+ calendarId: z.ZodDefault<z.ZodString>;
10
+ maxResults: z.ZodDefault<z.ZodNumber>;
11
+ timeMin: z.ZodOptional<z.ZodString>;
12
+ timeMax: z.ZodOptional<z.ZodString>;
13
+ query: z.ZodOptional<z.ZodString>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ calendarId: string;
16
+ maxResults: number;
17
+ timeMin?: string | undefined;
18
+ timeMax?: string | undefined;
19
+ query?: string | undefined;
20
+ }, {
21
+ calendarId?: string | undefined;
22
+ maxResults?: number | undefined;
23
+ timeMin?: string | undefined;
24
+ timeMax?: string | undefined;
25
+ query?: string | undefined;
26
+ }>>;
27
+ /**
28
+ * Create a new calendar event
29
+ */
30
+ export declare const createEvent: import("../../..").ToolDefinition<z.ZodObject<{
31
+ calendarId: z.ZodDefault<z.ZodString>;
32
+ summary: z.ZodString;
33
+ description: z.ZodOptional<z.ZodString>;
34
+ location: z.ZodOptional<z.ZodString>;
35
+ start: z.ZodString;
36
+ end: z.ZodString;
37
+ attendees: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
+ timeZone: z.ZodDefault<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ calendarId: string;
41
+ summary: string;
42
+ start: string;
43
+ end: string;
44
+ timeZone: string;
45
+ description?: string | undefined;
46
+ location?: string | undefined;
47
+ attendees?: string[] | undefined;
48
+ }, {
49
+ summary: string;
50
+ start: string;
51
+ end: string;
52
+ calendarId?: string | undefined;
53
+ description?: string | undefined;
54
+ location?: string | undefined;
55
+ attendees?: string[] | undefined;
56
+ timeZone?: string | undefined;
57
+ }>>;
58
+ /**
59
+ * Update an existing calendar event
60
+ */
61
+ export declare const updateEvent: import("../../..").ToolDefinition<z.ZodObject<{
62
+ calendarId: z.ZodDefault<z.ZodString>;
63
+ eventId: z.ZodString;
64
+ summary: z.ZodOptional<z.ZodString>;
65
+ description: z.ZodOptional<z.ZodString>;
66
+ location: z.ZodOptional<z.ZodString>;
67
+ start: z.ZodOptional<z.ZodString>;
68
+ end: z.ZodOptional<z.ZodString>;
69
+ timeZone: z.ZodDefault<z.ZodString>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ calendarId: string;
72
+ timeZone: string;
73
+ eventId: string;
74
+ summary?: string | undefined;
75
+ description?: string | undefined;
76
+ location?: string | undefined;
77
+ start?: string | undefined;
78
+ end?: string | undefined;
79
+ }, {
80
+ eventId: string;
81
+ calendarId?: string | undefined;
82
+ summary?: string | undefined;
83
+ description?: string | undefined;
84
+ location?: string | undefined;
85
+ start?: string | undefined;
86
+ end?: string | undefined;
87
+ timeZone?: string | undefined;
88
+ }>>;
89
+ /**
90
+ * Delete a calendar event
91
+ */
92
+ export declare const deleteEvent: import("../../..").ToolDefinition<z.ZodObject<{
93
+ calendarId: z.ZodDefault<z.ZodString>;
94
+ eventId: z.ZodString;
95
+ sendUpdates: z.ZodDefault<z.ZodEnum<["all", "externalOnly", "none"]>>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ calendarId: string;
98
+ eventId: string;
99
+ sendUpdates: "all" | "externalOnly" | "none";
100
+ }, {
101
+ eventId: string;
102
+ calendarId?: string | undefined;
103
+ sendUpdates?: "all" | "externalOnly" | "none" | undefined;
104
+ }>>;
105
+ /**
106
+ * Quick add an event using natural language
107
+ */
108
+ export declare const quickAddEvent: import("../../..").ToolDefinition<z.ZodObject<{
109
+ calendarId: z.ZodDefault<z.ZodString>;
110
+ text: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ text: string;
113
+ calendarId: string;
114
+ }, {
115
+ text: string;
116
+ calendarId?: string | undefined;
117
+ }>>;
118
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/google/calendar/tools/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;GAwErB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;GAmCtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;GAwCxB,CAAC"}