@notionhq/apps 0.0.26 → 0.0.28

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 (36) hide show
  1. package/dist/calendar.generated.d.ts +1908 -680
  2. package/dist/calendar.generated.d.ts.map +1 -1
  3. package/dist/calendar.generated.js +27 -0
  4. package/dist/connection-trigger-definitions.generated.d.ts +12 -0
  5. package/dist/connection-trigger-definitions.generated.d.ts.map +1 -1
  6. package/dist/connection-trigger-definitions.generated.js +15 -0
  7. package/dist/connections.d.ts +1 -0
  8. package/dist/connections.d.ts.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -0
  12. package/dist/mail.generated.d.ts +4590 -0
  13. package/dist/mail.generated.d.ts.map +1 -0
  14. package/dist/mail.generated.js +252 -0
  15. package/dist/providers.generated.d.ts +4 -0
  16. package/dist/providers.generated.d.ts.map +1 -1
  17. package/dist/providers.generated.js +7 -0
  18. package/dist/triggers.generated.d.ts +34 -16
  19. package/dist/triggers.generated.d.ts.map +1 -1
  20. package/dist/triggers.generated.js +12 -9
  21. package/dist/workflow.d.ts +61 -1
  22. package/dist/workflow.d.ts.map +1 -1
  23. package/dist/workflow.js +109 -1
  24. package/docs/CONNECTIONS.md +38 -3
  25. package/docs/workflow-inputs.md +28 -0
  26. package/package.json +1 -1
  27. package/src/calendar.generated.ts +2033 -737
  28. package/src/connection-trigger-definitions.generated.ts +18 -0
  29. package/src/connections.test.ts +35 -0
  30. package/src/index.ts +1 -0
  31. package/src/mail.generated.ts +5095 -0
  32. package/src/providers.generated.ts +8 -0
  33. package/src/triggers.generated.ts +27 -18
  34. package/src/workflow-connections-types.test.ts +16 -0
  35. package/src/workflow.test.ts +210 -0
  36. package/src/workflow.ts +226 -3
@@ -0,0 +1,4590 @@
1
+ import type { ConnectionActionInvoker } from "./connection-actions.js";
2
+ /**
3
+ * Script input for the "Add Sender to Notion Mail Notification Allowlist" effect (`mail.addSenderNotificationPreferences`),
4
+ * derived from its Tool Core definition's call_function input projection.
5
+ *
6
+ * Add sender email addresses to the Notion Mail notification allowlist. When a sender is on the allowlist, their emails will always trigger push notifications regardless of view-level settings. This tool is specific to Notion Mail notification settings only. Takes effect immediately.
7
+ */
8
+ export type AddSenderNotificationPreferencesScriptInput = {
9
+ /**
10
+ * The Notion Mail email address of the account. Must be an account connected to Notion Mail.
11
+ */
12
+ userEmailAddress: string;
13
+ /**
14
+ * Sender email addresses to add to the notification allowlist
15
+ */
16
+ senderAddresses: Array<string>;
17
+ };
18
+ /**
19
+ * Canonical Tool Core output for the "Add Sender to Notion Mail Notification Allowlist" effect (`mail.addSenderNotificationPreferences`).
20
+ * This is the definition's output schema; the effect's script surface may
21
+ * re-encode it before returning.
22
+ */
23
+ export type AddSenderNotificationPreferencesScriptOutput = {
24
+ /**
25
+ * Tool output content.
26
+ */
27
+ content: unknown;
28
+ /**
29
+ * Name of the Mail tool that ran.
30
+ */
31
+ name: string;
32
+ /**
33
+ * Whether the Mail service reported a tool error.
34
+ */
35
+ isError?: boolean;
36
+ /**
37
+ * Execution metadata reported by the MCP server.
38
+ */
39
+ metadata?: {
40
+ /**
41
+ * Tool execution time in milliseconds.
42
+ */
43
+ executionTimeMs?: number;
44
+ /**
45
+ * Number of bytes processed by the tool.
46
+ */
47
+ bytesProcessed?: number;
48
+ /**
49
+ * Tool execution cost reported by the MCP server.
50
+ */
51
+ cost?: number;
52
+ };
53
+ /**
54
+ * Mail module name used for display.
55
+ */
56
+ moduleName?: string;
57
+ /**
58
+ * Structured tool output when provided by the Mail service.
59
+ */
60
+ structuredContent?: unknown;
61
+ /**
62
+ * Bounded HTTP-like Mail service error code.
63
+ */
64
+ toolErrorCode?: number;
65
+ };
66
+ /**
67
+ * Script input for the "Analyze Recent Email Activities" effect (`mail.analyzeRecentEmailActivities`),
68
+ * derived from its Tool Core definition's call_function input projection.
69
+ *
70
+ * Returns a structured snapshot of the user's mailbox for the last 7 days including labels with message counts, contacts registry, threads registry, drafts, sent messages grouped by recipient, and Gmail filter rules. Use this as a first step to understand a user's mailbox before taking actions.
71
+ */
72
+ export type AnalyzeRecentEmailActivitiesScriptInput = {
73
+ /**
74
+ * The email address of the account to get context for
75
+ */
76
+ userEmailAddress: string;
77
+ };
78
+ /**
79
+ * Canonical Tool Core output for the "Analyze Recent Email Activities" effect (`mail.analyzeRecentEmailActivities`).
80
+ * This is the definition's output schema; the effect's script surface may
81
+ * re-encode it before returning.
82
+ */
83
+ export type AnalyzeRecentEmailActivitiesScriptOutput = {
84
+ /**
85
+ * Tool output content.
86
+ */
87
+ content: unknown;
88
+ /**
89
+ * Name of the Mail tool that ran.
90
+ */
91
+ name: string;
92
+ /**
93
+ * Whether the Mail service reported a tool error.
94
+ */
95
+ isError?: boolean;
96
+ /**
97
+ * Execution metadata reported by the MCP server.
98
+ */
99
+ metadata?: {
100
+ /**
101
+ * Tool execution time in milliseconds.
102
+ */
103
+ executionTimeMs?: number;
104
+ /**
105
+ * Number of bytes processed by the tool.
106
+ */
107
+ bytesProcessed?: number;
108
+ /**
109
+ * Tool execution cost reported by the MCP server.
110
+ */
111
+ cost?: number;
112
+ };
113
+ /**
114
+ * Mail module name used for display.
115
+ */
116
+ moduleName?: string;
117
+ /**
118
+ * Structured tool output when provided by the Mail service.
119
+ */
120
+ structuredContent?: unknown;
121
+ /**
122
+ * Bounded HTTP-like Mail service error code.
123
+ */
124
+ toolErrorCode?: number;
125
+ };
126
+ /**
127
+ * Script input for the "Apply Outlook Categories" effect (`mail.applyOutlookCategories`),
128
+ * derived from its Tool Core definition's call_function input projection.
129
+ *
130
+ * Apply categories to all messages in the specified Outlook conversations. Merges with existing categories.
131
+ */
132
+ export type ApplyOutlookCategoriesScriptInput = {
133
+ /**
134
+ * The Outlook email address
135
+ */
136
+ userEmailAddress: string;
137
+ /**
138
+ * Outlook conversation IDs (from search_emails threadId)
139
+ */
140
+ conversationIDs: Array<string>;
141
+ /**
142
+ * Category display names to apply (case-sensitive)
143
+ */
144
+ categoryNames: Array<string>;
145
+ };
146
+ /**
147
+ * Canonical Tool Core output for the "Apply Outlook Categories" effect (`mail.applyOutlookCategories`).
148
+ * This is the definition's output schema; the effect's script surface may
149
+ * re-encode it before returning.
150
+ */
151
+ export type ApplyOutlookCategoriesScriptOutput = {
152
+ /**
153
+ * Tool output content.
154
+ */
155
+ content: unknown;
156
+ /**
157
+ * Name of the Mail tool that ran.
158
+ */
159
+ name: string;
160
+ /**
161
+ * Whether the Mail service reported a tool error.
162
+ */
163
+ isError?: boolean;
164
+ /**
165
+ * Execution metadata reported by the MCP server.
166
+ */
167
+ metadata?: {
168
+ /**
169
+ * Tool execution time in milliseconds.
170
+ */
171
+ executionTimeMs?: number;
172
+ /**
173
+ * Number of bytes processed by the tool.
174
+ */
175
+ bytesProcessed?: number;
176
+ /**
177
+ * Tool execution cost reported by the MCP server.
178
+ */
179
+ cost?: number;
180
+ };
181
+ /**
182
+ * Mail module name used for display.
183
+ */
184
+ moduleName?: string;
185
+ /**
186
+ * Structured tool output when provided by the Mail service.
187
+ */
188
+ structuredContent?: unknown;
189
+ /**
190
+ * Bounded HTTP-like Mail service error code.
191
+ */
192
+ toolErrorCode?: number;
193
+ };
194
+ /**
195
+ * Script input for the "Apply Labels" effect (`mail.applyUserLabelsWithLazyCreate`),
196
+ * derived from its Tool Core definition's call_function input projection.
197
+ *
198
+ * Apply labels to email threads, creating them if they don't exist
199
+ */
200
+ export type ApplyUserLabelsWithLazyCreateScriptInput = {
201
+ /**
202
+ * The email address of the mailbox
203
+ */
204
+ userEmailAddress: string;
205
+ /**
206
+ * Array of thread IDs to label
207
+ */
208
+ threadIds: Array<string>;
209
+ /**
210
+ * Names of labels to apply
211
+ */
212
+ labelNames: Array<string>;
213
+ };
214
+ /**
215
+ * Canonical Tool Core output for the "Apply Labels" effect (`mail.applyUserLabelsWithLazyCreate`).
216
+ * This is the definition's output schema; the effect's script surface may
217
+ * re-encode it before returning.
218
+ */
219
+ export type ApplyUserLabelsWithLazyCreateScriptOutput = {
220
+ /**
221
+ * Tool output content.
222
+ */
223
+ content: unknown;
224
+ /**
225
+ * Name of the Mail tool that ran.
226
+ */
227
+ name: string;
228
+ /**
229
+ * Whether the Mail service reported a tool error.
230
+ */
231
+ isError?: boolean;
232
+ /**
233
+ * Execution metadata reported by the MCP server.
234
+ */
235
+ metadata?: {
236
+ /**
237
+ * Tool execution time in milliseconds.
238
+ */
239
+ executionTimeMs?: number;
240
+ /**
241
+ * Number of bytes processed by the tool.
242
+ */
243
+ bytesProcessed?: number;
244
+ /**
245
+ * Tool execution cost reported by the MCP server.
246
+ */
247
+ cost?: number;
248
+ };
249
+ /**
250
+ * Mail module name used for display.
251
+ */
252
+ moduleName?: string;
253
+ /**
254
+ * Structured tool output when provided by the Mail service.
255
+ */
256
+ structuredContent?: unknown;
257
+ /**
258
+ * Bounded HTTP-like Mail service error code.
259
+ */
260
+ toolErrorCode?: number;
261
+ };
262
+ /**
263
+ * Script input for the "Archive Threads by ID" effect (`mail.archiveThreadsById`),
264
+ * derived from its Tool Core definition's call_function input projection.
265
+ *
266
+ * Archive one or more email threads (remove from inbox)
267
+ */
268
+ export type ArchiveThreadsByIdScriptInput = {
269
+ /**
270
+ * The email address of the mailbox
271
+ */
272
+ userEmailAddress: string;
273
+ /**
274
+ * Array of thread IDs to archive
275
+ */
276
+ threadIds: Array<string>;
277
+ };
278
+ /**
279
+ * Canonical Tool Core output for the "Archive Threads by ID" effect (`mail.archiveThreadsById`).
280
+ * This is the definition's output schema; the effect's script surface may
281
+ * re-encode it before returning.
282
+ */
283
+ export type ArchiveThreadsByIdScriptOutput = {
284
+ /**
285
+ * Tool output content.
286
+ */
287
+ content: unknown;
288
+ /**
289
+ * Name of the Mail tool that ran.
290
+ */
291
+ name: string;
292
+ /**
293
+ * Whether the Mail service reported a tool error.
294
+ */
295
+ isError?: boolean;
296
+ /**
297
+ * Execution metadata reported by the MCP server.
298
+ */
299
+ metadata?: {
300
+ /**
301
+ * Tool execution time in milliseconds.
302
+ */
303
+ executionTimeMs?: number;
304
+ /**
305
+ * Number of bytes processed by the tool.
306
+ */
307
+ bytesProcessed?: number;
308
+ /**
309
+ * Tool execution cost reported by the MCP server.
310
+ */
311
+ cost?: number;
312
+ };
313
+ /**
314
+ * Mail module name used for display.
315
+ */
316
+ moduleName?: string;
317
+ /**
318
+ * Structured tool output when provided by the Mail service.
319
+ */
320
+ structuredContent?: unknown;
321
+ /**
322
+ * Bounded HTTP-like Mail service error code.
323
+ */
324
+ toolErrorCode?: number;
325
+ };
326
+ /**
327
+ * Script input for the "Archive Threads by Search Query" effect (`mail.archiveThreadsByQuery`),
328
+ * derived from its Tool Core definition's call_function input projection.
329
+ *
330
+ * Archives threads matching a Gmail-style search query
331
+ */
332
+ export type ArchiveThreadsByQueryScriptInput = {
333
+ /**
334
+ * The email address of the mailbox
335
+ */
336
+ userEmailAddress: string;
337
+ /**
338
+ * Gmail search query to match threads to archive
339
+ */
340
+ query: string;
341
+ /**
342
+ * Pagination token from previous archive results
343
+ */
344
+ pageToken?: string;
345
+ };
346
+ /**
347
+ * Canonical Tool Core output for the "Archive Threads by Search Query" effect (`mail.archiveThreadsByQuery`).
348
+ * This is the definition's output schema; the effect's script surface may
349
+ * re-encode it before returning.
350
+ */
351
+ export type ArchiveThreadsByQueryScriptOutput = {
352
+ /**
353
+ * Tool output content.
354
+ */
355
+ content: unknown;
356
+ /**
357
+ * Name of the Mail tool that ran.
358
+ */
359
+ name: string;
360
+ /**
361
+ * Whether the Mail service reported a tool error.
362
+ */
363
+ isError?: boolean;
364
+ /**
365
+ * Execution metadata reported by the MCP server.
366
+ */
367
+ metadata?: {
368
+ /**
369
+ * Tool execution time in milliseconds.
370
+ */
371
+ executionTimeMs?: number;
372
+ /**
373
+ * Number of bytes processed by the tool.
374
+ */
375
+ bytesProcessed?: number;
376
+ /**
377
+ * Tool execution cost reported by the MCP server.
378
+ */
379
+ cost?: number;
380
+ };
381
+ /**
382
+ * Mail module name used for display.
383
+ */
384
+ moduleName?: string;
385
+ /**
386
+ * Structured tool output when provided by the Mail service.
387
+ */
388
+ structuredContent?: unknown;
389
+ /**
390
+ * Bounded HTTP-like Mail service error code.
391
+ */
392
+ toolErrorCode?: number;
393
+ };
394
+ /**
395
+ * Script input for the "Block Sender" effect (`mail.blockSender`),
396
+ * derived from its Tool Core definition's call_function input projection.
397
+ *
398
+ * Block a sender from sending emails to this mailbox by adding them to the mailbox's blocked-senders list. Works for any mail provider.
399
+ */
400
+ export type BlockSenderScriptInput = {
401
+ /**
402
+ * The email address of the mailbox
403
+ */
404
+ userEmailAddress: string;
405
+ /**
406
+ * Email address of the sender to block
407
+ */
408
+ senderEmail: string;
409
+ /**
410
+ * Optional array of thread IDs to immediately trash (from this sender)
411
+ */
412
+ threadIds?: Array<string>;
413
+ };
414
+ /**
415
+ * Canonical Tool Core output for the "Block Sender" effect (`mail.blockSender`).
416
+ * This is the definition's output schema; the effect's script surface may
417
+ * re-encode it before returning.
418
+ */
419
+ export type BlockSenderScriptOutput = {
420
+ /**
421
+ * Tool output content.
422
+ */
423
+ content: unknown;
424
+ /**
425
+ * Name of the Mail tool that ran.
426
+ */
427
+ name: string;
428
+ /**
429
+ * Whether the Mail service reported a tool error.
430
+ */
431
+ isError?: boolean;
432
+ /**
433
+ * Execution metadata reported by the MCP server.
434
+ */
435
+ metadata?: {
436
+ /**
437
+ * Tool execution time in milliseconds.
438
+ */
439
+ executionTimeMs?: number;
440
+ /**
441
+ * Number of bytes processed by the tool.
442
+ */
443
+ bytesProcessed?: number;
444
+ /**
445
+ * Tool execution cost reported by the MCP server.
446
+ */
447
+ cost?: number;
448
+ };
449
+ /**
450
+ * Mail module name used for display.
451
+ */
452
+ moduleName?: string;
453
+ /**
454
+ * Structured tool output when provided by the Mail service.
455
+ */
456
+ structuredContent?: unknown;
457
+ /**
458
+ * Bounded HTTP-like Mail service error code.
459
+ */
460
+ toolErrorCode?: number;
461
+ };
462
+ /**
463
+ * Script input for the "Create Gmail Filter" effect (`mail.createGmailFilter`),
464
+ * derived from its Tool Core definition's call_function input projection.
465
+ *
466
+ * Create a new Gmail filter rule
467
+ */
468
+ export type CreateGmailFilterScriptInput = {
469
+ /**
470
+ * The email address of the Gmail account
471
+ */
472
+ userEmailAddress: string;
473
+ /**
474
+ * Filter criteria (at least one field required)
475
+ */
476
+ criteria: {
477
+ /**
478
+ * Match emails from this sender
479
+ */
480
+ from?: string;
481
+ /**
482
+ * Match emails sent to this address
483
+ */
484
+ to?: string;
485
+ /**
486
+ * Match emails with this in subject
487
+ */
488
+ subject?: string;
489
+ /**
490
+ * Full Gmail search query
491
+ */
492
+ query?: string;
493
+ /**
494
+ * Exclude emails matching this query
495
+ */
496
+ negatedQuery?: string;
497
+ /**
498
+ * Match only emails with attachments
499
+ */
500
+ hasAttachment?: boolean;
501
+ /**
502
+ * Exclude chat messages
503
+ */
504
+ excludeChats?: boolean;
505
+ /**
506
+ * Size threshold in bytes
507
+ */
508
+ size?: number;
509
+ /**
510
+ * Compare against size threshold
511
+ */
512
+ sizeComparison?: "SMALLER" | "LARGER";
513
+ };
514
+ /**
515
+ * Actions to perform (at least one required)
516
+ */
517
+ action: {
518
+ /**
519
+ * Gmail system label IDs or IDs returned by list_labels. Never use Notion record, survey option, or category IDs.
520
+ */
521
+ addLabelIds?: Array<string>;
522
+ /**
523
+ * Gmail system label IDs or IDs returned by list_labels. Use INBOX to auto-archive matching future mail.
524
+ */
525
+ removeLabelIds?: Array<string>;
526
+ /**
527
+ * Email address to forward to (must be pre-verified)
528
+ */
529
+ forward?: string;
530
+ };
531
+ };
532
+ /**
533
+ * Canonical Tool Core output for the "Create Gmail Filter" effect (`mail.createGmailFilter`).
534
+ * This is the definition's output schema; the effect's script surface may
535
+ * re-encode it before returning.
536
+ */
537
+ export type CreateGmailFilterScriptOutput = {
538
+ /**
539
+ * Tool output content.
540
+ */
541
+ content: unknown;
542
+ /**
543
+ * Name of the Mail tool that ran.
544
+ */
545
+ name: string;
546
+ /**
547
+ * Whether the Mail service reported a tool error.
548
+ */
549
+ isError?: boolean;
550
+ /**
551
+ * Execution metadata reported by the MCP server.
552
+ */
553
+ metadata?: {
554
+ /**
555
+ * Tool execution time in milliseconds.
556
+ */
557
+ executionTimeMs?: number;
558
+ /**
559
+ * Number of bytes processed by the tool.
560
+ */
561
+ bytesProcessed?: number;
562
+ /**
563
+ * Tool execution cost reported by the MCP server.
564
+ */
565
+ cost?: number;
566
+ };
567
+ /**
568
+ * Mail module name used for display.
569
+ */
570
+ moduleName?: string;
571
+ /**
572
+ * Structured tool output when provided by the Mail service.
573
+ */
574
+ structuredContent?: unknown;
575
+ /**
576
+ * Bounded HTTP-like Mail service error code.
577
+ */
578
+ toolErrorCode?: number;
579
+ };
580
+ /**
581
+ * Script input for the "Create Label" effect (`mail.createLabel`),
582
+ * derived from its Tool Core definition's call_function input projection.
583
+ *
584
+ * Create a new label in the mailbox
585
+ */
586
+ export type CreateLabelScriptInput = {
587
+ /**
588
+ * The email address of the mailbox
589
+ */
590
+ userEmailAddress: string;
591
+ /**
592
+ * Name of the label to create
593
+ */
594
+ labelName: string;
595
+ /**
596
+ * Optional color for the label
597
+ */
598
+ color?: "light-gray" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
599
+ };
600
+ /**
601
+ * Canonical Tool Core output for the "Create Label" effect (`mail.createLabel`).
602
+ * This is the definition's output schema; the effect's script surface may
603
+ * re-encode it before returning.
604
+ */
605
+ export type CreateLabelScriptOutput = {
606
+ /**
607
+ * Tool output content.
608
+ */
609
+ content: unknown;
610
+ /**
611
+ * Name of the Mail tool that ran.
612
+ */
613
+ name: string;
614
+ /**
615
+ * Whether the Mail service reported a tool error.
616
+ */
617
+ isError?: boolean;
618
+ /**
619
+ * Execution metadata reported by the MCP server.
620
+ */
621
+ metadata?: {
622
+ /**
623
+ * Tool execution time in milliseconds.
624
+ */
625
+ executionTimeMs?: number;
626
+ /**
627
+ * Number of bytes processed by the tool.
628
+ */
629
+ bytesProcessed?: number;
630
+ /**
631
+ * Tool execution cost reported by the MCP server.
632
+ */
633
+ cost?: number;
634
+ };
635
+ /**
636
+ * Mail module name used for display.
637
+ */
638
+ moduleName?: string;
639
+ /**
640
+ * Structured tool output when provided by the Mail service.
641
+ */
642
+ structuredContent?: unknown;
643
+ /**
644
+ * Bounded HTTP-like Mail service error code.
645
+ */
646
+ toolErrorCode?: number;
647
+ };
648
+ /**
649
+ * Script input for the "Create Mail Block" effect (`mail.createMailBlock`),
650
+ * derived from its Tool Core definition's call_function input projection.
651
+ *
652
+ * Create a Notion Mail block for a Gmail thread in a specified location.
653
+ */
654
+ export type CreateMailBlockScriptInput = {
655
+ /**
656
+ * The email address of the mailbox
657
+ */
658
+ userEmailAddress: string;
659
+ /**
660
+ * The Gmail thread ID to create a mail block for
661
+ */
662
+ threadId: string;
663
+ /**
664
+ * Where to create the mail block (private, page, or database)
665
+ */
666
+ locationType: "private" | "page" | "database";
667
+ /**
668
+ * Required when locationType is page or database. Not used for private.
669
+ */
670
+ locationUrl?: string;
671
+ };
672
+ /**
673
+ * Canonical Tool Core output for the "Create Mail Block" effect (`mail.createMailBlock`).
674
+ * This is the definition's output schema; the effect's script surface may
675
+ * re-encode it before returning.
676
+ */
677
+ export type CreateMailBlockScriptOutput = {
678
+ /**
679
+ * Tool output content.
680
+ */
681
+ content: unknown;
682
+ /**
683
+ * Name of the Mail tool that ran.
684
+ */
685
+ name: string;
686
+ /**
687
+ * Whether the Mail service reported a tool error.
688
+ */
689
+ isError?: boolean;
690
+ /**
691
+ * Execution metadata reported by the MCP server.
692
+ */
693
+ metadata?: {
694
+ /**
695
+ * Tool execution time in milliseconds.
696
+ */
697
+ executionTimeMs?: number;
698
+ /**
699
+ * Number of bytes processed by the tool.
700
+ */
701
+ bytesProcessed?: number;
702
+ /**
703
+ * Tool execution cost reported by the MCP server.
704
+ */
705
+ cost?: number;
706
+ };
707
+ /**
708
+ * Mail module name used for display.
709
+ */
710
+ moduleName?: string;
711
+ /**
712
+ * Structured tool output when provided by the Mail service.
713
+ */
714
+ structuredContent?: unknown;
715
+ /**
716
+ * Bounded HTTP-like Mail service error code.
717
+ */
718
+ toolErrorCode?: number;
719
+ };
720
+ /**
721
+ * Script input for the "Create Draft (Notion Mail)" effect (`mail.createOrUpdateDraft`),
722
+ * derived from its Tool Core definition's call_function input projection.
723
+ *
724
+ * Create or update a draft email in Notion Mail. For replies, automatically finds and updates existing agent drafts on the same thread.
725
+ */
726
+ export type CreateOrUpdateDraftScriptInput = {
727
+ /**
728
+ * The user's email address (for mailbox identification)
729
+ */
730
+ userEmailAddress: string;
731
+ /**
732
+ * Draft intent: "reply" for responding to existing thread, "standalone_draft" for new email, "forward" to forward an existing message
733
+ */
734
+ draftType: "reply" | "standalone_draft" | "forward";
735
+ /**
736
+ * Sender address owned by the user
737
+ */
738
+ from: {
739
+ address: string;
740
+ name?: string;
741
+ };
742
+ /**
743
+ * Primary recipients. Required for standalone drafts and forwards, optional for replies.
744
+ */
745
+ to?: Array<{
746
+ address: string;
747
+ name?: string;
748
+ }>;
749
+ /**
750
+ * CC recipients
751
+ */
752
+ cc?: Array<{
753
+ address: string;
754
+ name?: string;
755
+ }>;
756
+ /**
757
+ * BCC recipients
758
+ */
759
+ bcc?: Array<{
760
+ address: string;
761
+ name?: string;
762
+ }>;
763
+ /**
764
+ * Subject line. Required for standalone drafts. Auto-generated for replies and forwards (Re:/FWD: prefix).
765
+ */
766
+ subject?: string;
767
+ /**
768
+ * Plain text email body
769
+ */
770
+ text?: string;
771
+ /**
772
+ * HTML email body
773
+ */
774
+ html?: string;
775
+ /**
776
+ * Gmail thread ID for replies or forwards. Required when draftType is reply or forward.
777
+ */
778
+ parentThreadId?: string;
779
+ /**
780
+ * Specific message ID to reply to. Defaults to latest message when omitted.
781
+ */
782
+ parentMessageId?: string;
783
+ /**
784
+ * ID of an existing Notion Mail draft to update (the messageID field from a prior create_or_update_draft response). Applicable to standalone_draft type only. Omit to create a new draft.
785
+ */
786
+ draftId?: string;
787
+ };
788
+ /**
789
+ * Canonical Tool Core output for the "Create Draft (Notion Mail)" effect (`mail.createOrUpdateDraft`).
790
+ * This is the definition's output schema; the effect's script surface may
791
+ * re-encode it before returning.
792
+ */
793
+ export type CreateOrUpdateDraftScriptOutput = {
794
+ /**
795
+ * Tool output content.
796
+ */
797
+ content: unknown;
798
+ /**
799
+ * Name of the Mail tool that ran.
800
+ */
801
+ name: string;
802
+ /**
803
+ * Whether the Mail service reported a tool error.
804
+ */
805
+ isError?: boolean;
806
+ /**
807
+ * Execution metadata reported by the MCP server.
808
+ */
809
+ metadata?: {
810
+ /**
811
+ * Tool execution time in milliseconds.
812
+ */
813
+ executionTimeMs?: number;
814
+ /**
815
+ * Number of bytes processed by the tool.
816
+ */
817
+ bytesProcessed?: number;
818
+ /**
819
+ * Tool execution cost reported by the MCP server.
820
+ */
821
+ cost?: number;
822
+ };
823
+ /**
824
+ * Mail module name used for display.
825
+ */
826
+ moduleName?: string;
827
+ /**
828
+ * Structured tool output when provided by the Mail service.
829
+ */
830
+ structuredContent?: unknown;
831
+ /**
832
+ * Bounded HTTP-like Mail service error code.
833
+ */
834
+ toolErrorCode?: number;
835
+ };
836
+ /**
837
+ * Script input for the "Create Draft (Gmail + Notion Mail)" effect (`mail.createOrUpdateDraftAllClients`),
838
+ * derived from its Tool Core definition's call_function input projection.
839
+ *
840
+ * Create or update a draft email in both Gmail and Notion Mail in a single step, keeping the draft in sync across both mail clients. Creates the Gmail draft first, then the Notion Mail draft linked to it (serial, not parallel).
841
+ */
842
+ export type CreateOrUpdateDraftAllClientsScriptInput = {
843
+ /**
844
+ * The user's email address (for mailbox identification)
845
+ */
846
+ userEmailAddress: string;
847
+ /**
848
+ * Draft intent: "reply" for responding to existing thread, "standalone_draft" for new email, "forward" to forward an existing message
849
+ */
850
+ draftType: "reply" | "standalone_draft" | "forward";
851
+ /**
852
+ * Sender address owned by the user
853
+ */
854
+ from: {
855
+ address: string;
856
+ name?: string;
857
+ };
858
+ /**
859
+ * Primary recipients. Required for standalone drafts and forwards, optional for replies.
860
+ */
861
+ to?: Array<{
862
+ address: string;
863
+ name?: string;
864
+ }>;
865
+ /**
866
+ * CC recipients
867
+ */
868
+ cc?: Array<{
869
+ address: string;
870
+ name?: string;
871
+ }>;
872
+ /**
873
+ * BCC recipients
874
+ */
875
+ bcc?: Array<{
876
+ address: string;
877
+ name?: string;
878
+ }>;
879
+ /**
880
+ * Subject line. Required for standalone drafts. Auto-generated for replies and forwards.
881
+ */
882
+ subject?: string;
883
+ /**
884
+ * Plain text email body
885
+ */
886
+ text?: string;
887
+ /**
888
+ * HTML email body
889
+ */
890
+ html?: string;
891
+ /**
892
+ * Gmail thread ID for replies or forwards. Required when draftType is reply or forward.
893
+ */
894
+ threadId?: string;
895
+ /**
896
+ * Specific message ID to reply to. Defaults to latest message when omitted.
897
+ */
898
+ parentMessageId?: string;
899
+ /**
900
+ * Opaque draft ID from a prior create_or_update_draft_all_clients response. Pass this to update existing drafts in both Gmail and Notion Mail. Omit to create new drafts.
901
+ */
902
+ draftId?: string;
903
+ };
904
+ /**
905
+ * Canonical Tool Core output for the "Create Draft (Gmail + Notion Mail)" effect (`mail.createOrUpdateDraftAllClients`).
906
+ * This is the definition's output schema; the effect's script surface may
907
+ * re-encode it before returning.
908
+ */
909
+ export type CreateOrUpdateDraftAllClientsScriptOutput = {
910
+ /**
911
+ * Tool output content.
912
+ */
913
+ content: unknown;
914
+ /**
915
+ * Name of the Mail tool that ran.
916
+ */
917
+ name: string;
918
+ /**
919
+ * Whether the Mail service reported a tool error.
920
+ */
921
+ isError?: boolean;
922
+ /**
923
+ * Execution metadata reported by the MCP server.
924
+ */
925
+ metadata?: {
926
+ /**
927
+ * Tool execution time in milliseconds.
928
+ */
929
+ executionTimeMs?: number;
930
+ /**
931
+ * Number of bytes processed by the tool.
932
+ */
933
+ bytesProcessed?: number;
934
+ /**
935
+ * Tool execution cost reported by the MCP server.
936
+ */
937
+ cost?: number;
938
+ };
939
+ /**
940
+ * Mail module name used for display.
941
+ */
942
+ moduleName?: string;
943
+ /**
944
+ * Structured tool output when provided by the Mail service.
945
+ */
946
+ structuredContent?: unknown;
947
+ /**
948
+ * Bounded HTTP-like Mail service error code.
949
+ */
950
+ toolErrorCode?: number;
951
+ };
952
+ /**
953
+ * Script input for the "Create Draft (Gmail)" effect (`mail.createOrUpdateGmailDraft`),
954
+ * derived from its Tool Core definition's call_function input projection.
955
+ *
956
+ * Create or update a draft email in Gmail's drafts folder.
957
+ */
958
+ export type CreateOrUpdateGmailDraftScriptInput = {
959
+ /**
960
+ * The user's email address
961
+ */
962
+ userEmailAddress: string;
963
+ /**
964
+ * Draft intent: "reply" for replies, "standalone_draft" for new emails, "forward" to forward a message.
965
+ */
966
+ draftType: "reply" | "standalone_draft" | "forward";
967
+ /**
968
+ * Existing Gmail draft ID from a prior create_or_update_gmail_draft response. REQUIRED to update an existing draft (any draftType). OMIT to create a new draft.
969
+ */
970
+ draftId?: string;
971
+ /**
972
+ * Gmail thread ID. Per draftType: reply=REQUIRED, forward=REQUIRED, standalone_draft=OMIT.
973
+ */
974
+ threadId?: string;
975
+ /**
976
+ * Specific Gmail message ID to reply to (requires threadId)
977
+ */
978
+ parentMessageId?: string;
979
+ /**
980
+ * Gmail send-as address controlled by the user
981
+ */
982
+ from: {
983
+ address: string;
984
+ name?: string;
985
+ };
986
+ /**
987
+ * Primary recipients
988
+ */
989
+ to?: Array<{
990
+ address: string;
991
+ name?: string;
992
+ }>;
993
+ /**
994
+ * CC recipients
995
+ */
996
+ cc?: Array<{
997
+ address: string;
998
+ name?: string;
999
+ }>;
1000
+ /**
1001
+ * BCC recipients
1002
+ */
1003
+ bcc?: Array<{
1004
+ address: string;
1005
+ name?: string;
1006
+ }>;
1007
+ /**
1008
+ * Subject line for the draft. Optional for replies/forwards when the subject is auto-generated.
1009
+ */
1010
+ subject?: string;
1011
+ /**
1012
+ * Plain text email body
1013
+ */
1014
+ text?: string;
1015
+ /**
1016
+ * HTML email body
1017
+ */
1018
+ html?: string;
1019
+ };
1020
+ /**
1021
+ * Canonical Tool Core output for the "Create Draft (Gmail)" effect (`mail.createOrUpdateGmailDraft`).
1022
+ * This is the definition's output schema; the effect's script surface may
1023
+ * re-encode it before returning.
1024
+ */
1025
+ export type CreateOrUpdateGmailDraftScriptOutput = {
1026
+ /**
1027
+ * Tool output content.
1028
+ */
1029
+ content: unknown;
1030
+ /**
1031
+ * Name of the Mail tool that ran.
1032
+ */
1033
+ name: string;
1034
+ /**
1035
+ * Whether the Mail service reported a tool error.
1036
+ */
1037
+ isError?: boolean;
1038
+ /**
1039
+ * Execution metadata reported by the MCP server.
1040
+ */
1041
+ metadata?: {
1042
+ /**
1043
+ * Tool execution time in milliseconds.
1044
+ */
1045
+ executionTimeMs?: number;
1046
+ /**
1047
+ * Number of bytes processed by the tool.
1048
+ */
1049
+ bytesProcessed?: number;
1050
+ /**
1051
+ * Tool execution cost reported by the MCP server.
1052
+ */
1053
+ cost?: number;
1054
+ };
1055
+ /**
1056
+ * Mail module name used for display.
1057
+ */
1058
+ moduleName?: string;
1059
+ /**
1060
+ * Structured tool output when provided by the Mail service.
1061
+ */
1062
+ structuredContent?: unknown;
1063
+ /**
1064
+ * Bounded HTTP-like Mail service error code.
1065
+ */
1066
+ toolErrorCode?: number;
1067
+ };
1068
+ /**
1069
+ * Script input for the "Create Draft (Outlook)" effect (`mail.createOrUpdateOutlookDraft`),
1070
+ * derived from its Tool Core definition's call_function input projection.
1071
+ *
1072
+ * Create or update a draft email in Outlook's drafts folder via Microsoft Graph. To send an Outlook draft, pass the returned draftId to send_existing_draft.
1073
+ */
1074
+ export type CreateOrUpdateOutlookDraftScriptInput = {
1075
+ /**
1076
+ * The user's email address
1077
+ */
1078
+ userEmailAddress: string;
1079
+ /**
1080
+ * Draft intent: "reply" for replies, "standalone_draft" for new emails, "forward" to forward a message.
1081
+ */
1082
+ draftType: "reply" | "standalone_draft" | "forward";
1083
+ /**
1084
+ * Existing Outlook draft ID from a prior create_or_update_outlook_draft response. REQUIRED to update an existing draft (any draftType). OMIT to create a new draft.
1085
+ */
1086
+ draftId?: string;
1087
+ /**
1088
+ * Outlook conversation ID. Per draftType: reply=REQUIRED, forward=REQUIRED, standalone_draft=OMIT.
1089
+ */
1090
+ conversationId?: string;
1091
+ /**
1092
+ * Specific Outlook message ID to reply to or forward (requires conversationId)
1093
+ */
1094
+ parentMessageId?: string;
1095
+ /**
1096
+ * Outlook send-as address controlled by the user
1097
+ */
1098
+ from: {
1099
+ address: string;
1100
+ name?: string;
1101
+ };
1102
+ /**
1103
+ * Primary recipients
1104
+ */
1105
+ to?: Array<{
1106
+ address: string;
1107
+ name?: string;
1108
+ }>;
1109
+ /**
1110
+ * CC recipients
1111
+ */
1112
+ cc?: Array<{
1113
+ address: string;
1114
+ name?: string;
1115
+ }>;
1116
+ /**
1117
+ * BCC recipients
1118
+ */
1119
+ bcc?: Array<{
1120
+ address: string;
1121
+ name?: string;
1122
+ }>;
1123
+ /**
1124
+ * Subject line for the draft. Optional for replies/forwards when the subject is auto-generated.
1125
+ */
1126
+ subject?: string;
1127
+ /**
1128
+ * Plain text email body
1129
+ */
1130
+ text?: string;
1131
+ /**
1132
+ * HTML email body
1133
+ */
1134
+ html?: string;
1135
+ };
1136
+ /**
1137
+ * Canonical Tool Core output for the "Create Draft (Outlook)" effect (`mail.createOrUpdateOutlookDraft`).
1138
+ * This is the definition's output schema; the effect's script surface may
1139
+ * re-encode it before returning.
1140
+ */
1141
+ export type CreateOrUpdateOutlookDraftScriptOutput = {
1142
+ /**
1143
+ * Tool output content.
1144
+ */
1145
+ content: unknown;
1146
+ /**
1147
+ * Name of the Mail tool that ran.
1148
+ */
1149
+ name: string;
1150
+ /**
1151
+ * Whether the Mail service reported a tool error.
1152
+ */
1153
+ isError?: boolean;
1154
+ /**
1155
+ * Execution metadata reported by the MCP server.
1156
+ */
1157
+ metadata?: {
1158
+ /**
1159
+ * Tool execution time in milliseconds.
1160
+ */
1161
+ executionTimeMs?: number;
1162
+ /**
1163
+ * Number of bytes processed by the tool.
1164
+ */
1165
+ bytesProcessed?: number;
1166
+ /**
1167
+ * Tool execution cost reported by the MCP server.
1168
+ */
1169
+ cost?: number;
1170
+ };
1171
+ /**
1172
+ * Mail module name used for display.
1173
+ */
1174
+ moduleName?: string;
1175
+ /**
1176
+ * Structured tool output when provided by the Mail service.
1177
+ */
1178
+ structuredContent?: unknown;
1179
+ /**
1180
+ * Bounded HTTP-like Mail service error code.
1181
+ */
1182
+ toolErrorCode?: number;
1183
+ };
1184
+ /**
1185
+ * Script input for the "Create Outlook Category" effect (`mail.createOutlookCategory`),
1186
+ * derived from its Tool Core definition's call_function input projection.
1187
+ *
1188
+ * Create a new category in the user's Outlook master category list. Categories can then be applied to messages.
1189
+ */
1190
+ export type CreateOutlookCategoryScriptInput = {
1191
+ /**
1192
+ * The Outlook email address
1193
+ */
1194
+ userEmailAddress: string;
1195
+ /**
1196
+ * The category name. Must be unique. Immutable after creation.
1197
+ */
1198
+ displayName: string;
1199
+ /**
1200
+ * Color preset. Common: preset0=Red, preset1=Orange, preset4=Green, preset7=Blue, preset8=Purple.
1201
+ */
1202
+ color?: "None" | "preset0" | "preset1" | "preset2" | "preset3" | "preset4" | "preset5" | "preset6" | "preset7" | "preset8" | "preset9" | "preset10" | "preset11" | "preset12" | "preset13" | "preset14" | "preset15" | "preset16" | "preset17" | "preset18" | "preset19" | "preset20" | "preset21" | "preset22" | "preset23" | "preset24";
1203
+ };
1204
+ /**
1205
+ * Canonical Tool Core output for the "Create Outlook Category" effect (`mail.createOutlookCategory`).
1206
+ * This is the definition's output schema; the effect's script surface may
1207
+ * re-encode it before returning.
1208
+ */
1209
+ export type CreateOutlookCategoryScriptOutput = {
1210
+ /**
1211
+ * Tool output content.
1212
+ */
1213
+ content: unknown;
1214
+ /**
1215
+ * Name of the Mail tool that ran.
1216
+ */
1217
+ name: string;
1218
+ /**
1219
+ * Whether the Mail service reported a tool error.
1220
+ */
1221
+ isError?: boolean;
1222
+ /**
1223
+ * Execution metadata reported by the MCP server.
1224
+ */
1225
+ metadata?: {
1226
+ /**
1227
+ * Tool execution time in milliseconds.
1228
+ */
1229
+ executionTimeMs?: number;
1230
+ /**
1231
+ * Number of bytes processed by the tool.
1232
+ */
1233
+ bytesProcessed?: number;
1234
+ /**
1235
+ * Tool execution cost reported by the MCP server.
1236
+ */
1237
+ cost?: number;
1238
+ };
1239
+ /**
1240
+ * Mail module name used for display.
1241
+ */
1242
+ moduleName?: string;
1243
+ /**
1244
+ * Structured tool output when provided by the Mail service.
1245
+ */
1246
+ structuredContent?: unknown;
1247
+ /**
1248
+ * Bounded HTTP-like Mail service error code.
1249
+ */
1250
+ toolErrorCode?: number;
1251
+ };
1252
+ /**
1253
+ * Script input for the "Create Outlook Folder" effect (`mail.createOutlookFolder`),
1254
+ * derived from its Tool Core definition's call_function input projection.
1255
+ *
1256
+ * Create a new mail folder in the user's Outlook mailbox
1257
+ */
1258
+ export type CreateOutlookFolderScriptInput = {
1259
+ /**
1260
+ * The email address of the Outlook mailbox
1261
+ */
1262
+ userEmailAddress: string;
1263
+ /**
1264
+ * Name of the folder to create
1265
+ */
1266
+ folderName: string;
1267
+ /**
1268
+ * Optional parent folder ID to create a subfolder. Omit to create at the top level.
1269
+ */
1270
+ parentFolderId?: string;
1271
+ };
1272
+ /**
1273
+ * Canonical Tool Core output for the "Create Outlook Folder" effect (`mail.createOutlookFolder`).
1274
+ * This is the definition's output schema; the effect's script surface may
1275
+ * re-encode it before returning.
1276
+ */
1277
+ export type CreateOutlookFolderScriptOutput = {
1278
+ /**
1279
+ * Tool output content.
1280
+ */
1281
+ content: unknown;
1282
+ /**
1283
+ * Name of the Mail tool that ran.
1284
+ */
1285
+ name: string;
1286
+ /**
1287
+ * Whether the Mail service reported a tool error.
1288
+ */
1289
+ isError?: boolean;
1290
+ /**
1291
+ * Execution metadata reported by the MCP server.
1292
+ */
1293
+ metadata?: {
1294
+ /**
1295
+ * Tool execution time in milliseconds.
1296
+ */
1297
+ executionTimeMs?: number;
1298
+ /**
1299
+ * Number of bytes processed by the tool.
1300
+ */
1301
+ bytesProcessed?: number;
1302
+ /**
1303
+ * Tool execution cost reported by the MCP server.
1304
+ */
1305
+ cost?: number;
1306
+ };
1307
+ /**
1308
+ * Mail module name used for display.
1309
+ */
1310
+ moduleName?: string;
1311
+ /**
1312
+ * Structured tool output when provided by the Mail service.
1313
+ */
1314
+ structuredContent?: unknown;
1315
+ /**
1316
+ * Bounded HTTP-like Mail service error code.
1317
+ */
1318
+ toolErrorCode?: number;
1319
+ };
1320
+ /**
1321
+ * Script input for the "Create Outlook Rule" effect (`mail.createOutlookRule`),
1322
+ * derived from its Tool Core definition's call_function input projection.
1323
+ *
1324
+ * Create a new inbox rule in the user's Outlook mailbox to automatically process incoming messages
1325
+ */
1326
+ export type CreateOutlookRuleScriptInput = {
1327
+ /**
1328
+ * Display name for the rule
1329
+ */
1330
+ displayName: string;
1331
+ /**
1332
+ * Execution order (lower = earlier). Omit to append at end.
1333
+ */
1334
+ sequence?: number;
1335
+ /**
1336
+ * Whether the rule is active (defaults to enabled when omitted)
1337
+ */
1338
+ isEnabled?: boolean;
1339
+ conditions: {
1340
+ bodyContains?: Array<string>;
1341
+ bodyOrSubjectContains?: Array<string>;
1342
+ categories?: Array<string>;
1343
+ fromAddresses?: Array<{
1344
+ address: string;
1345
+ name?: string;
1346
+ }>;
1347
+ hasAttachments?: boolean;
1348
+ headerContains?: Array<string>;
1349
+ importance?: "low" | "normal" | "high";
1350
+ isApprovalRequest?: boolean;
1351
+ isAutomaticForward?: boolean;
1352
+ isAutomaticReply?: boolean;
1353
+ isEncrypted?: boolean;
1354
+ isMeetingRequest?: boolean;
1355
+ isMeetingResponse?: boolean;
1356
+ isNonDeliveryReport?: boolean;
1357
+ isPermissionControlled?: boolean;
1358
+ isReadReceipt?: boolean;
1359
+ isSigned?: boolean;
1360
+ isVoicemail?: boolean;
1361
+ messageActionFlag?: "any" | "call" | "doNotForward" | "followUp" | "fyi" | "forward" | "noResponseNecessary" | "read" | "reply" | "replyToAll" | "review";
1362
+ notSentToMe?: boolean;
1363
+ recipientContains?: Array<string>;
1364
+ senderContains?: Array<string>;
1365
+ sensitivity?: "normal" | "personal" | "private" | "confidential";
1366
+ sentCcMe?: boolean;
1367
+ sentOnlyToMe?: boolean;
1368
+ sentToMe?: boolean;
1369
+ sentToOrCcMe?: boolean;
1370
+ sentToAddresses?: Array<{
1371
+ address: string;
1372
+ name?: string;
1373
+ }>;
1374
+ subjectContains?: Array<string>;
1375
+ withinSizeRange?: {
1376
+ minimumSize?: number;
1377
+ maximumSize?: number;
1378
+ };
1379
+ };
1380
+ /**
1381
+ * Actions to take when conditions are met (at least one non-empty field required)
1382
+ */
1383
+ actions: {
1384
+ /**
1385
+ * Categories to assign
1386
+ */
1387
+ assignCategories?: Array<string>;
1388
+ /**
1389
+ * Folder ID to copy to (use list_outlook_folders to find IDs)
1390
+ */
1391
+ copyToFolder?: string;
1392
+ /**
1393
+ * Move to Deleted Items
1394
+ */
1395
+ delete?: boolean;
1396
+ /**
1397
+ * Forward as attachment to these addresses
1398
+ */
1399
+ forwardAsAttachmentTo?: Array<{
1400
+ /**
1401
+ * Email address
1402
+ */
1403
+ address: string;
1404
+ /**
1405
+ * Display name (optional)
1406
+ */
1407
+ name?: string;
1408
+ }>;
1409
+ /**
1410
+ * Forward to these addresses
1411
+ */
1412
+ forwardTo?: Array<{
1413
+ /**
1414
+ * Email address
1415
+ */
1416
+ address: string;
1417
+ /**
1418
+ * Display name (optional)
1419
+ */
1420
+ name?: string;
1421
+ }>;
1422
+ /**
1423
+ * Mark as read
1424
+ */
1425
+ markAsRead?: boolean;
1426
+ /**
1427
+ * Set importance level
1428
+ */
1429
+ markImportance?: "low" | "normal" | "high";
1430
+ /**
1431
+ * Folder ID to move to (use list_outlook_folders to find IDs)
1432
+ */
1433
+ moveToFolder?: string;
1434
+ /**
1435
+ * Permanently delete (skip Deleted Items)
1436
+ */
1437
+ permanentDelete?: boolean;
1438
+ /**
1439
+ * Redirect to these addresses
1440
+ */
1441
+ redirectTo?: Array<{
1442
+ /**
1443
+ * Email address
1444
+ */
1445
+ address: string;
1446
+ /**
1447
+ * Display name (optional)
1448
+ */
1449
+ name?: string;
1450
+ }>;
1451
+ /**
1452
+ * Stop processing subsequent rules
1453
+ */
1454
+ stopProcessingRules?: boolean;
1455
+ };
1456
+ exceptions?: {
1457
+ bodyContains?: Array<string>;
1458
+ bodyOrSubjectContains?: Array<string>;
1459
+ categories?: Array<string>;
1460
+ fromAddresses?: Array<{
1461
+ address: string;
1462
+ name?: string;
1463
+ }>;
1464
+ hasAttachments?: boolean;
1465
+ headerContains?: Array<string>;
1466
+ importance?: "low" | "normal" | "high";
1467
+ isApprovalRequest?: boolean;
1468
+ isAutomaticForward?: boolean;
1469
+ isAutomaticReply?: boolean;
1470
+ isEncrypted?: boolean;
1471
+ isMeetingRequest?: boolean;
1472
+ isMeetingResponse?: boolean;
1473
+ isNonDeliveryReport?: boolean;
1474
+ isPermissionControlled?: boolean;
1475
+ isReadReceipt?: boolean;
1476
+ isSigned?: boolean;
1477
+ isVoicemail?: boolean;
1478
+ messageActionFlag?: "any" | "call" | "doNotForward" | "followUp" | "fyi" | "forward" | "noResponseNecessary" | "read" | "reply" | "replyToAll" | "review";
1479
+ notSentToMe?: boolean;
1480
+ recipientContains?: Array<string>;
1481
+ senderContains?: Array<string>;
1482
+ sensitivity?: "normal" | "personal" | "private" | "confidential";
1483
+ sentCcMe?: boolean;
1484
+ sentOnlyToMe?: boolean;
1485
+ sentToMe?: boolean;
1486
+ sentToOrCcMe?: boolean;
1487
+ sentToAddresses?: Array<{
1488
+ address: string;
1489
+ name?: string;
1490
+ }>;
1491
+ subjectContains?: Array<string>;
1492
+ withinSizeRange?: {
1493
+ minimumSize?: number;
1494
+ maximumSize?: number;
1495
+ };
1496
+ };
1497
+ /**
1498
+ * The Outlook email address
1499
+ */
1500
+ userEmailAddress: string;
1501
+ };
1502
+ /**
1503
+ * Canonical Tool Core output for the "Create Outlook Rule" effect (`mail.createOutlookRule`).
1504
+ * This is the definition's output schema; the effect's script surface may
1505
+ * re-encode it before returning.
1506
+ */
1507
+ export type CreateOutlookRuleScriptOutput = {
1508
+ /**
1509
+ * Tool output content.
1510
+ */
1511
+ content: unknown;
1512
+ /**
1513
+ * Name of the Mail tool that ran.
1514
+ */
1515
+ name: string;
1516
+ /**
1517
+ * Whether the Mail service reported a tool error.
1518
+ */
1519
+ isError?: boolean;
1520
+ /**
1521
+ * Execution metadata reported by the MCP server.
1522
+ */
1523
+ metadata?: {
1524
+ /**
1525
+ * Tool execution time in milliseconds.
1526
+ */
1527
+ executionTimeMs?: number;
1528
+ /**
1529
+ * Number of bytes processed by the tool.
1530
+ */
1531
+ bytesProcessed?: number;
1532
+ /**
1533
+ * Tool execution cost reported by the MCP server.
1534
+ */
1535
+ cost?: number;
1536
+ };
1537
+ /**
1538
+ * Mail module name used for display.
1539
+ */
1540
+ moduleName?: string;
1541
+ /**
1542
+ * Structured tool output when provided by the Mail service.
1543
+ */
1544
+ structuredContent?: unknown;
1545
+ /**
1546
+ * Bounded HTTP-like Mail service error code.
1547
+ */
1548
+ toolErrorCode?: number;
1549
+ };
1550
+ /**
1551
+ * Script input for the "Create Status Column" effect (`mail.createStatusColumn`),
1552
+ * derived from its Tool Core definition's call_function input projection.
1553
+ *
1554
+ * Create a new status property column for emails
1555
+ */
1556
+ export type CreateStatusColumnScriptInput = {
1557
+ /**
1558
+ * The email address of the mailbox
1559
+ */
1560
+ userEmailAddress: string;
1561
+ /**
1562
+ * Name of the status column
1563
+ */
1564
+ propertyName: string;
1565
+ /**
1566
+ * Status options for the column
1567
+ */
1568
+ options: Array<{
1569
+ /**
1570
+ * Display name for the option
1571
+ */
1572
+ name: string;
1573
+ style: {
1574
+ color: "light-gray" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
1575
+ icon: "star" | "xmark" | "check" | "warning" | "play" | "reply" | "dot" | "noStatus" | "todoReply" | "waitingClock";
1576
+ };
1577
+ /**
1578
+ * Whether this is the default option
1579
+ */
1580
+ isDefault?: boolean;
1581
+ }>;
1582
+ /**
1583
+ * Optional layout ID to attach the column to
1584
+ */
1585
+ layoutID?: string;
1586
+ };
1587
+ /**
1588
+ * Canonical Tool Core output for the "Create Status Column" effect (`mail.createStatusColumn`).
1589
+ * This is the definition's output schema; the effect's script surface may
1590
+ * re-encode it before returning.
1591
+ */
1592
+ export type CreateStatusColumnScriptOutput = {
1593
+ /**
1594
+ * Tool output content.
1595
+ */
1596
+ content: unknown;
1597
+ /**
1598
+ * Name of the Mail tool that ran.
1599
+ */
1600
+ name: string;
1601
+ /**
1602
+ * Whether the Mail service reported a tool error.
1603
+ */
1604
+ isError?: boolean;
1605
+ /**
1606
+ * Execution metadata reported by the MCP server.
1607
+ */
1608
+ metadata?: {
1609
+ /**
1610
+ * Tool execution time in milliseconds.
1611
+ */
1612
+ executionTimeMs?: number;
1613
+ /**
1614
+ * Number of bytes processed by the tool.
1615
+ */
1616
+ bytesProcessed?: number;
1617
+ /**
1618
+ * Tool execution cost reported by the MCP server.
1619
+ */
1620
+ cost?: number;
1621
+ };
1622
+ /**
1623
+ * Mail module name used for display.
1624
+ */
1625
+ moduleName?: string;
1626
+ /**
1627
+ * Structured tool output when provided by the Mail service.
1628
+ */
1629
+ structuredContent?: unknown;
1630
+ /**
1631
+ * Bounded HTTP-like Mail service error code.
1632
+ */
1633
+ toolErrorCode?: number;
1634
+ };
1635
+ /**
1636
+ * Script input for the "Delete Gmail Filter" effect (`mail.deleteGmailFilter`),
1637
+ * derived from its Tool Core definition's call_function input projection.
1638
+ *
1639
+ * Delete an existing Gmail filter
1640
+ */
1641
+ export type DeleteGmailFilterScriptInput = {
1642
+ /**
1643
+ * The email address of the Gmail account
1644
+ */
1645
+ userEmailAddress: string;
1646
+ /**
1647
+ * The ID of the filter to delete
1648
+ */
1649
+ filterId: string;
1650
+ };
1651
+ /**
1652
+ * Canonical Tool Core output for the "Delete Gmail Filter" effect (`mail.deleteGmailFilter`).
1653
+ * This is the definition's output schema; the effect's script surface may
1654
+ * re-encode it before returning.
1655
+ */
1656
+ export type DeleteGmailFilterScriptOutput = {
1657
+ /**
1658
+ * Tool output content.
1659
+ */
1660
+ content: unknown;
1661
+ /**
1662
+ * Name of the Mail tool that ran.
1663
+ */
1664
+ name: string;
1665
+ /**
1666
+ * Whether the Mail service reported a tool error.
1667
+ */
1668
+ isError?: boolean;
1669
+ /**
1670
+ * Execution metadata reported by the MCP server.
1671
+ */
1672
+ metadata?: {
1673
+ /**
1674
+ * Tool execution time in milliseconds.
1675
+ */
1676
+ executionTimeMs?: number;
1677
+ /**
1678
+ * Number of bytes processed by the tool.
1679
+ */
1680
+ bytesProcessed?: number;
1681
+ /**
1682
+ * Tool execution cost reported by the MCP server.
1683
+ */
1684
+ cost?: number;
1685
+ };
1686
+ /**
1687
+ * Mail module name used for display.
1688
+ */
1689
+ moduleName?: string;
1690
+ /**
1691
+ * Structured tool output when provided by the Mail service.
1692
+ */
1693
+ structuredContent?: unknown;
1694
+ /**
1695
+ * Bounded HTTP-like Mail service error code.
1696
+ */
1697
+ toolErrorCode?: number;
1698
+ };
1699
+ /**
1700
+ * Script input for the "Delete Label" effect (`mail.deleteLabel`),
1701
+ * derived from its Tool Core definition's call_function input projection.
1702
+ *
1703
+ * Delete a label from the mailbox
1704
+ */
1705
+ export type DeleteLabelScriptInput = {
1706
+ /**
1707
+ * The email address of the mailbox
1708
+ */
1709
+ userEmailAddress: string;
1710
+ /**
1711
+ * ID of the label to delete
1712
+ */
1713
+ labelID: string;
1714
+ };
1715
+ /**
1716
+ * Canonical Tool Core output for the "Delete Label" effect (`mail.deleteLabel`).
1717
+ * This is the definition's output schema; the effect's script surface may
1718
+ * re-encode it before returning.
1719
+ */
1720
+ export type DeleteLabelScriptOutput = {
1721
+ /**
1722
+ * Tool output content.
1723
+ */
1724
+ content: unknown;
1725
+ /**
1726
+ * Name of the Mail tool that ran.
1727
+ */
1728
+ name: string;
1729
+ /**
1730
+ * Whether the Mail service reported a tool error.
1731
+ */
1732
+ isError?: boolean;
1733
+ /**
1734
+ * Execution metadata reported by the MCP server.
1735
+ */
1736
+ metadata?: {
1737
+ /**
1738
+ * Tool execution time in milliseconds.
1739
+ */
1740
+ executionTimeMs?: number;
1741
+ /**
1742
+ * Number of bytes processed by the tool.
1743
+ */
1744
+ bytesProcessed?: number;
1745
+ /**
1746
+ * Tool execution cost reported by the MCP server.
1747
+ */
1748
+ cost?: number;
1749
+ };
1750
+ /**
1751
+ * Mail module name used for display.
1752
+ */
1753
+ moduleName?: string;
1754
+ /**
1755
+ * Structured tool output when provided by the Mail service.
1756
+ */
1757
+ structuredContent?: unknown;
1758
+ /**
1759
+ * Bounded HTTP-like Mail service error code.
1760
+ */
1761
+ toolErrorCode?: number;
1762
+ };
1763
+ /**
1764
+ * Script input for the "Delete Outlook Category" effect (`mail.deleteOutlookCategory`),
1765
+ * derived from its Tool Core definition's call_function input projection.
1766
+ *
1767
+ * Permanently remove a category from the user's Outlook master category list. Messages already tagged retain the category name.
1768
+ */
1769
+ export type DeleteOutlookCategoryScriptInput = {
1770
+ /**
1771
+ * The Outlook email address
1772
+ */
1773
+ userEmailAddress: string;
1774
+ /**
1775
+ * The category ID (from list_outlook_categories).
1776
+ */
1777
+ categoryId: string;
1778
+ };
1779
+ /**
1780
+ * Canonical Tool Core output for the "Delete Outlook Category" effect (`mail.deleteOutlookCategory`).
1781
+ * This is the definition's output schema; the effect's script surface may
1782
+ * re-encode it before returning.
1783
+ */
1784
+ export type DeleteOutlookCategoryScriptOutput = {
1785
+ /**
1786
+ * Tool output content.
1787
+ */
1788
+ content: unknown;
1789
+ /**
1790
+ * Name of the Mail tool that ran.
1791
+ */
1792
+ name: string;
1793
+ /**
1794
+ * Whether the Mail service reported a tool error.
1795
+ */
1796
+ isError?: boolean;
1797
+ /**
1798
+ * Execution metadata reported by the MCP server.
1799
+ */
1800
+ metadata?: {
1801
+ /**
1802
+ * Tool execution time in milliseconds.
1803
+ */
1804
+ executionTimeMs?: number;
1805
+ /**
1806
+ * Number of bytes processed by the tool.
1807
+ */
1808
+ bytesProcessed?: number;
1809
+ /**
1810
+ * Tool execution cost reported by the MCP server.
1811
+ */
1812
+ cost?: number;
1813
+ };
1814
+ /**
1815
+ * Mail module name used for display.
1816
+ */
1817
+ moduleName?: string;
1818
+ /**
1819
+ * Structured tool output when provided by the Mail service.
1820
+ */
1821
+ structuredContent?: unknown;
1822
+ /**
1823
+ * Bounded HTTP-like Mail service error code.
1824
+ */
1825
+ toolErrorCode?: number;
1826
+ };
1827
+ /**
1828
+ * Script input for the "Delete Outlook Rule" effect (`mail.deleteOutlookRule`),
1829
+ * derived from its Tool Core definition's call_function input projection.
1830
+ *
1831
+ * Permanently delete an inbox rule from the user's Outlook mailbox
1832
+ */
1833
+ export type DeleteOutlookRuleScriptInput = {
1834
+ /**
1835
+ * Rule ID to delete (use list_outlook_rules to find IDs)
1836
+ */
1837
+ ruleId: string;
1838
+ /**
1839
+ * Opaque etag from a prior list_outlook_rules response. If provided, the delete fails with an ABORTED error when the rule was modified since you listed it. Omit for last-write-wins.
1840
+ */
1841
+ etag?: string;
1842
+ /**
1843
+ * The Outlook email address
1844
+ */
1845
+ userEmailAddress: string;
1846
+ };
1847
+ /**
1848
+ * Canonical Tool Core output for the "Delete Outlook Rule" effect (`mail.deleteOutlookRule`).
1849
+ * This is the definition's output schema; the effect's script surface may
1850
+ * re-encode it before returning.
1851
+ */
1852
+ export type DeleteOutlookRuleScriptOutput = {
1853
+ /**
1854
+ * Tool output content.
1855
+ */
1856
+ content: unknown;
1857
+ /**
1858
+ * Name of the Mail tool that ran.
1859
+ */
1860
+ name: string;
1861
+ /**
1862
+ * Whether the Mail service reported a tool error.
1863
+ */
1864
+ isError?: boolean;
1865
+ /**
1866
+ * Execution metadata reported by the MCP server.
1867
+ */
1868
+ metadata?: {
1869
+ /**
1870
+ * Tool execution time in milliseconds.
1871
+ */
1872
+ executionTimeMs?: number;
1873
+ /**
1874
+ * Number of bytes processed by the tool.
1875
+ */
1876
+ bytesProcessed?: number;
1877
+ /**
1878
+ * Tool execution cost reported by the MCP server.
1879
+ */
1880
+ cost?: number;
1881
+ };
1882
+ /**
1883
+ * Mail module name used for display.
1884
+ */
1885
+ moduleName?: string;
1886
+ /**
1887
+ * Structured tool output when provided by the Mail service.
1888
+ */
1889
+ structuredContent?: unknown;
1890
+ /**
1891
+ * Bounded HTTP-like Mail service error code.
1892
+ */
1893
+ toolErrorCode?: number;
1894
+ };
1895
+ /**
1896
+ * Script input for the "Flag Outlook Thread" effect (`mail.flagOutlookThread`),
1897
+ * derived from its Tool Core definition's call_function input projection.
1898
+ *
1899
+ * Set or clear the Outlook follow-up flag on one or more conversations, optionally with a reminder. Outlook's flag is the unified primitive for Gmail's star + reminder: pass flagged=true without reminderDateTime to 'star' the thread; pass flagged=true with reminderDateTime to schedule a reminder; pass flagged=false to clear both. Outlook accounts only — for Gmail accounts use star_thread or set_reminder / unset_reminder instead.
1900
+ */
1901
+ export type FlagOutlookThreadScriptInput = {
1902
+ /**
1903
+ * The Outlook email address
1904
+ */
1905
+ userEmailAddress: string;
1906
+ /**
1907
+ * One or more Outlook conversation IDs (obtained from search_emails as threadId).
1908
+ */
1909
+ conversationIDs: Array<string>;
1910
+ /**
1911
+ * true to flag the conversation, false to clear the flag and any reminder.
1912
+ */
1913
+ flagged: boolean;
1914
+ /**
1915
+ * Optional ISO 8601 datetime (with offset) to fire a reminder at. Only honored when flagged=true.
1916
+ */
1917
+ reminderDateTime?: string;
1918
+ };
1919
+ /**
1920
+ * Canonical Tool Core output for the "Flag Outlook Thread" effect (`mail.flagOutlookThread`).
1921
+ * This is the definition's output schema; the effect's script surface may
1922
+ * re-encode it before returning.
1923
+ */
1924
+ export type FlagOutlookThreadScriptOutput = {
1925
+ /**
1926
+ * Tool output content.
1927
+ */
1928
+ content: unknown;
1929
+ /**
1930
+ * Name of the Mail tool that ran.
1931
+ */
1932
+ name: string;
1933
+ /**
1934
+ * Whether the Mail service reported a tool error.
1935
+ */
1936
+ isError?: boolean;
1937
+ /**
1938
+ * Execution metadata reported by the MCP server.
1939
+ */
1940
+ metadata?: {
1941
+ /**
1942
+ * Tool execution time in milliseconds.
1943
+ */
1944
+ executionTimeMs?: number;
1945
+ /**
1946
+ * Number of bytes processed by the tool.
1947
+ */
1948
+ bytesProcessed?: number;
1949
+ /**
1950
+ * Tool execution cost reported by the MCP server.
1951
+ */
1952
+ cost?: number;
1953
+ };
1954
+ /**
1955
+ * Mail module name used for display.
1956
+ */
1957
+ moduleName?: string;
1958
+ /**
1959
+ * Structured tool output when provided by the Mail service.
1960
+ */
1961
+ structuredContent?: unknown;
1962
+ /**
1963
+ * Bounded HTTP-like Mail service error code.
1964
+ */
1965
+ toolErrorCode?: number;
1966
+ };
1967
+ /**
1968
+ * Script input for the "Get Notion Mail Notification Preferences" effect (`mail.getNotificationPreferences`),
1969
+ * derived from its Tool Core definition's call_function input projection.
1970
+ *
1971
+ * Retrieve the Notion Mail notification preferences for the user's email accounts across all levels (account, view, and sender). This tool is specific to Notion Mail notification settings only — it does not read or modify notification settings for Gmail, Outlook, or any other email provider.
1972
+ */
1973
+ export type GetNotificationPreferencesScriptInput = {
1974
+ /**
1975
+ * The Notion Mail email address of the account to get notification preferences for. Must be an account connected to Notion Mail.
1976
+ */
1977
+ userEmailAddress: string;
1978
+ /**
1979
+ * Filter which preference levels to return. Valid values: "account", "view", "sender". Omit to return all levels.
1980
+ */
1981
+ levels?: Array<"account" | "view" | "sender">;
1982
+ };
1983
+ /**
1984
+ * Canonical Tool Core output for the "Get Notion Mail Notification Preferences" effect (`mail.getNotificationPreferences`).
1985
+ * This is the definition's output schema; the effect's script surface may
1986
+ * re-encode it before returning.
1987
+ */
1988
+ export type GetNotificationPreferencesScriptOutput = {
1989
+ /**
1990
+ * Tool output content.
1991
+ */
1992
+ content: unknown;
1993
+ /**
1994
+ * Name of the Mail tool that ran.
1995
+ */
1996
+ name: string;
1997
+ /**
1998
+ * Whether the Mail service reported a tool error.
1999
+ */
2000
+ isError?: boolean;
2001
+ /**
2002
+ * Execution metadata reported by the MCP server.
2003
+ */
2004
+ metadata?: {
2005
+ /**
2006
+ * Tool execution time in milliseconds.
2007
+ */
2008
+ executionTimeMs?: number;
2009
+ /**
2010
+ * Number of bytes processed by the tool.
2011
+ */
2012
+ bytesProcessed?: number;
2013
+ /**
2014
+ * Tool execution cost reported by the MCP server.
2015
+ */
2016
+ cost?: number;
2017
+ };
2018
+ /**
2019
+ * Mail module name used for display.
2020
+ */
2021
+ moduleName?: string;
2022
+ /**
2023
+ * Structured tool output when provided by the Mail service.
2024
+ */
2025
+ structuredContent?: unknown;
2026
+ /**
2027
+ * Bounded HTTP-like Mail service error code.
2028
+ */
2029
+ toolErrorCode?: number;
2030
+ };
2031
+ /**
2032
+ * Script input for the "Health Check" effect (`mail.healthCheck`),
2033
+ * derived from its Tool Core definition's call_function input projection.
2034
+ *
2035
+ * Check if the mail service is healthy and accessible
2036
+ */
2037
+ export type HealthCheckScriptInput = Record<string, unknown>;
2038
+ /**
2039
+ * Canonical Tool Core output for the "Health Check" effect (`mail.healthCheck`).
2040
+ * This is the definition's output schema; the effect's script surface may
2041
+ * re-encode it before returning.
2042
+ */
2043
+ export type HealthCheckScriptOutput = {
2044
+ /**
2045
+ * Tool output content.
2046
+ */
2047
+ content: unknown;
2048
+ /**
2049
+ * Name of the Mail tool that ran.
2050
+ */
2051
+ name: string;
2052
+ /**
2053
+ * Whether the Mail service reported a tool error.
2054
+ */
2055
+ isError?: boolean;
2056
+ /**
2057
+ * Execution metadata reported by the MCP server.
2058
+ */
2059
+ metadata?: {
2060
+ /**
2061
+ * Tool execution time in milliseconds.
2062
+ */
2063
+ executionTimeMs?: number;
2064
+ /**
2065
+ * Number of bytes processed by the tool.
2066
+ */
2067
+ bytesProcessed?: number;
2068
+ /**
2069
+ * Tool execution cost reported by the MCP server.
2070
+ */
2071
+ cost?: number;
2072
+ };
2073
+ /**
2074
+ * Mail module name used for display.
2075
+ */
2076
+ moduleName?: string;
2077
+ /**
2078
+ * Structured tool output when provided by the Mail service.
2079
+ */
2080
+ structuredContent?: unknown;
2081
+ /**
2082
+ * Bounded HTTP-like Mail service error code.
2083
+ */
2084
+ toolErrorCode?: number;
2085
+ };
2086
+ /**
2087
+ * Script input for the "List Gmail Filters" effect (`mail.listGmailFilters`),
2088
+ * derived from its Tool Core definition's call_function input projection.
2089
+ *
2090
+ * List all Gmail filters for the user's account
2091
+ */
2092
+ export type ListGmailFiltersScriptInput = {
2093
+ /**
2094
+ * The email address of the Gmail account
2095
+ */
2096
+ userEmailAddress: string;
2097
+ };
2098
+ /**
2099
+ * Canonical Tool Core output for the "List Gmail Filters" effect (`mail.listGmailFilters`).
2100
+ * This is the definition's output schema; the effect's script surface may
2101
+ * re-encode it before returning.
2102
+ */
2103
+ export type ListGmailFiltersScriptOutput = {
2104
+ /**
2105
+ * Tool output content.
2106
+ */
2107
+ content: unknown;
2108
+ /**
2109
+ * Name of the Mail tool that ran.
2110
+ */
2111
+ name: string;
2112
+ /**
2113
+ * Whether the Mail service reported a tool error.
2114
+ */
2115
+ isError?: boolean;
2116
+ /**
2117
+ * Execution metadata reported by the MCP server.
2118
+ */
2119
+ metadata?: {
2120
+ /**
2121
+ * Tool execution time in milliseconds.
2122
+ */
2123
+ executionTimeMs?: number;
2124
+ /**
2125
+ * Number of bytes processed by the tool.
2126
+ */
2127
+ bytesProcessed?: number;
2128
+ /**
2129
+ * Tool execution cost reported by the MCP server.
2130
+ */
2131
+ cost?: number;
2132
+ };
2133
+ /**
2134
+ * Mail module name used for display.
2135
+ */
2136
+ moduleName?: string;
2137
+ /**
2138
+ * Structured tool output when provided by the Mail service.
2139
+ */
2140
+ structuredContent?: unknown;
2141
+ /**
2142
+ * Bounded HTTP-like Mail service error code.
2143
+ */
2144
+ toolErrorCode?: number;
2145
+ };
2146
+ /**
2147
+ * Script input for the "List Labels" effect (`mail.listLabels`),
2148
+ * derived from its Tool Core definition's call_function input projection.
2149
+ *
2150
+ * List all labels in the mailbox
2151
+ */
2152
+ export type ListLabelsScriptInput = {
2153
+ /**
2154
+ * The email address of the mailbox
2155
+ */
2156
+ userEmailAddress: string;
2157
+ };
2158
+ /**
2159
+ * Canonical Tool Core output for the "List Labels" effect (`mail.listLabels`).
2160
+ * This is the definition's output schema; the effect's script surface may
2161
+ * re-encode it before returning.
2162
+ */
2163
+ export type ListLabelsScriptOutput = {
2164
+ /**
2165
+ * Tool output content.
2166
+ */
2167
+ content: unknown;
2168
+ /**
2169
+ * Name of the Mail tool that ran.
2170
+ */
2171
+ name: string;
2172
+ /**
2173
+ * Whether the Mail service reported a tool error.
2174
+ */
2175
+ isError?: boolean;
2176
+ /**
2177
+ * Execution metadata reported by the MCP server.
2178
+ */
2179
+ metadata?: {
2180
+ /**
2181
+ * Tool execution time in milliseconds.
2182
+ */
2183
+ executionTimeMs?: number;
2184
+ /**
2185
+ * Number of bytes processed by the tool.
2186
+ */
2187
+ bytesProcessed?: number;
2188
+ /**
2189
+ * Tool execution cost reported by the MCP server.
2190
+ */
2191
+ cost?: number;
2192
+ };
2193
+ /**
2194
+ * Mail module name used for display.
2195
+ */
2196
+ moduleName?: string;
2197
+ /**
2198
+ * Structured tool output when provided by the Mail service.
2199
+ */
2200
+ structuredContent?: unknown;
2201
+ /**
2202
+ * Bounded HTTP-like Mail service error code.
2203
+ */
2204
+ toolErrorCode?: number;
2205
+ };
2206
+ /**
2207
+ * Script input for the "List Mailbox Views" effect (`mail.listMailboxViews`),
2208
+ * derived from its Tool Core definition's call_function input projection.
2209
+ *
2210
+ * List the user's notification-eligible mailbox views: the Inbox plus custom user-created views. Other system views (Sent, Drafts, Trash, Spam) and suggested views are NOT returned.
2211
+ */
2212
+ export type ListMailboxViewsScriptInput = {
2213
+ /**
2214
+ * The email address of the mailbox
2215
+ */
2216
+ userEmailAddress: string;
2217
+ };
2218
+ /**
2219
+ * Canonical Tool Core output for the "List Mailbox Views" effect (`mail.listMailboxViews`).
2220
+ * This is the definition's output schema; the effect's script surface may
2221
+ * re-encode it before returning.
2222
+ */
2223
+ export type ListMailboxViewsScriptOutput = {
2224
+ /**
2225
+ * Tool output content.
2226
+ */
2227
+ content: unknown;
2228
+ /**
2229
+ * Name of the Mail tool that ran.
2230
+ */
2231
+ name: string;
2232
+ /**
2233
+ * Whether the Mail service reported a tool error.
2234
+ */
2235
+ isError?: boolean;
2236
+ /**
2237
+ * Execution metadata reported by the MCP server.
2238
+ */
2239
+ metadata?: {
2240
+ /**
2241
+ * Tool execution time in milliseconds.
2242
+ */
2243
+ executionTimeMs?: number;
2244
+ /**
2245
+ * Number of bytes processed by the tool.
2246
+ */
2247
+ bytesProcessed?: number;
2248
+ /**
2249
+ * Tool execution cost reported by the MCP server.
2250
+ */
2251
+ cost?: number;
2252
+ };
2253
+ /**
2254
+ * Mail module name used for display.
2255
+ */
2256
+ moduleName?: string;
2257
+ /**
2258
+ * Structured tool output when provided by the Mail service.
2259
+ */
2260
+ structuredContent?: unknown;
2261
+ /**
2262
+ * Bounded HTTP-like Mail service error code.
2263
+ */
2264
+ toolErrorCode?: number;
2265
+ };
2266
+ /**
2267
+ * Script input for the "List Outlook Categories" effect (`mail.listOutlookCategories`),
2268
+ * derived from its Tool Core definition's call_function input projection.
2269
+ *
2270
+ * List all categories in the user's Outlook master category list
2271
+ */
2272
+ export type ListOutlookCategoriesScriptInput = {
2273
+ /**
2274
+ * The Outlook email address
2275
+ */
2276
+ userEmailAddress: string;
2277
+ };
2278
+ /**
2279
+ * Canonical Tool Core output for the "List Outlook Categories" effect (`mail.listOutlookCategories`).
2280
+ * This is the definition's output schema; the effect's script surface may
2281
+ * re-encode it before returning.
2282
+ */
2283
+ export type ListOutlookCategoriesScriptOutput = {
2284
+ /**
2285
+ * Tool output content.
2286
+ */
2287
+ content: unknown;
2288
+ /**
2289
+ * Name of the Mail tool that ran.
2290
+ */
2291
+ name: string;
2292
+ /**
2293
+ * Whether the Mail service reported a tool error.
2294
+ */
2295
+ isError?: boolean;
2296
+ /**
2297
+ * Execution metadata reported by the MCP server.
2298
+ */
2299
+ metadata?: {
2300
+ /**
2301
+ * Tool execution time in milliseconds.
2302
+ */
2303
+ executionTimeMs?: number;
2304
+ /**
2305
+ * Number of bytes processed by the tool.
2306
+ */
2307
+ bytesProcessed?: number;
2308
+ /**
2309
+ * Tool execution cost reported by the MCP server.
2310
+ */
2311
+ cost?: number;
2312
+ };
2313
+ /**
2314
+ * Mail module name used for display.
2315
+ */
2316
+ moduleName?: string;
2317
+ /**
2318
+ * Structured tool output when provided by the Mail service.
2319
+ */
2320
+ structuredContent?: unknown;
2321
+ /**
2322
+ * Bounded HTTP-like Mail service error code.
2323
+ */
2324
+ toolErrorCode?: number;
2325
+ };
2326
+ /**
2327
+ * Script input for the "List Outlook Folders" effect (`mail.listOutlookFolders`),
2328
+ * derived from its Tool Core definition's call_function input projection.
2329
+ *
2330
+ * List all mail folders in the user's Outlook mailbox
2331
+ */
2332
+ export type ListOutlookFoldersScriptInput = {
2333
+ /**
2334
+ * The email address of the Outlook mailbox
2335
+ */
2336
+ userEmailAddress: string;
2337
+ };
2338
+ /**
2339
+ * Canonical Tool Core output for the "List Outlook Folders" effect (`mail.listOutlookFolders`).
2340
+ * This is the definition's output schema; the effect's script surface may
2341
+ * re-encode it before returning.
2342
+ */
2343
+ export type ListOutlookFoldersScriptOutput = {
2344
+ /**
2345
+ * Tool output content.
2346
+ */
2347
+ content: unknown;
2348
+ /**
2349
+ * Name of the Mail tool that ran.
2350
+ */
2351
+ name: string;
2352
+ /**
2353
+ * Whether the Mail service reported a tool error.
2354
+ */
2355
+ isError?: boolean;
2356
+ /**
2357
+ * Execution metadata reported by the MCP server.
2358
+ */
2359
+ metadata?: {
2360
+ /**
2361
+ * Tool execution time in milliseconds.
2362
+ */
2363
+ executionTimeMs?: number;
2364
+ /**
2365
+ * Number of bytes processed by the tool.
2366
+ */
2367
+ bytesProcessed?: number;
2368
+ /**
2369
+ * Tool execution cost reported by the MCP server.
2370
+ */
2371
+ cost?: number;
2372
+ };
2373
+ /**
2374
+ * Mail module name used for display.
2375
+ */
2376
+ moduleName?: string;
2377
+ /**
2378
+ * Structured tool output when provided by the Mail service.
2379
+ */
2380
+ structuredContent?: unknown;
2381
+ /**
2382
+ * Bounded HTTP-like Mail service error code.
2383
+ */
2384
+ toolErrorCode?: number;
2385
+ };
2386
+ /**
2387
+ * Script input for the "List Outlook Rules" effect (`mail.listOutlookRules`),
2388
+ * derived from its Tool Core definition's call_function input projection.
2389
+ *
2390
+ * List all inbox rules configured in the user's Outlook mailbox
2391
+ */
2392
+ export type ListOutlookRulesScriptInput = {
2393
+ /**
2394
+ * The Outlook email address
2395
+ */
2396
+ userEmailAddress: string;
2397
+ };
2398
+ /**
2399
+ * Canonical Tool Core output for the "List Outlook Rules" effect (`mail.listOutlookRules`).
2400
+ * This is the definition's output schema; the effect's script surface may
2401
+ * re-encode it before returning.
2402
+ */
2403
+ export type ListOutlookRulesScriptOutput = {
2404
+ /**
2405
+ * Tool output content.
2406
+ */
2407
+ content: unknown;
2408
+ /**
2409
+ * Name of the Mail tool that ran.
2410
+ */
2411
+ name: string;
2412
+ /**
2413
+ * Whether the Mail service reported a tool error.
2414
+ */
2415
+ isError?: boolean;
2416
+ /**
2417
+ * Execution metadata reported by the MCP server.
2418
+ */
2419
+ metadata?: {
2420
+ /**
2421
+ * Tool execution time in milliseconds.
2422
+ */
2423
+ executionTimeMs?: number;
2424
+ /**
2425
+ * Number of bytes processed by the tool.
2426
+ */
2427
+ bytesProcessed?: number;
2428
+ /**
2429
+ * Tool execution cost reported by the MCP server.
2430
+ */
2431
+ cost?: number;
2432
+ };
2433
+ /**
2434
+ * Mail module name used for display.
2435
+ */
2436
+ moduleName?: string;
2437
+ /**
2438
+ * Structured tool output when provided by the Mail service.
2439
+ */
2440
+ structuredContent?: unknown;
2441
+ /**
2442
+ * Bounded HTTP-like Mail service error code.
2443
+ */
2444
+ toolErrorCode?: number;
2445
+ };
2446
+ /**
2447
+ * Script input for the "List Status Properties" effect (`mail.listStatusProperties`),
2448
+ * derived from its Tool Core definition's call_function input projection.
2449
+ *
2450
+ * List available status properties (columns) for emails
2451
+ */
2452
+ export type ListStatusPropertiesScriptInput = {
2453
+ /**
2454
+ * The email address of the mailbox
2455
+ */
2456
+ userEmailAddress: string;
2457
+ };
2458
+ /**
2459
+ * Canonical Tool Core output for the "List Status Properties" effect (`mail.listStatusProperties`).
2460
+ * This is the definition's output schema; the effect's script surface may
2461
+ * re-encode it before returning.
2462
+ */
2463
+ export type ListStatusPropertiesScriptOutput = {
2464
+ /**
2465
+ * Tool output content.
2466
+ */
2467
+ content: unknown;
2468
+ /**
2469
+ * Name of the Mail tool that ran.
2470
+ */
2471
+ name: string;
2472
+ /**
2473
+ * Whether the Mail service reported a tool error.
2474
+ */
2475
+ isError?: boolean;
2476
+ /**
2477
+ * Execution metadata reported by the MCP server.
2478
+ */
2479
+ metadata?: {
2480
+ /**
2481
+ * Tool execution time in milliseconds.
2482
+ */
2483
+ executionTimeMs?: number;
2484
+ /**
2485
+ * Number of bytes processed by the tool.
2486
+ */
2487
+ bytesProcessed?: number;
2488
+ /**
2489
+ * Tool execution cost reported by the MCP server.
2490
+ */
2491
+ cost?: number;
2492
+ };
2493
+ /**
2494
+ * Mail module name used for display.
2495
+ */
2496
+ moduleName?: string;
2497
+ /**
2498
+ * Structured tool output when provided by the Mail service.
2499
+ */
2500
+ structuredContent?: unknown;
2501
+ /**
2502
+ * Bounded HTTP-like Mail service error code.
2503
+ */
2504
+ toolErrorCode?: number;
2505
+ };
2506
+ /**
2507
+ * Script input for the "Mark as Spam" effect (`mail.markThreadSpam`),
2508
+ * derived from its Tool Core definition's call_function input projection.
2509
+ *
2510
+ * Mark one or more email threads as spam
2511
+ */
2512
+ export type MarkThreadSpamScriptInput = {
2513
+ /**
2514
+ * The email address of the mailbox
2515
+ */
2516
+ userEmailAddress: string;
2517
+ /**
2518
+ * Array of thread IDs to mark as spam
2519
+ */
2520
+ threadIds: Array<string>;
2521
+ };
2522
+ /**
2523
+ * Canonical Tool Core output for the "Mark as Spam" effect (`mail.markThreadSpam`).
2524
+ * This is the definition's output schema; the effect's script surface may
2525
+ * re-encode it before returning.
2526
+ */
2527
+ export type MarkThreadSpamScriptOutput = {
2528
+ /**
2529
+ * Tool output content.
2530
+ */
2531
+ content: unknown;
2532
+ /**
2533
+ * Name of the Mail tool that ran.
2534
+ */
2535
+ name: string;
2536
+ /**
2537
+ * Whether the Mail service reported a tool error.
2538
+ */
2539
+ isError?: boolean;
2540
+ /**
2541
+ * Execution metadata reported by the MCP server.
2542
+ */
2543
+ metadata?: {
2544
+ /**
2545
+ * Tool execution time in milliseconds.
2546
+ */
2547
+ executionTimeMs?: number;
2548
+ /**
2549
+ * Number of bytes processed by the tool.
2550
+ */
2551
+ bytesProcessed?: number;
2552
+ /**
2553
+ * Tool execution cost reported by the MCP server.
2554
+ */
2555
+ cost?: number;
2556
+ };
2557
+ /**
2558
+ * Mail module name used for display.
2559
+ */
2560
+ moduleName?: string;
2561
+ /**
2562
+ * Structured tool output when provided by the Mail service.
2563
+ */
2564
+ structuredContent?: unknown;
2565
+ /**
2566
+ * Bounded HTTP-like Mail service error code.
2567
+ */
2568
+ toolErrorCode?: number;
2569
+ };
2570
+ /**
2571
+ * Script input for the "Move to Inbox" effect (`mail.moveThreadToInbox`),
2572
+ * derived from its Tool Core definition's call_function input projection.
2573
+ *
2574
+ * Move threads that aren't currently in the inbox back to the inbox, i.e. threads in Archive, Trash or Spam. Note that finding threads in Spam or Trash requires the use of relevant search parameters: Gmail, pass includeSpamTrash to searchEmails; Outlook, search searchOutlookEmails with filters.folder: "deleted" or "junk".
2575
+ */
2576
+ export type MoveThreadToInboxScriptInput = {
2577
+ /**
2578
+ * The email address of the mailbox
2579
+ */
2580
+ userEmailAddress: string;
2581
+ /**
2582
+ * Array of thread IDs to move to inbox
2583
+ */
2584
+ threadIds: Array<string>;
2585
+ };
2586
+ /**
2587
+ * Canonical Tool Core output for the "Move to Inbox" effect (`mail.moveThreadToInbox`).
2588
+ * This is the definition's output schema; the effect's script surface may
2589
+ * re-encode it before returning.
2590
+ */
2591
+ export type MoveThreadToInboxScriptOutput = {
2592
+ /**
2593
+ * Tool output content.
2594
+ */
2595
+ content: unknown;
2596
+ /**
2597
+ * Name of the Mail tool that ran.
2598
+ */
2599
+ name: string;
2600
+ /**
2601
+ * Whether the Mail service reported a tool error.
2602
+ */
2603
+ isError?: boolean;
2604
+ /**
2605
+ * Execution metadata reported by the MCP server.
2606
+ */
2607
+ metadata?: {
2608
+ /**
2609
+ * Tool execution time in milliseconds.
2610
+ */
2611
+ executionTimeMs?: number;
2612
+ /**
2613
+ * Number of bytes processed by the tool.
2614
+ */
2615
+ bytesProcessed?: number;
2616
+ /**
2617
+ * Tool execution cost reported by the MCP server.
2618
+ */
2619
+ cost?: number;
2620
+ };
2621
+ /**
2622
+ * Mail module name used for display.
2623
+ */
2624
+ moduleName?: string;
2625
+ /**
2626
+ * Structured tool output when provided by the Mail service.
2627
+ */
2628
+ structuredContent?: unknown;
2629
+ /**
2630
+ * Bounded HTTP-like Mail service error code.
2631
+ */
2632
+ toolErrorCode?: number;
2633
+ };
2634
+ /**
2635
+ * Script input for the "Move to Outlook Folder" effect (`mail.moveToOutlookFolder`),
2636
+ * derived from its Tool Core definition's call_function input projection.
2637
+ *
2638
+ * Move one or more email threads to a specific folder in the user's Outlook mailbox
2639
+ */
2640
+ export type MoveToOutlookFolderScriptInput = {
2641
+ /**
2642
+ * The email address of the Outlook mailbox
2643
+ */
2644
+ userEmailAddress: string;
2645
+ /**
2646
+ * Array of thread IDs to move
2647
+ */
2648
+ threadIds: Array<string>;
2649
+ /**
2650
+ * The ID of the destination folder, or a well-known folder name: inbox, archive, deleteditems, junkemail, sentitems, drafts
2651
+ */
2652
+ destinationFolderId: string;
2653
+ };
2654
+ /**
2655
+ * Canonical Tool Core output for the "Move to Outlook Folder" effect (`mail.moveToOutlookFolder`).
2656
+ * This is the definition's output schema; the effect's script surface may
2657
+ * re-encode it before returning.
2658
+ */
2659
+ export type MoveToOutlookFolderScriptOutput = {
2660
+ /**
2661
+ * Tool output content.
2662
+ */
2663
+ content: unknown;
2664
+ /**
2665
+ * Name of the Mail tool that ran.
2666
+ */
2667
+ name: string;
2668
+ /**
2669
+ * Whether the Mail service reported a tool error.
2670
+ */
2671
+ isError?: boolean;
2672
+ /**
2673
+ * Execution metadata reported by the MCP server.
2674
+ */
2675
+ metadata?: {
2676
+ /**
2677
+ * Tool execution time in milliseconds.
2678
+ */
2679
+ executionTimeMs?: number;
2680
+ /**
2681
+ * Number of bytes processed by the tool.
2682
+ */
2683
+ bytesProcessed?: number;
2684
+ /**
2685
+ * Tool execution cost reported by the MCP server.
2686
+ */
2687
+ cost?: number;
2688
+ };
2689
+ /**
2690
+ * Mail module name used for display.
2691
+ */
2692
+ moduleName?: string;
2693
+ /**
2694
+ * Structured tool output when provided by the Mail service.
2695
+ */
2696
+ structuredContent?: unknown;
2697
+ /**
2698
+ * Bounded HTTP-like Mail service error code.
2699
+ */
2700
+ toolErrorCode?: number;
2701
+ };
2702
+ /**
2703
+ * Script input for the "Read Attachment" effect (`mail.readAttachment`),
2704
+ * derived from its Tool Core definition's call_function input projection.
2705
+ *
2706
+ * Fetch the content of an email attachment by its attachment ID. Use after view_thread_content to read a specific attachment. Images are returned visually. Text files are returned as readable text. PDFs are uploaded as thread attachments you can read. Other binary files (docx, xlsx, zip, etc.) cannot be read directly.
2707
+ */
2708
+ export type ReadAttachmentScriptInput = {
2709
+ /**
2710
+ * The email address of the mailbox
2711
+ */
2712
+ userEmailAddress: string;
2713
+ /**
2714
+ * Gmail message ID containing the attachment (from view_thread_content)
2715
+ */
2716
+ messageId: string;
2717
+ /**
2718
+ * Attachment ID (from the attachments array in view_thread_content)
2719
+ */
2720
+ attachmentId: string;
2721
+ };
2722
+ /**
2723
+ * Canonical Tool Core output for the "Read Attachment" effect (`mail.readAttachment`).
2724
+ * This is the definition's output schema; the effect's script surface may
2725
+ * re-encode it before returning.
2726
+ */
2727
+ export type ReadAttachmentScriptOutput = {
2728
+ /**
2729
+ * Tool output content.
2730
+ */
2731
+ content: unknown;
2732
+ /**
2733
+ * Name of the Mail tool that ran.
2734
+ */
2735
+ name: string;
2736
+ /**
2737
+ * Whether the Mail service reported a tool error.
2738
+ */
2739
+ isError?: boolean;
2740
+ /**
2741
+ * Execution metadata reported by the MCP server.
2742
+ */
2743
+ metadata?: {
2744
+ /**
2745
+ * Tool execution time in milliseconds.
2746
+ */
2747
+ executionTimeMs?: number;
2748
+ /**
2749
+ * Number of bytes processed by the tool.
2750
+ */
2751
+ bytesProcessed?: number;
2752
+ /**
2753
+ * Tool execution cost reported by the MCP server.
2754
+ */
2755
+ cost?: number;
2756
+ };
2757
+ /**
2758
+ * Mail module name used for display.
2759
+ */
2760
+ moduleName?: string;
2761
+ /**
2762
+ * Structured tool output when provided by the Mail service.
2763
+ */
2764
+ structuredContent?: unknown;
2765
+ /**
2766
+ * Bounded HTTP-like Mail service error code.
2767
+ */
2768
+ toolErrorCode?: number;
2769
+ };
2770
+ /**
2771
+ * Script input for the "Remove Outlook Categories" effect (`mail.removeOutlookCategories`),
2772
+ * derived from its Tool Core definition's call_function input projection.
2773
+ *
2774
+ * Remove categories from all messages in the specified Outlook conversations.
2775
+ */
2776
+ export type RemoveOutlookCategoriesScriptInput = {
2777
+ /**
2778
+ * The Outlook email address
2779
+ */
2780
+ userEmailAddress: string;
2781
+ /**
2782
+ * Outlook conversation IDs (from search_emails threadId)
2783
+ */
2784
+ conversationIDs: Array<string>;
2785
+ /**
2786
+ * Category display names to remove (case-sensitive)
2787
+ */
2788
+ categoryNames: Array<string>;
2789
+ };
2790
+ /**
2791
+ * Canonical Tool Core output for the "Remove Outlook Categories" effect (`mail.removeOutlookCategories`).
2792
+ * This is the definition's output schema; the effect's script surface may
2793
+ * re-encode it before returning.
2794
+ */
2795
+ export type RemoveOutlookCategoriesScriptOutput = {
2796
+ /**
2797
+ * Tool output content.
2798
+ */
2799
+ content: unknown;
2800
+ /**
2801
+ * Name of the Mail tool that ran.
2802
+ */
2803
+ name: string;
2804
+ /**
2805
+ * Whether the Mail service reported a tool error.
2806
+ */
2807
+ isError?: boolean;
2808
+ /**
2809
+ * Execution metadata reported by the MCP server.
2810
+ */
2811
+ metadata?: {
2812
+ /**
2813
+ * Tool execution time in milliseconds.
2814
+ */
2815
+ executionTimeMs?: number;
2816
+ /**
2817
+ * Number of bytes processed by the tool.
2818
+ */
2819
+ bytesProcessed?: number;
2820
+ /**
2821
+ * Tool execution cost reported by the MCP server.
2822
+ */
2823
+ cost?: number;
2824
+ };
2825
+ /**
2826
+ * Mail module name used for display.
2827
+ */
2828
+ moduleName?: string;
2829
+ /**
2830
+ * Structured tool output when provided by the Mail service.
2831
+ */
2832
+ structuredContent?: unknown;
2833
+ /**
2834
+ * Bounded HTTP-like Mail service error code.
2835
+ */
2836
+ toolErrorCode?: number;
2837
+ };
2838
+ /**
2839
+ * Script input for the "Remove Sender from Notion Mail Notification Allowlist" effect (`mail.removeSenderNotificationPreferences`),
2840
+ * derived from its Tool Core definition's call_function input projection.
2841
+ *
2842
+ * Remove sender email addresses from the Notion Mail notification allowlist. Once removed, notifications for their emails will follow the standard view-level settings. This tool is specific to Notion Mail notification settings only. Takes effect immediately.
2843
+ */
2844
+ export type RemoveSenderNotificationPreferencesScriptInput = {
2845
+ /**
2846
+ * The Notion Mail email address of the account. Must be an account connected to Notion Mail.
2847
+ */
2848
+ userEmailAddress: string;
2849
+ /**
2850
+ * Sender email addresses to remove from the notification allowlist. Required unless removeAll is true.
2851
+ */
2852
+ senderAddresses?: Array<string>;
2853
+ /**
2854
+ * Set to true to clear the entire notification allowlist. Either senderAddresses or removeAll must be provided.
2855
+ */
2856
+ removeAll?: boolean;
2857
+ };
2858
+ /**
2859
+ * Canonical Tool Core output for the "Remove Sender from Notion Mail Notification Allowlist" effect (`mail.removeSenderNotificationPreferences`).
2860
+ * This is the definition's output schema; the effect's script surface may
2861
+ * re-encode it before returning.
2862
+ */
2863
+ export type RemoveSenderNotificationPreferencesScriptOutput = {
2864
+ /**
2865
+ * Tool output content.
2866
+ */
2867
+ content: unknown;
2868
+ /**
2869
+ * Name of the Mail tool that ran.
2870
+ */
2871
+ name: string;
2872
+ /**
2873
+ * Whether the Mail service reported a tool error.
2874
+ */
2875
+ isError?: boolean;
2876
+ /**
2877
+ * Execution metadata reported by the MCP server.
2878
+ */
2879
+ metadata?: {
2880
+ /**
2881
+ * Tool execution time in milliseconds.
2882
+ */
2883
+ executionTimeMs?: number;
2884
+ /**
2885
+ * Number of bytes processed by the tool.
2886
+ */
2887
+ bytesProcessed?: number;
2888
+ /**
2889
+ * Tool execution cost reported by the MCP server.
2890
+ */
2891
+ cost?: number;
2892
+ };
2893
+ /**
2894
+ * Mail module name used for display.
2895
+ */
2896
+ moduleName?: string;
2897
+ /**
2898
+ * Structured tool output when provided by the Mail service.
2899
+ */
2900
+ structuredContent?: unknown;
2901
+ /**
2902
+ * Bounded HTTP-like Mail service error code.
2903
+ */
2904
+ toolErrorCode?: number;
2905
+ };
2906
+ /**
2907
+ * Script input for the "Remove Labels" effect (`mail.removeUserLabels`),
2908
+ * derived from its Tool Core definition's call_function input projection.
2909
+ *
2910
+ * Remove user-created labels from email threads
2911
+ */
2912
+ export type RemoveUserLabelsScriptInput = {
2913
+ /**
2914
+ * The email address of the mailbox
2915
+ */
2916
+ userEmailAddress: string;
2917
+ /**
2918
+ * Array of thread IDs to unlabel
2919
+ */
2920
+ threadIds: Array<string>;
2921
+ /**
2922
+ * Names of labels to remove
2923
+ */
2924
+ labelNames: Array<string>;
2925
+ };
2926
+ /**
2927
+ * Canonical Tool Core output for the "Remove Labels" effect (`mail.removeUserLabels`).
2928
+ * This is the definition's output schema; the effect's script surface may
2929
+ * re-encode it before returning.
2930
+ */
2931
+ export type RemoveUserLabelsScriptOutput = {
2932
+ /**
2933
+ * Tool output content.
2934
+ */
2935
+ content: unknown;
2936
+ /**
2937
+ * Name of the Mail tool that ran.
2938
+ */
2939
+ name: string;
2940
+ /**
2941
+ * Whether the Mail service reported a tool error.
2942
+ */
2943
+ isError?: boolean;
2944
+ /**
2945
+ * Execution metadata reported by the MCP server.
2946
+ */
2947
+ metadata?: {
2948
+ /**
2949
+ * Tool execution time in milliseconds.
2950
+ */
2951
+ executionTimeMs?: number;
2952
+ /**
2953
+ * Number of bytes processed by the tool.
2954
+ */
2955
+ bytesProcessed?: number;
2956
+ /**
2957
+ * Tool execution cost reported by the MCP server.
2958
+ */
2959
+ cost?: number;
2960
+ };
2961
+ /**
2962
+ * Mail module name used for display.
2963
+ */
2964
+ moduleName?: string;
2965
+ /**
2966
+ * Structured tool output when provided by the Mail service.
2967
+ */
2968
+ structuredContent?: unknown;
2969
+ /**
2970
+ * Bounded HTTP-like Mail service error code.
2971
+ */
2972
+ toolErrorCode?: number;
2973
+ };
2974
+ /**
2975
+ * Script input for the "Search Emails" effect (`mail.searchEmails`),
2976
+ * derived from its Tool Core definition's call_function input projection.
2977
+ *
2978
+ * Search for emails in the user's mailbox using Gmail query syntax.
2979
+ */
2980
+ export type SearchEmailsScriptInput = {
2981
+ /**
2982
+ * The email address of the mailbox to search in
2983
+ */
2984
+ userEmailAddress: string;
2985
+ /**
2986
+ * Search query string using Gmail-style search operators (e.g. from:, is:unread, newer_than:1d, after:/before:, subject:). For topic or digest requests, prefer recency (newer_than:1d) and/or sender (from:) filters over subject: keyword filtering: subjects don't reliably contain the topic word, so don't rely on subject alone, and when filtering by subject/body cover synonyms rather than over-filtering one term. For Gmail date bounds, after:/before: take a plain date with no time component (slashes or dashes both work) — GOOD: before:2026/05/08 or before:2026-05-08; BAD: before:2026-05-08T16:00 (a time component is not valid Gmail syntax and silently returns nothing); prefer newer_than:Nd for recency.
2987
+ */
2988
+ query: string;
2989
+ /**
2990
+ * Number of results to return (default: 20, max: 500)
2991
+ */
2992
+ count?: number;
2993
+ /**
2994
+ * Pagination token from previous search results
2995
+ */
2996
+ pageToken?: string;
2997
+ /**
2998
+ * Whether to include spam and trash in results
2999
+ */
3000
+ includeSpamTrash?: boolean;
3001
+ };
3002
+ /**
3003
+ * Canonical Tool Core output for the "Search Emails" effect (`mail.searchEmails`).
3004
+ * This is the definition's output schema; the effect's script surface may
3005
+ * re-encode it before returning.
3006
+ */
3007
+ export type SearchEmailsScriptOutput = {
3008
+ /**
3009
+ * Tool output content.
3010
+ */
3011
+ content: unknown;
3012
+ /**
3013
+ * Name of the Mail tool that ran.
3014
+ */
3015
+ name: string;
3016
+ /**
3017
+ * Whether the Mail service reported a tool error.
3018
+ */
3019
+ isError?: boolean;
3020
+ /**
3021
+ * Execution metadata reported by the MCP server.
3022
+ */
3023
+ metadata?: {
3024
+ /**
3025
+ * Tool execution time in milliseconds.
3026
+ */
3027
+ executionTimeMs?: number;
3028
+ /**
3029
+ * Number of bytes processed by the tool.
3030
+ */
3031
+ bytesProcessed?: number;
3032
+ /**
3033
+ * Tool execution cost reported by the MCP server.
3034
+ */
3035
+ cost?: number;
3036
+ };
3037
+ /**
3038
+ * Mail module name used for display.
3039
+ */
3040
+ moduleName?: string;
3041
+ /**
3042
+ * Structured tool output when provided by the Mail service.
3043
+ */
3044
+ structuredContent?: unknown;
3045
+ /**
3046
+ * Bounded HTTP-like Mail service error code.
3047
+ */
3048
+ toolErrorCode?: number;
3049
+ };
3050
+ /**
3051
+ * Script input for the "Search Outlook Emails" effect (`mail.searchOutlookEmails`),
3052
+ * derived from its Tool Core definition's call_function input projection.
3053
+ *
3054
+ * Search an Outlook mailbox using structured filters and/or keyword queries. Use this instead of search_emails for Outlook accounts. For multi-sender (OR), negation (NOT), or complex boolean queries that structured filters cannot express, use query with KQL operators.
3055
+ */
3056
+ export type SearchOutlookEmailsScriptInput = {
3057
+ /**
3058
+ * The email address of the Outlook mailbox to search
3059
+ */
3060
+ userEmailAddress: string;
3061
+ /**
3062
+ * KQL keyword query string. Use for keyword/semantic search and complex boolean logic (OR, NOT, parentheses). Use filters for metadata constraints. When combining with filters, the backend merges them optimally.
3063
+ */
3064
+ query?: string;
3065
+ /**
3066
+ * Number of results to return (default: 20, max: 500)
3067
+ */
3068
+ count?: number;
3069
+ /**
3070
+ * Pagination token from previous search results
3071
+ */
3072
+ pageToken?: string;
3073
+ /**
3074
+ * Structured filters for metadata-based search. The backend picks the optimal API strategy ($search, $filter, or both). All filters are AND-combined. Array fields use OR within the array.
3075
+ */
3076
+ filters?: {
3077
+ /**
3078
+ * Sender email addresses (OR within array). E.g., ['alice@co.com', 'bob@co.com'] matches emails from either sender. If only the display name is known, use query with 'from:Name' instead.
3079
+ */
3080
+ fromAddresses?: Array<string>;
3081
+ /**
3082
+ * Recipient email addresses (OR within array). Note: forces full-text search mode (OData cannot filter recipients).
3083
+ */
3084
+ toAddresses?: Array<string>;
3085
+ /**
3086
+ * Start of date range in ISO 8601 format (e.g., '2026-01-01' or '2026-01-01T00:00:00Z')
3087
+ */
3088
+ dateFrom?: string;
3089
+ /**
3090
+ * End of date range in ISO 8601 format. Inclusive — '2026-03-23' includes the full day (through 23:59:59Z).
3091
+ */
3092
+ dateTo?: string;
3093
+ /**
3094
+ * Filter for emails with/without attachments
3095
+ */
3096
+ hasAttachments?: boolean;
3097
+ /**
3098
+ * Filter by read status. ONLY available via filters (not in KQL).
3099
+ */
3100
+ isRead?: boolean;
3101
+ /**
3102
+ * Filter by importance level
3103
+ */
3104
+ importance?: "high" | "normal" | "low";
3105
+ /**
3106
+ * Scope search to a specific folder. Use well-known names (inbox, sent, drafts, archive, deleted, junk) or a folder ID from listOutlookFolders for user-created folders. Omit to search all folders.
3107
+ */
3108
+ folder?: string;
3109
+ /**
3110
+ * Filter for draft messages. Scopes to the drafts folder. ONLY available via filters (not in KQL).
3111
+ */
3112
+ isDraft?: boolean;
3113
+ /**
3114
+ * Outlook user-defined category tags (OR within array). E.g., ['Project X', 'Urgent'] matches emails with either category. ONLY available via filters (not in KQL).
3115
+ */
3116
+ categories?: Array<string>;
3117
+ };
3118
+ };
3119
+ /**
3120
+ * Canonical Tool Core output for the "Search Outlook Emails" effect (`mail.searchOutlookEmails`).
3121
+ * This is the definition's output schema; the effect's script surface may
3122
+ * re-encode it before returning.
3123
+ */
3124
+ export type SearchOutlookEmailsScriptOutput = {
3125
+ /**
3126
+ * Tool output content.
3127
+ */
3128
+ content: unknown;
3129
+ /**
3130
+ * Name of the Mail tool that ran.
3131
+ */
3132
+ name: string;
3133
+ /**
3134
+ * Whether the Mail service reported a tool error.
3135
+ */
3136
+ isError?: boolean;
3137
+ /**
3138
+ * Execution metadata reported by the MCP server.
3139
+ */
3140
+ metadata?: {
3141
+ /**
3142
+ * Tool execution time in milliseconds.
3143
+ */
3144
+ executionTimeMs?: number;
3145
+ /**
3146
+ * Number of bytes processed by the tool.
3147
+ */
3148
+ bytesProcessed?: number;
3149
+ /**
3150
+ * Tool execution cost reported by the MCP server.
3151
+ */
3152
+ cost?: number;
3153
+ };
3154
+ /**
3155
+ * Mail module name used for display.
3156
+ */
3157
+ moduleName?: string;
3158
+ /**
3159
+ * Structured tool output when provided by the Mail service.
3160
+ */
3161
+ structuredContent?: unknown;
3162
+ /**
3163
+ * Bounded HTTP-like Mail service error code.
3164
+ */
3165
+ toolErrorCode?: number;
3166
+ };
3167
+ /**
3168
+ * Script input for the "Send Draft" effect (`mail.sendExistingDraft`),
3169
+ * derived from its Tool Core definition's call_function input projection.
3170
+ *
3171
+ * Send an existing draft email (often from the return value of a create-or-update draft tool, but may also be explicitly provided by the user or a data source within the workspace).
3172
+ */
3173
+ export type SendExistingDraftScriptInput = {
3174
+ /**
3175
+ * The user's email address
3176
+ */
3177
+ userEmailAddress: string;
3178
+ /**
3179
+ * Draft identifier to send. Usually gmailDraft.draftID from create_or_update_draft_all_clients or draftId from create_or_update_outlook_draft; may also be an existing provider draft ID the user explicitly gave you.
3180
+ */
3181
+ draftId: string;
3182
+ };
3183
+ /**
3184
+ * Canonical Tool Core output for the "Send Draft" effect (`mail.sendExistingDraft`).
3185
+ * This is the definition's output schema; the effect's script surface may
3186
+ * re-encode it before returning.
3187
+ */
3188
+ export type SendExistingDraftScriptOutput = {
3189
+ /**
3190
+ * Tool output content.
3191
+ */
3192
+ content: unknown;
3193
+ /**
3194
+ * Name of the Mail tool that ran.
3195
+ */
3196
+ name: string;
3197
+ /**
3198
+ * Whether the Mail service reported a tool error.
3199
+ */
3200
+ isError?: boolean;
3201
+ /**
3202
+ * Execution metadata reported by the MCP server.
3203
+ */
3204
+ metadata?: {
3205
+ /**
3206
+ * Tool execution time in milliseconds.
3207
+ */
3208
+ executionTimeMs?: number;
3209
+ /**
3210
+ * Number of bytes processed by the tool.
3211
+ */
3212
+ bytesProcessed?: number;
3213
+ /**
3214
+ * Tool execution cost reported by the MCP server.
3215
+ */
3216
+ cost?: number;
3217
+ };
3218
+ /**
3219
+ * Mail module name used for display.
3220
+ */
3221
+ moduleName?: string;
3222
+ /**
3223
+ * Structured tool output when provided by the Mail service.
3224
+ */
3225
+ structuredContent?: unknown;
3226
+ /**
3227
+ * Bounded HTTP-like Mail service error code.
3228
+ */
3229
+ toolErrorCode?: number;
3230
+ };
3231
+ /**
3232
+ * Script input for the "Send Email" effect (`mail.sendNewEmail`),
3233
+ * derived from its Tool Core definition's call_function input projection.
3234
+ *
3235
+ * Send a new email immediately. Supports both standalone emails and direct replies to threads.
3236
+ */
3237
+ export type SendNewEmailScriptInput = {
3238
+ /**
3239
+ * The user's email address
3240
+ */
3241
+ userEmailAddress: string;
3242
+ /**
3243
+ * Sender address owned by the user
3244
+ */
3245
+ from: {
3246
+ address: string;
3247
+ name?: string;
3248
+ };
3249
+ /**
3250
+ * Primary recipients. Required for all emails.
3251
+ */
3252
+ to: Array<{
3253
+ address: string;
3254
+ name?: string;
3255
+ }>;
3256
+ /**
3257
+ * CC recipients
3258
+ */
3259
+ cc?: Array<{
3260
+ address: string;
3261
+ name?: string;
3262
+ }>;
3263
+ /**
3264
+ * BCC recipients
3265
+ */
3266
+ bcc?: Array<{
3267
+ address: string;
3268
+ name?: string;
3269
+ }>;
3270
+ /**
3271
+ * Subject line. Required for new threads, optional for replies.
3272
+ */
3273
+ subject?: string;
3274
+ /**
3275
+ * Plain text email body
3276
+ */
3277
+ text?: string;
3278
+ /**
3279
+ * HTML email body
3280
+ */
3281
+ html?: string;
3282
+ /**
3283
+ * Thread ID for replies
3284
+ */
3285
+ parentThreadId?: string;
3286
+ /**
3287
+ * Specific message ID to reply to. Defaults to latest message.
3288
+ */
3289
+ parentMessageId?: string;
3290
+ };
3291
+ /**
3292
+ * Canonical Tool Core output for the "Send Email" effect (`mail.sendNewEmail`).
3293
+ * This is the definition's output schema; the effect's script surface may
3294
+ * re-encode it before returning.
3295
+ */
3296
+ export type SendNewEmailScriptOutput = {
3297
+ /**
3298
+ * Tool output content.
3299
+ */
3300
+ content: unknown;
3301
+ /**
3302
+ * Name of the Mail tool that ran.
3303
+ */
3304
+ name: string;
3305
+ /**
3306
+ * Whether the Mail service reported a tool error.
3307
+ */
3308
+ isError?: boolean;
3309
+ /**
3310
+ * Execution metadata reported by the MCP server.
3311
+ */
3312
+ metadata?: {
3313
+ /**
3314
+ * Tool execution time in milliseconds.
3315
+ */
3316
+ executionTimeMs?: number;
3317
+ /**
3318
+ * Number of bytes processed by the tool.
3319
+ */
3320
+ bytesProcessed?: number;
3321
+ /**
3322
+ * Tool execution cost reported by the MCP server.
3323
+ */
3324
+ cost?: number;
3325
+ };
3326
+ /**
3327
+ * Mail module name used for display.
3328
+ */
3329
+ moduleName?: string;
3330
+ /**
3331
+ * Structured tool output when provided by the Mail service.
3332
+ */
3333
+ structuredContent?: unknown;
3334
+ /**
3335
+ * Bounded HTTP-like Mail service error code.
3336
+ */
3337
+ toolErrorCode?: number;
3338
+ };
3339
+ /**
3340
+ * Script input for the "Set Notion Mail Notification Preference" effect (`mail.setAccountNotificationPreference`),
3341
+ * derived from its Tool Core definition's call_function input projection.
3342
+ *
3343
+ * Enable or disable Notion Mail push notifications at the account level for a specific email account. This is an account-level setting that applies to all notifications for the account across all channels (iOS, Android, web push, desktop). This tool is specific to Notion Mail notification settings only — it does not modify notification settings for Gmail, Outlook, or any other email provider. Takes effect immediately.
3344
+ */
3345
+ export type SetAccountNotificationPreferenceScriptInput = {
3346
+ /**
3347
+ * The Notion Mail email address of the account to update notification preferences for. Must be an account connected to Notion Mail.
3348
+ */
3349
+ userEmailAddress: string;
3350
+ /**
3351
+ * Whether to enable (true) or disable (false) Notion Mail push notifications for this account
3352
+ */
3353
+ enabled: boolean;
3354
+ };
3355
+ /**
3356
+ * Canonical Tool Core output for the "Set Notion Mail Notification Preference" effect (`mail.setAccountNotificationPreference`).
3357
+ * This is the definition's output schema; the effect's script surface may
3358
+ * re-encode it before returning.
3359
+ */
3360
+ export type SetAccountNotificationPreferenceScriptOutput = {
3361
+ /**
3362
+ * Tool output content.
3363
+ */
3364
+ content: unknown;
3365
+ /**
3366
+ * Name of the Mail tool that ran.
3367
+ */
3368
+ name: string;
3369
+ /**
3370
+ * Whether the Mail service reported a tool error.
3371
+ */
3372
+ isError?: boolean;
3373
+ /**
3374
+ * Execution metadata reported by the MCP server.
3375
+ */
3376
+ metadata?: {
3377
+ /**
3378
+ * Tool execution time in milliseconds.
3379
+ */
3380
+ executionTimeMs?: number;
3381
+ /**
3382
+ * Number of bytes processed by the tool.
3383
+ */
3384
+ bytesProcessed?: number;
3385
+ /**
3386
+ * Tool execution cost reported by the MCP server.
3387
+ */
3388
+ cost?: number;
3389
+ };
3390
+ /**
3391
+ * Mail module name used for display.
3392
+ */
3393
+ moduleName?: string;
3394
+ /**
3395
+ * Structured tool output when provided by the Mail service.
3396
+ */
3397
+ structuredContent?: unknown;
3398
+ /**
3399
+ * Bounded HTTP-like Mail service error code.
3400
+ */
3401
+ toolErrorCode?: number;
3402
+ };
3403
+ /**
3404
+ * Script input for the "Set Read Status" effect (`mail.setReadStatus`),
3405
+ * derived from its Tool Core definition's call_function input projection.
3406
+ *
3407
+ * Mark one or more email threads as read or unread
3408
+ */
3409
+ export type SetReadStatusScriptInput = {
3410
+ /**
3411
+ * The email address of the mailbox
3412
+ */
3413
+ userEmailAddress: string;
3414
+ /**
3415
+ * Array of thread IDs to update (Gmail thread IDs or Outlook conversation IDs)
3416
+ */
3417
+ threadIds: Array<string>;
3418
+ /**
3419
+ * Whether to mark as read (true) or unread (false)
3420
+ */
3421
+ read: boolean;
3422
+ };
3423
+ /**
3424
+ * Canonical Tool Core output for the "Set Read Status" effect (`mail.setReadStatus`).
3425
+ * This is the definition's output schema; the effect's script surface may
3426
+ * re-encode it before returning.
3427
+ */
3428
+ export type SetReadStatusScriptOutput = {
3429
+ /**
3430
+ * Tool output content.
3431
+ */
3432
+ content: unknown;
3433
+ /**
3434
+ * Name of the Mail tool that ran.
3435
+ */
3436
+ name: string;
3437
+ /**
3438
+ * Whether the Mail service reported a tool error.
3439
+ */
3440
+ isError?: boolean;
3441
+ /**
3442
+ * Execution metadata reported by the MCP server.
3443
+ */
3444
+ metadata?: {
3445
+ /**
3446
+ * Tool execution time in milliseconds.
3447
+ */
3448
+ executionTimeMs?: number;
3449
+ /**
3450
+ * Number of bytes processed by the tool.
3451
+ */
3452
+ bytesProcessed?: number;
3453
+ /**
3454
+ * Tool execution cost reported by the MCP server.
3455
+ */
3456
+ cost?: number;
3457
+ };
3458
+ /**
3459
+ * Mail module name used for display.
3460
+ */
3461
+ moduleName?: string;
3462
+ /**
3463
+ * Structured tool output when provided by the Mail service.
3464
+ */
3465
+ structuredContent?: unknown;
3466
+ /**
3467
+ * Bounded HTTP-like Mail service error code.
3468
+ */
3469
+ toolErrorCode?: number;
3470
+ };
3471
+ /**
3472
+ * Script input for the "Set Reminder" effect (`mail.setReminder`),
3473
+ * derived from its Tool Core definition's call_function input projection.
3474
+ *
3475
+ * Set a reminder (snooze) for email threads. Gmail accounts only — for Outlook accounts use flag_outlook_thread with a reminderDateTime instead.
3476
+ */
3477
+ export type SetReminderScriptInput = {
3478
+ /**
3479
+ * The email address of the mailbox
3480
+ */
3481
+ userEmailAddress: string;
3482
+ /**
3483
+ * Array of thread IDs to set reminder on
3484
+ */
3485
+ threadIds: Array<string>;
3486
+ /**
3487
+ * ISO 8601 datetime with UTC offset for when to remind (e.g., 2024-11-17T18:00:00-05:00)
3488
+ */
3489
+ remindDate: string;
3490
+ /**
3491
+ * When to trigger reminder: IF_NO_REPLY (only if no reply received) or REGARDLESS
3492
+ */
3493
+ remindCondition?: "IF_NO_REPLY" | "REGARDLESS";
3494
+ };
3495
+ /**
3496
+ * Canonical Tool Core output for the "Set Reminder" effect (`mail.setReminder`).
3497
+ * This is the definition's output schema; the effect's script surface may
3498
+ * re-encode it before returning.
3499
+ */
3500
+ export type SetReminderScriptOutput = {
3501
+ /**
3502
+ * Tool output content.
3503
+ */
3504
+ content: unknown;
3505
+ /**
3506
+ * Name of the Mail tool that ran.
3507
+ */
3508
+ name: string;
3509
+ /**
3510
+ * Whether the Mail service reported a tool error.
3511
+ */
3512
+ isError?: boolean;
3513
+ /**
3514
+ * Execution metadata reported by the MCP server.
3515
+ */
3516
+ metadata?: {
3517
+ /**
3518
+ * Tool execution time in milliseconds.
3519
+ */
3520
+ executionTimeMs?: number;
3521
+ /**
3522
+ * Number of bytes processed by the tool.
3523
+ */
3524
+ bytesProcessed?: number;
3525
+ /**
3526
+ * Tool execution cost reported by the MCP server.
3527
+ */
3528
+ cost?: number;
3529
+ };
3530
+ /**
3531
+ * Mail module name used for display.
3532
+ */
3533
+ moduleName?: string;
3534
+ /**
3535
+ * Structured tool output when provided by the Mail service.
3536
+ */
3537
+ structuredContent?: unknown;
3538
+ /**
3539
+ * Bounded HTTP-like Mail service error code.
3540
+ */
3541
+ toolErrorCode?: number;
3542
+ };
3543
+ /**
3544
+ * Script input for the "Set Notion Mail View Notification Preferences" effect (`mail.setViewNotificationPreferences`),
3545
+ * derived from its Tool Core definition's call_function input projection.
3546
+ *
3547
+ * Enable or disable Notion Mail push notifications for specific mailbox views (e.g., Priority, Other, Newsletters). This tool is specific to Notion Mail notification settings only — it does not modify notification settings for Gmail, Outlook, or any other email provider. Takes effect immediately.
3548
+ */
3549
+ export type SetViewNotificationPreferencesScriptInput = {
3550
+ /**
3551
+ * The Notion Mail email address of the account to update view notification preferences for. Must be an account connected to Notion Mail.
3552
+ */
3553
+ userEmailAddress: string;
3554
+ /**
3555
+ * Array of view notification preference updates
3556
+ */
3557
+ preferences: Array<{
3558
+ /**
3559
+ * The mailbox view layout ID — get valid IDs from list_mailbox_views
3560
+ */
3561
+ layoutId: string;
3562
+ /**
3563
+ * Whether to enable (true) or disable (false) notifications for this view
3564
+ */
3565
+ enabled: boolean;
3566
+ }>;
3567
+ };
3568
+ /**
3569
+ * Canonical Tool Core output for the "Set Notion Mail View Notification Preferences" effect (`mail.setViewNotificationPreferences`).
3570
+ * This is the definition's output schema; the effect's script surface may
3571
+ * re-encode it before returning.
3572
+ */
3573
+ export type SetViewNotificationPreferencesScriptOutput = {
3574
+ /**
3575
+ * Tool output content.
3576
+ */
3577
+ content: unknown;
3578
+ /**
3579
+ * Name of the Mail tool that ran.
3580
+ */
3581
+ name: string;
3582
+ /**
3583
+ * Whether the Mail service reported a tool error.
3584
+ */
3585
+ isError?: boolean;
3586
+ /**
3587
+ * Execution metadata reported by the MCP server.
3588
+ */
3589
+ metadata?: {
3590
+ /**
3591
+ * Tool execution time in milliseconds.
3592
+ */
3593
+ executionTimeMs?: number;
3594
+ /**
3595
+ * Number of bytes processed by the tool.
3596
+ */
3597
+ bytesProcessed?: number;
3598
+ /**
3599
+ * Tool execution cost reported by the MCP server.
3600
+ */
3601
+ cost?: number;
3602
+ };
3603
+ /**
3604
+ * Mail module name used for display.
3605
+ */
3606
+ moduleName?: string;
3607
+ /**
3608
+ * Structured tool output when provided by the Mail service.
3609
+ */
3610
+ structuredContent?: unknown;
3611
+ /**
3612
+ * Bounded HTTP-like Mail service error code.
3613
+ */
3614
+ toolErrorCode?: number;
3615
+ };
3616
+ /**
3617
+ * Script input for the "Star Thread" effect (`mail.starThread`),
3618
+ * derived from its Tool Core definition's call_function input projection.
3619
+ *
3620
+ * Star or unstar one or more email threads. Gmail accounts only — for Outlook accounts use flag_outlook_thread instead.
3621
+ */
3622
+ export type StarThreadScriptInput = {
3623
+ /**
3624
+ * The email address of the mailbox
3625
+ */
3626
+ userEmailAddress: string;
3627
+ /**
3628
+ * Array of thread IDs to star/unstar
3629
+ */
3630
+ threadIds: Array<string>;
3631
+ /**
3632
+ * Whether to star (true) or unstar (false)
3633
+ */
3634
+ starred: boolean;
3635
+ };
3636
+ /**
3637
+ * Canonical Tool Core output for the "Star Thread" effect (`mail.starThread`).
3638
+ * This is the definition's output schema; the effect's script surface may
3639
+ * re-encode it before returning.
3640
+ */
3641
+ export type StarThreadScriptOutput = {
3642
+ /**
3643
+ * Tool output content.
3644
+ */
3645
+ content: unknown;
3646
+ /**
3647
+ * Name of the Mail tool that ran.
3648
+ */
3649
+ name: string;
3650
+ /**
3651
+ * Whether the Mail service reported a tool error.
3652
+ */
3653
+ isError?: boolean;
3654
+ /**
3655
+ * Execution metadata reported by the MCP server.
3656
+ */
3657
+ metadata?: {
3658
+ /**
3659
+ * Tool execution time in milliseconds.
3660
+ */
3661
+ executionTimeMs?: number;
3662
+ /**
3663
+ * Number of bytes processed by the tool.
3664
+ */
3665
+ bytesProcessed?: number;
3666
+ /**
3667
+ * Tool execution cost reported by the MCP server.
3668
+ */
3669
+ cost?: number;
3670
+ };
3671
+ /**
3672
+ * Mail module name used for display.
3673
+ */
3674
+ moduleName?: string;
3675
+ /**
3676
+ * Structured tool output when provided by the Mail service.
3677
+ */
3678
+ structuredContent?: unknown;
3679
+ /**
3680
+ * Bounded HTTP-like Mail service error code.
3681
+ */
3682
+ toolErrorCode?: number;
3683
+ };
3684
+ /**
3685
+ * Script input for the "Trash Thread" effect (`mail.trashThread`),
3686
+ * derived from its Tool Core definition's call_function input projection.
3687
+ *
3688
+ * Move one or more email threads to trash
3689
+ */
3690
+ export type TrashThreadScriptInput = {
3691
+ /**
3692
+ * The email address of the mailbox
3693
+ */
3694
+ userEmailAddress: string;
3695
+ /**
3696
+ * Array of thread IDs to trash
3697
+ */
3698
+ threadIds: Array<string>;
3699
+ };
3700
+ /**
3701
+ * Canonical Tool Core output for the "Trash Thread" effect (`mail.trashThread`).
3702
+ * This is the definition's output schema; the effect's script surface may
3703
+ * re-encode it before returning.
3704
+ */
3705
+ export type TrashThreadScriptOutput = {
3706
+ /**
3707
+ * Tool output content.
3708
+ */
3709
+ content: unknown;
3710
+ /**
3711
+ * Name of the Mail tool that ran.
3712
+ */
3713
+ name: string;
3714
+ /**
3715
+ * Whether the Mail service reported a tool error.
3716
+ */
3717
+ isError?: boolean;
3718
+ /**
3719
+ * Execution metadata reported by the MCP server.
3720
+ */
3721
+ metadata?: {
3722
+ /**
3723
+ * Tool execution time in milliseconds.
3724
+ */
3725
+ executionTimeMs?: number;
3726
+ /**
3727
+ * Number of bytes processed by the tool.
3728
+ */
3729
+ bytesProcessed?: number;
3730
+ /**
3731
+ * Tool execution cost reported by the MCP server.
3732
+ */
3733
+ cost?: number;
3734
+ };
3735
+ /**
3736
+ * Mail module name used for display.
3737
+ */
3738
+ moduleName?: string;
3739
+ /**
3740
+ * Structured tool output when provided by the Mail service.
3741
+ */
3742
+ structuredContent?: unknown;
3743
+ /**
3744
+ * Bounded HTTP-like Mail service error code.
3745
+ */
3746
+ toolErrorCode?: number;
3747
+ };
3748
+ /**
3749
+ * Script input for the "Unblock Sender" effect (`mail.unblockSender`),
3750
+ * derived from its Tool Core definition's call_function input projection.
3751
+ *
3752
+ * Unblock a previously blocked sender
3753
+ */
3754
+ export type UnblockSenderScriptInput = {
3755
+ /**
3756
+ * The email address of the mailbox
3757
+ */
3758
+ userEmailAddress: string;
3759
+ /**
3760
+ * Email address of the sender to unblock
3761
+ */
3762
+ senderEmail: string;
3763
+ };
3764
+ /**
3765
+ * Canonical Tool Core output for the "Unblock Sender" effect (`mail.unblockSender`).
3766
+ * This is the definition's output schema; the effect's script surface may
3767
+ * re-encode it before returning.
3768
+ */
3769
+ export type UnblockSenderScriptOutput = {
3770
+ /**
3771
+ * Tool output content.
3772
+ */
3773
+ content: unknown;
3774
+ /**
3775
+ * Name of the Mail tool that ran.
3776
+ */
3777
+ name: string;
3778
+ /**
3779
+ * Whether the Mail service reported a tool error.
3780
+ */
3781
+ isError?: boolean;
3782
+ /**
3783
+ * Execution metadata reported by the MCP server.
3784
+ */
3785
+ metadata?: {
3786
+ /**
3787
+ * Tool execution time in milliseconds.
3788
+ */
3789
+ executionTimeMs?: number;
3790
+ /**
3791
+ * Number of bytes processed by the tool.
3792
+ */
3793
+ bytesProcessed?: number;
3794
+ /**
3795
+ * Tool execution cost reported by the MCP server.
3796
+ */
3797
+ cost?: number;
3798
+ };
3799
+ /**
3800
+ * Mail module name used for display.
3801
+ */
3802
+ moduleName?: string;
3803
+ /**
3804
+ * Structured tool output when provided by the Mail service.
3805
+ */
3806
+ structuredContent?: unknown;
3807
+ /**
3808
+ * Bounded HTTP-like Mail service error code.
3809
+ */
3810
+ toolErrorCode?: number;
3811
+ };
3812
+ /**
3813
+ * Script input for the "Unset Reminder" effect (`mail.unsetReminder`),
3814
+ * derived from its Tool Core definition's call_function input projection.
3815
+ *
3816
+ * Remove a reminder (unsnooze) from email threads. Gmail accounts only — for Outlook accounts use flag_outlook_thread with flagged=false instead.
3817
+ */
3818
+ export type UnsetReminderScriptInput = {
3819
+ /**
3820
+ * The email address of the mailbox
3821
+ */
3822
+ userEmailAddress: string;
3823
+ /**
3824
+ * Array of thread IDs to unset reminder on
3825
+ */
3826
+ threadIds: Array<string>;
3827
+ };
3828
+ /**
3829
+ * Canonical Tool Core output for the "Unset Reminder" effect (`mail.unsetReminder`).
3830
+ * This is the definition's output schema; the effect's script surface may
3831
+ * re-encode it before returning.
3832
+ */
3833
+ export type UnsetReminderScriptOutput = {
3834
+ /**
3835
+ * Tool output content.
3836
+ */
3837
+ content: unknown;
3838
+ /**
3839
+ * Name of the Mail tool that ran.
3840
+ */
3841
+ name: string;
3842
+ /**
3843
+ * Whether the Mail service reported a tool error.
3844
+ */
3845
+ isError?: boolean;
3846
+ /**
3847
+ * Execution metadata reported by the MCP server.
3848
+ */
3849
+ metadata?: {
3850
+ /**
3851
+ * Tool execution time in milliseconds.
3852
+ */
3853
+ executionTimeMs?: number;
3854
+ /**
3855
+ * Number of bytes processed by the tool.
3856
+ */
3857
+ bytesProcessed?: number;
3858
+ /**
3859
+ * Tool execution cost reported by the MCP server.
3860
+ */
3861
+ cost?: number;
3862
+ };
3863
+ /**
3864
+ * Mail module name used for display.
3865
+ */
3866
+ moduleName?: string;
3867
+ /**
3868
+ * Structured tool output when provided by the Mail service.
3869
+ */
3870
+ structuredContent?: unknown;
3871
+ /**
3872
+ * Bounded HTTP-like Mail service error code.
3873
+ */
3874
+ toolErrorCode?: number;
3875
+ };
3876
+ /**
3877
+ * Script input for the "Unsubscribe" effect (`mail.unsubscribeSender`),
3878
+ * derived from its Tool Core definition's call_function input projection.
3879
+ *
3880
+ * Unsubscribe from a mailing list using List-Unsubscribe metadata
3881
+ */
3882
+ export type UnsubscribeSenderScriptInput = {
3883
+ /**
3884
+ * The email address of the mailbox
3885
+ */
3886
+ userEmailAddress: string;
3887
+ /**
3888
+ * Gmail thread ID containing the message with unsubscribe metadata
3889
+ */
3890
+ threadId?: string;
3891
+ /**
3892
+ * Optional specific Gmail message ID
3893
+ */
3894
+ messageId?: string;
3895
+ /**
3896
+ * Optional explicit HTTPS or mailto unsubscribe URL
3897
+ */
3898
+ explicitUnsubscribeUrl?: string;
3899
+ /**
3900
+ * Optional raw List-Unsubscribe header value
3901
+ */
3902
+ listUnsubscribeHeader?: string;
3903
+ /**
3904
+ * Optional raw List-Unsubscribe-Post header value
3905
+ */
3906
+ listUnsubscribePostHeader?: string;
3907
+ /**
3908
+ * Optional sender email for logging/context
3909
+ */
3910
+ senderEmail?: string;
3911
+ };
3912
+ /**
3913
+ * Canonical Tool Core output for the "Unsubscribe" effect (`mail.unsubscribeSender`).
3914
+ * This is the definition's output schema; the effect's script surface may
3915
+ * re-encode it before returning.
3916
+ */
3917
+ export type UnsubscribeSenderScriptOutput = {
3918
+ /**
3919
+ * Tool output content.
3920
+ */
3921
+ content: unknown;
3922
+ /**
3923
+ * Name of the Mail tool that ran.
3924
+ */
3925
+ name: string;
3926
+ /**
3927
+ * Whether the Mail service reported a tool error.
3928
+ */
3929
+ isError?: boolean;
3930
+ /**
3931
+ * Execution metadata reported by the MCP server.
3932
+ */
3933
+ metadata?: {
3934
+ /**
3935
+ * Tool execution time in milliseconds.
3936
+ */
3937
+ executionTimeMs?: number;
3938
+ /**
3939
+ * Number of bytes processed by the tool.
3940
+ */
3941
+ bytesProcessed?: number;
3942
+ /**
3943
+ * Tool execution cost reported by the MCP server.
3944
+ */
3945
+ cost?: number;
3946
+ };
3947
+ /**
3948
+ * Mail module name used for display.
3949
+ */
3950
+ moduleName?: string;
3951
+ /**
3952
+ * Structured tool output when provided by the Mail service.
3953
+ */
3954
+ structuredContent?: unknown;
3955
+ /**
3956
+ * Bounded HTTP-like Mail service error code.
3957
+ */
3958
+ toolErrorCode?: number;
3959
+ };
3960
+ /**
3961
+ * Script input for the "Update Gmail Filter" effect (`mail.updateGmailFilter`),
3962
+ * derived from its Tool Core definition's call_function input projection.
3963
+ *
3964
+ * Update an existing Gmail filter (deletes and recreates with new settings)
3965
+ */
3966
+ export type UpdateGmailFilterScriptInput = {
3967
+ /**
3968
+ * The email address of the Gmail account
3969
+ */
3970
+ userEmailAddress: string;
3971
+ /**
3972
+ * The ID of the filter to update
3973
+ */
3974
+ filterId: string;
3975
+ /**
3976
+ * New filter criteria (at least one field required)
3977
+ */
3978
+ criteria: {
3979
+ /**
3980
+ * Match emails from this sender
3981
+ */
3982
+ from?: string;
3983
+ /**
3984
+ * Match emails sent to this address
3985
+ */
3986
+ to?: string;
3987
+ /**
3988
+ * Match emails with this in subject
3989
+ */
3990
+ subject?: string;
3991
+ /**
3992
+ * Full Gmail search query
3993
+ */
3994
+ query?: string;
3995
+ /**
3996
+ * Exclude emails matching this query
3997
+ */
3998
+ negatedQuery?: string;
3999
+ /**
4000
+ * Match only emails with attachments
4001
+ */
4002
+ hasAttachment?: boolean;
4003
+ /**
4004
+ * Exclude chat messages
4005
+ */
4006
+ excludeChats?: boolean;
4007
+ /**
4008
+ * Size threshold in bytes
4009
+ */
4010
+ size?: number;
4011
+ /**
4012
+ * Compare against size threshold
4013
+ */
4014
+ sizeComparison?: "SMALLER" | "LARGER";
4015
+ };
4016
+ /**
4017
+ * New actions to perform (at least one required)
4018
+ */
4019
+ action: {
4020
+ /**
4021
+ * Gmail system label IDs or IDs returned by list_labels. Never use Notion record, survey option, or category IDs.
4022
+ */
4023
+ addLabelIds?: Array<string>;
4024
+ /**
4025
+ * Gmail system label IDs or IDs returned by list_labels. Use INBOX to auto-archive matching future mail.
4026
+ */
4027
+ removeLabelIds?: Array<string>;
4028
+ /**
4029
+ * Email address to forward to (must be pre-verified)
4030
+ */
4031
+ forward?: string;
4032
+ };
4033
+ };
4034
+ /**
4035
+ * Canonical Tool Core output for the "Update Gmail Filter" effect (`mail.updateGmailFilter`).
4036
+ * This is the definition's output schema; the effect's script surface may
4037
+ * re-encode it before returning.
4038
+ */
4039
+ export type UpdateGmailFilterScriptOutput = {
4040
+ /**
4041
+ * Tool output content.
4042
+ */
4043
+ content: unknown;
4044
+ /**
4045
+ * Name of the Mail tool that ran.
4046
+ */
4047
+ name: string;
4048
+ /**
4049
+ * Whether the Mail service reported a tool error.
4050
+ */
4051
+ isError?: boolean;
4052
+ /**
4053
+ * Execution metadata reported by the MCP server.
4054
+ */
4055
+ metadata?: {
4056
+ /**
4057
+ * Tool execution time in milliseconds.
4058
+ */
4059
+ executionTimeMs?: number;
4060
+ /**
4061
+ * Number of bytes processed by the tool.
4062
+ */
4063
+ bytesProcessed?: number;
4064
+ /**
4065
+ * Tool execution cost reported by the MCP server.
4066
+ */
4067
+ cost?: number;
4068
+ };
4069
+ /**
4070
+ * Mail module name used for display.
4071
+ */
4072
+ moduleName?: string;
4073
+ /**
4074
+ * Structured tool output when provided by the Mail service.
4075
+ */
4076
+ structuredContent?: unknown;
4077
+ /**
4078
+ * Bounded HTTP-like Mail service error code.
4079
+ */
4080
+ toolErrorCode?: number;
4081
+ };
4082
+ /**
4083
+ * Script input for the "Update Label" effect (`mail.updateLabel`),
4084
+ * derived from its Tool Core definition's call_function input projection.
4085
+ *
4086
+ * Update a label's name or color
4087
+ */
4088
+ export type UpdateLabelScriptInput = {
4089
+ /**
4090
+ * The email address of the mailbox
4091
+ */
4092
+ userEmailAddress: string;
4093
+ /**
4094
+ * ID of the label to update
4095
+ */
4096
+ labelID: string;
4097
+ /**
4098
+ * New label name (optional)
4099
+ */
4100
+ labelName?: string;
4101
+ /**
4102
+ * New label color (optional)
4103
+ */
4104
+ color?: "light-gray" | "gray" | "brown" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "red";
4105
+ };
4106
+ /**
4107
+ * Canonical Tool Core output for the "Update Label" effect (`mail.updateLabel`).
4108
+ * This is the definition's output schema; the effect's script surface may
4109
+ * re-encode it before returning.
4110
+ */
4111
+ export type UpdateLabelScriptOutput = {
4112
+ /**
4113
+ * Tool output content.
4114
+ */
4115
+ content: unknown;
4116
+ /**
4117
+ * Name of the Mail tool that ran.
4118
+ */
4119
+ name: string;
4120
+ /**
4121
+ * Whether the Mail service reported a tool error.
4122
+ */
4123
+ isError?: boolean;
4124
+ /**
4125
+ * Execution metadata reported by the MCP server.
4126
+ */
4127
+ metadata?: {
4128
+ /**
4129
+ * Tool execution time in milliseconds.
4130
+ */
4131
+ executionTimeMs?: number;
4132
+ /**
4133
+ * Number of bytes processed by the tool.
4134
+ */
4135
+ bytesProcessed?: number;
4136
+ /**
4137
+ * Tool execution cost reported by the MCP server.
4138
+ */
4139
+ cost?: number;
4140
+ };
4141
+ /**
4142
+ * Mail module name used for display.
4143
+ */
4144
+ moduleName?: string;
4145
+ /**
4146
+ * Structured tool output when provided by the Mail service.
4147
+ */
4148
+ structuredContent?: unknown;
4149
+ /**
4150
+ * Bounded HTTP-like Mail service error code.
4151
+ */
4152
+ toolErrorCode?: number;
4153
+ };
4154
+ /**
4155
+ * Script input for the "Update Outlook Rule" effect (`mail.updateOutlookRule`),
4156
+ * derived from its Tool Core definition's call_function input projection.
4157
+ *
4158
+ * Update an existing inbox rule in the user's Outlook mailbox. Only the fields you provide are changed; unspecified top-level fields remain unchanged. conditions, actions, and exceptions are REPLACED entirely when provided.
4159
+ */
4160
+ export type UpdateOutlookRuleScriptInput = {
4161
+ /**
4162
+ * Rule ID (use list_outlook_rules to find IDs)
4163
+ */
4164
+ ruleId: string;
4165
+ /**
4166
+ * New display name
4167
+ */
4168
+ displayName?: string;
4169
+ /**
4170
+ * New execution order
4171
+ */
4172
+ sequence?: number;
4173
+ /**
4174
+ * Enable or disable the rule
4175
+ */
4176
+ isEnabled?: boolean;
4177
+ conditions?: {
4178
+ bodyContains?: Array<string>;
4179
+ bodyOrSubjectContains?: Array<string>;
4180
+ categories?: Array<string>;
4181
+ fromAddresses?: Array<{
4182
+ address: string;
4183
+ name?: string;
4184
+ }>;
4185
+ hasAttachments?: boolean;
4186
+ headerContains?: Array<string>;
4187
+ importance?: "low" | "normal" | "high";
4188
+ isApprovalRequest?: boolean;
4189
+ isAutomaticForward?: boolean;
4190
+ isAutomaticReply?: boolean;
4191
+ isEncrypted?: boolean;
4192
+ isMeetingRequest?: boolean;
4193
+ isMeetingResponse?: boolean;
4194
+ isNonDeliveryReport?: boolean;
4195
+ isPermissionControlled?: boolean;
4196
+ isReadReceipt?: boolean;
4197
+ isSigned?: boolean;
4198
+ isVoicemail?: boolean;
4199
+ messageActionFlag?: "any" | "call" | "doNotForward" | "followUp" | "fyi" | "forward" | "noResponseNecessary" | "read" | "reply" | "replyToAll" | "review";
4200
+ notSentToMe?: boolean;
4201
+ recipientContains?: Array<string>;
4202
+ senderContains?: Array<string>;
4203
+ sensitivity?: "normal" | "personal" | "private" | "confidential";
4204
+ sentCcMe?: boolean;
4205
+ sentOnlyToMe?: boolean;
4206
+ sentToMe?: boolean;
4207
+ sentToOrCcMe?: boolean;
4208
+ sentToAddresses?: Array<{
4209
+ address: string;
4210
+ name?: string;
4211
+ }>;
4212
+ subjectContains?: Array<string>;
4213
+ withinSizeRange?: {
4214
+ minimumSize?: number;
4215
+ maximumSize?: number;
4216
+ };
4217
+ };
4218
+ /**
4219
+ * New actions (replaces existing; must have at least one non-empty field when provided)
4220
+ */
4221
+ actions?: {
4222
+ /**
4223
+ * Categories to assign
4224
+ */
4225
+ assignCategories?: Array<string>;
4226
+ /**
4227
+ * Folder ID to copy to (use list_outlook_folders to find IDs)
4228
+ */
4229
+ copyToFolder?: string;
4230
+ /**
4231
+ * Move to Deleted Items
4232
+ */
4233
+ delete?: boolean;
4234
+ /**
4235
+ * Forward as attachment to these addresses
4236
+ */
4237
+ forwardAsAttachmentTo?: Array<{
4238
+ /**
4239
+ * Email address
4240
+ */
4241
+ address: string;
4242
+ /**
4243
+ * Display name (optional)
4244
+ */
4245
+ name?: string;
4246
+ }>;
4247
+ /**
4248
+ * Forward to these addresses
4249
+ */
4250
+ forwardTo?: Array<{
4251
+ /**
4252
+ * Email address
4253
+ */
4254
+ address: string;
4255
+ /**
4256
+ * Display name (optional)
4257
+ */
4258
+ name?: string;
4259
+ }>;
4260
+ /**
4261
+ * Mark as read
4262
+ */
4263
+ markAsRead?: boolean;
4264
+ /**
4265
+ * Set importance level
4266
+ */
4267
+ markImportance?: "low" | "normal" | "high";
4268
+ /**
4269
+ * Folder ID to move to (use list_outlook_folders to find IDs)
4270
+ */
4271
+ moveToFolder?: string;
4272
+ /**
4273
+ * Permanently delete (skip Deleted Items)
4274
+ */
4275
+ permanentDelete?: boolean;
4276
+ /**
4277
+ * Redirect to these addresses
4278
+ */
4279
+ redirectTo?: Array<{
4280
+ /**
4281
+ * Email address
4282
+ */
4283
+ address: string;
4284
+ /**
4285
+ * Display name (optional)
4286
+ */
4287
+ name?: string;
4288
+ }>;
4289
+ /**
4290
+ * Stop processing subsequent rules
4291
+ */
4292
+ stopProcessingRules?: boolean;
4293
+ };
4294
+ exceptions?: {
4295
+ bodyContains?: Array<string>;
4296
+ bodyOrSubjectContains?: Array<string>;
4297
+ categories?: Array<string>;
4298
+ fromAddresses?: Array<{
4299
+ address: string;
4300
+ name?: string;
4301
+ }>;
4302
+ hasAttachments?: boolean;
4303
+ headerContains?: Array<string>;
4304
+ importance?: "low" | "normal" | "high";
4305
+ isApprovalRequest?: boolean;
4306
+ isAutomaticForward?: boolean;
4307
+ isAutomaticReply?: boolean;
4308
+ isEncrypted?: boolean;
4309
+ isMeetingRequest?: boolean;
4310
+ isMeetingResponse?: boolean;
4311
+ isNonDeliveryReport?: boolean;
4312
+ isPermissionControlled?: boolean;
4313
+ isReadReceipt?: boolean;
4314
+ isSigned?: boolean;
4315
+ isVoicemail?: boolean;
4316
+ messageActionFlag?: "any" | "call" | "doNotForward" | "followUp" | "fyi" | "forward" | "noResponseNecessary" | "read" | "reply" | "replyToAll" | "review";
4317
+ notSentToMe?: boolean;
4318
+ recipientContains?: Array<string>;
4319
+ senderContains?: Array<string>;
4320
+ sensitivity?: "normal" | "personal" | "private" | "confidential";
4321
+ sentCcMe?: boolean;
4322
+ sentOnlyToMe?: boolean;
4323
+ sentToMe?: boolean;
4324
+ sentToOrCcMe?: boolean;
4325
+ sentToAddresses?: Array<{
4326
+ address: string;
4327
+ name?: string;
4328
+ }>;
4329
+ subjectContains?: Array<string>;
4330
+ withinSizeRange?: {
4331
+ minimumSize?: number;
4332
+ maximumSize?: number;
4333
+ };
4334
+ };
4335
+ etag?: string;
4336
+ /**
4337
+ * The Outlook email address
4338
+ */
4339
+ userEmailAddress: string;
4340
+ };
4341
+ /**
4342
+ * Canonical Tool Core output for the "Update Outlook Rule" effect (`mail.updateOutlookRule`).
4343
+ * This is the definition's output schema; the effect's script surface may
4344
+ * re-encode it before returning.
4345
+ */
4346
+ export type UpdateOutlookRuleScriptOutput = {
4347
+ /**
4348
+ * Tool output content.
4349
+ */
4350
+ content: unknown;
4351
+ /**
4352
+ * Name of the Mail tool that ran.
4353
+ */
4354
+ name: string;
4355
+ /**
4356
+ * Whether the Mail service reported a tool error.
4357
+ */
4358
+ isError?: boolean;
4359
+ /**
4360
+ * Execution metadata reported by the MCP server.
4361
+ */
4362
+ metadata?: {
4363
+ /**
4364
+ * Tool execution time in milliseconds.
4365
+ */
4366
+ executionTimeMs?: number;
4367
+ /**
4368
+ * Number of bytes processed by the tool.
4369
+ */
4370
+ bytesProcessed?: number;
4371
+ /**
4372
+ * Tool execution cost reported by the MCP server.
4373
+ */
4374
+ cost?: number;
4375
+ };
4376
+ /**
4377
+ * Mail module name used for display.
4378
+ */
4379
+ moduleName?: string;
4380
+ /**
4381
+ * Structured tool output when provided by the Mail service.
4382
+ */
4383
+ structuredContent?: unknown;
4384
+ /**
4385
+ * Bounded HTTP-like Mail service error code.
4386
+ */
4387
+ toolErrorCode?: number;
4388
+ };
4389
+ /**
4390
+ * Script input for the "Update Status" effect (`mail.updateStatus`),
4391
+ * derived from its Tool Core definition's call_function input projection.
4392
+ *
4393
+ * Update the status property value for email threads. Gmail accounts only — status updates are not supported for Outlook accounts.
4394
+ */
4395
+ export type UpdateStatusScriptInput = {
4396
+ /**
4397
+ * The email address of the mailbox
4398
+ */
4399
+ userEmailAddress: string;
4400
+ /**
4401
+ * Array of thread IDs to update
4402
+ */
4403
+ threadIds: Array<string>;
4404
+ /**
4405
+ * The UUID of the status property
4406
+ */
4407
+ statusID: string;
4408
+ /**
4409
+ * The name of the status option to set
4410
+ */
4411
+ optionValue: string;
4412
+ };
4413
+ /**
4414
+ * Canonical Tool Core output for the "Update Status" effect (`mail.updateStatus`).
4415
+ * This is the definition's output schema; the effect's script surface may
4416
+ * re-encode it before returning.
4417
+ */
4418
+ export type UpdateStatusScriptOutput = {
4419
+ /**
4420
+ * Tool output content.
4421
+ */
4422
+ content: unknown;
4423
+ /**
4424
+ * Name of the Mail tool that ran.
4425
+ */
4426
+ name: string;
4427
+ /**
4428
+ * Whether the Mail service reported a tool error.
4429
+ */
4430
+ isError?: boolean;
4431
+ /**
4432
+ * Execution metadata reported by the MCP server.
4433
+ */
4434
+ metadata?: {
4435
+ /**
4436
+ * Tool execution time in milliseconds.
4437
+ */
4438
+ executionTimeMs?: number;
4439
+ /**
4440
+ * Number of bytes processed by the tool.
4441
+ */
4442
+ bytesProcessed?: number;
4443
+ /**
4444
+ * Tool execution cost reported by the MCP server.
4445
+ */
4446
+ cost?: number;
4447
+ };
4448
+ /**
4449
+ * Mail module name used for display.
4450
+ */
4451
+ moduleName?: string;
4452
+ /**
4453
+ * Structured tool output when provided by the Mail service.
4454
+ */
4455
+ structuredContent?: unknown;
4456
+ /**
4457
+ * Bounded HTTP-like Mail service error code.
4458
+ */
4459
+ toolErrorCode?: number;
4460
+ };
4461
+ /**
4462
+ * Script input for the "View Thread Content" effect (`mail.viewThreadContent`),
4463
+ * derived from its Tool Core definition's call_function input projection.
4464
+ *
4465
+ * View the full content of an email thread including all messages. The returned threadId follows the mail thread-id format: The id is a single opaque string; a verification stamp may be appended after a "." (e.g. 1894c2bd0f58f2b7.a83f92c1) and that stamp is part of the value, not a separate field. Pass the whole value to other tools exactly as received. A bare id with no stamp still works — tools just verify it more slowly. Thread identity is the part before the "." — a missing or different stamp never means a different thread — so if you specifically need the raw provider id for another purpose (e.g. matching a Notion mail block that stores the untagged id), it is that leading part (for Gmail, a hex string like 1894c2bd0f58f2b7). The response includes url when a direct provider link is available. When a link would help the user, including when they ask for one, cite that exact URL directly in citation syntax ([^<url>]) so it renders as a provider chip; never construct a provider URL from threadId or message IDs.
4466
+ */
4467
+ export type ViewThreadContentScriptInput = {
4468
+ /**
4469
+ * The email address of the mailbox
4470
+ */
4471
+ userEmailAddress: string;
4472
+ /**
4473
+ * The thread ID to view (from search_emails or view_thread_content). A stamped ref is accepted as-is.
4474
+ */
4475
+ threadId: string;
4476
+ /**
4477
+ * If true, returns only the most recent message. If false, returns all messages.
4478
+ */
4479
+ mostRecentMessageOnly?: boolean;
4480
+ };
4481
+ /**
4482
+ * Canonical Tool Core output for the "View Thread Content" effect (`mail.viewThreadContent`).
4483
+ * This is the definition's output schema; the effect's script surface may
4484
+ * re-encode it before returning.
4485
+ */
4486
+ export type ViewThreadContentScriptOutput = {
4487
+ /**
4488
+ * Tool output content.
4489
+ */
4490
+ content: unknown;
4491
+ /**
4492
+ * Name of the Mail tool that ran.
4493
+ */
4494
+ name: string;
4495
+ /**
4496
+ * Whether the Mail service reported a tool error.
4497
+ */
4498
+ isError?: boolean;
4499
+ /**
4500
+ * Execution metadata reported by the MCP server.
4501
+ */
4502
+ metadata?: {
4503
+ /**
4504
+ * Tool execution time in milliseconds.
4505
+ */
4506
+ executionTimeMs?: number;
4507
+ /**
4508
+ * Number of bytes processed by the tool.
4509
+ */
4510
+ bytesProcessed?: number;
4511
+ /**
4512
+ * Tool execution cost reported by the MCP server.
4513
+ */
4514
+ cost?: number;
4515
+ };
4516
+ /**
4517
+ * Mail module name used for display.
4518
+ */
4519
+ moduleName?: string;
4520
+ /**
4521
+ * Structured tool output when provided by the Mail service.
4522
+ */
4523
+ structuredContent?: unknown;
4524
+ /**
4525
+ * Bounded HTTP-like Mail service error code.
4526
+ */
4527
+ toolErrorCode?: number;
4528
+ };
4529
+ export declare class MailConnectionClient {
4530
+ private readonly invoke;
4531
+ constructor(invoke: ConnectionActionInvoker);
4532
+ addSenderNotificationPreferences(args: AddSenderNotificationPreferencesScriptInput): Promise<AddSenderNotificationPreferencesScriptOutput>;
4533
+ analyzeRecentEmailActivities(args: AnalyzeRecentEmailActivitiesScriptInput): Promise<AnalyzeRecentEmailActivitiesScriptOutput>;
4534
+ applyOutlookCategories(args: ApplyOutlookCategoriesScriptInput): Promise<ApplyOutlookCategoriesScriptOutput>;
4535
+ applyUserLabelsWithLazyCreate(args: ApplyUserLabelsWithLazyCreateScriptInput): Promise<ApplyUserLabelsWithLazyCreateScriptOutput>;
4536
+ archiveThreadsById(args: ArchiveThreadsByIdScriptInput): Promise<ArchiveThreadsByIdScriptOutput>;
4537
+ archiveThreadsByQuery(args: ArchiveThreadsByQueryScriptInput): Promise<ArchiveThreadsByQueryScriptOutput>;
4538
+ blockSender(args: BlockSenderScriptInput): Promise<BlockSenderScriptOutput>;
4539
+ createGmailFilter(args: CreateGmailFilterScriptInput): Promise<CreateGmailFilterScriptOutput>;
4540
+ createLabel(args: CreateLabelScriptInput): Promise<CreateLabelScriptOutput>;
4541
+ createMailBlock(args: CreateMailBlockScriptInput): Promise<CreateMailBlockScriptOutput>;
4542
+ createOrUpdateDraft(args: CreateOrUpdateDraftScriptInput): Promise<CreateOrUpdateDraftScriptOutput>;
4543
+ createOrUpdateDraftAllClients(args: CreateOrUpdateDraftAllClientsScriptInput): Promise<CreateOrUpdateDraftAllClientsScriptOutput>;
4544
+ createOrUpdateGmailDraft(args: CreateOrUpdateGmailDraftScriptInput): Promise<CreateOrUpdateGmailDraftScriptOutput>;
4545
+ createOrUpdateOutlookDraft(args: CreateOrUpdateOutlookDraftScriptInput): Promise<CreateOrUpdateOutlookDraftScriptOutput>;
4546
+ createOutlookCategory(args: CreateOutlookCategoryScriptInput): Promise<CreateOutlookCategoryScriptOutput>;
4547
+ createOutlookFolder(args: CreateOutlookFolderScriptInput): Promise<CreateOutlookFolderScriptOutput>;
4548
+ createOutlookRule(args: CreateOutlookRuleScriptInput): Promise<CreateOutlookRuleScriptOutput>;
4549
+ createStatusColumn(args: CreateStatusColumnScriptInput): Promise<CreateStatusColumnScriptOutput>;
4550
+ deleteGmailFilter(args: DeleteGmailFilterScriptInput): Promise<DeleteGmailFilterScriptOutput>;
4551
+ deleteLabel(args: DeleteLabelScriptInput): Promise<DeleteLabelScriptOutput>;
4552
+ deleteOutlookCategory(args: DeleteOutlookCategoryScriptInput): Promise<DeleteOutlookCategoryScriptOutput>;
4553
+ deleteOutlookRule(args: DeleteOutlookRuleScriptInput): Promise<DeleteOutlookRuleScriptOutput>;
4554
+ flagOutlookThread(args: FlagOutlookThreadScriptInput): Promise<FlagOutlookThreadScriptOutput>;
4555
+ getNotificationPreferences(args: GetNotificationPreferencesScriptInput): Promise<GetNotificationPreferencesScriptOutput>;
4556
+ healthCheck(args: HealthCheckScriptInput): Promise<HealthCheckScriptOutput>;
4557
+ listGmailFilters(args: ListGmailFiltersScriptInput): Promise<ListGmailFiltersScriptOutput>;
4558
+ listLabels(args: ListLabelsScriptInput): Promise<ListLabelsScriptOutput>;
4559
+ listMailboxViews(args: ListMailboxViewsScriptInput): Promise<ListMailboxViewsScriptOutput>;
4560
+ listOutlookCategories(args: ListOutlookCategoriesScriptInput): Promise<ListOutlookCategoriesScriptOutput>;
4561
+ listOutlookFolders(args: ListOutlookFoldersScriptInput): Promise<ListOutlookFoldersScriptOutput>;
4562
+ listOutlookRules(args: ListOutlookRulesScriptInput): Promise<ListOutlookRulesScriptOutput>;
4563
+ listStatusProperties(args: ListStatusPropertiesScriptInput): Promise<ListStatusPropertiesScriptOutput>;
4564
+ markThreadSpam(args: MarkThreadSpamScriptInput): Promise<MarkThreadSpamScriptOutput>;
4565
+ moveThreadToInbox(args: MoveThreadToInboxScriptInput): Promise<MoveThreadToInboxScriptOutput>;
4566
+ moveToOutlookFolder(args: MoveToOutlookFolderScriptInput): Promise<MoveToOutlookFolderScriptOutput>;
4567
+ readAttachment(args: ReadAttachmentScriptInput): Promise<ReadAttachmentScriptOutput>;
4568
+ removeOutlookCategories(args: RemoveOutlookCategoriesScriptInput): Promise<RemoveOutlookCategoriesScriptOutput>;
4569
+ removeSenderNotificationPreferences(args: RemoveSenderNotificationPreferencesScriptInput): Promise<RemoveSenderNotificationPreferencesScriptOutput>;
4570
+ removeUserLabels(args: RemoveUserLabelsScriptInput): Promise<RemoveUserLabelsScriptOutput>;
4571
+ searchEmails(args: SearchEmailsScriptInput): Promise<SearchEmailsScriptOutput>;
4572
+ searchOutlookEmails(args: SearchOutlookEmailsScriptInput): Promise<SearchOutlookEmailsScriptOutput>;
4573
+ sendExistingDraft(args: SendExistingDraftScriptInput): Promise<SendExistingDraftScriptOutput>;
4574
+ sendNewEmail(args: SendNewEmailScriptInput): Promise<SendNewEmailScriptOutput>;
4575
+ setAccountNotificationPreference(args: SetAccountNotificationPreferenceScriptInput): Promise<SetAccountNotificationPreferenceScriptOutput>;
4576
+ setReadStatus(args: SetReadStatusScriptInput): Promise<SetReadStatusScriptOutput>;
4577
+ setReminder(args: SetReminderScriptInput): Promise<SetReminderScriptOutput>;
4578
+ setViewNotificationPreferences(args: SetViewNotificationPreferencesScriptInput): Promise<SetViewNotificationPreferencesScriptOutput>;
4579
+ starThread(args: StarThreadScriptInput): Promise<StarThreadScriptOutput>;
4580
+ trashThread(args: TrashThreadScriptInput): Promise<TrashThreadScriptOutput>;
4581
+ unblockSender(args: UnblockSenderScriptInput): Promise<UnblockSenderScriptOutput>;
4582
+ unsetReminder(args: UnsetReminderScriptInput): Promise<UnsetReminderScriptOutput>;
4583
+ unsubscribeSender(args: UnsubscribeSenderScriptInput): Promise<UnsubscribeSenderScriptOutput>;
4584
+ updateGmailFilter(args: UpdateGmailFilterScriptInput): Promise<UpdateGmailFilterScriptOutput>;
4585
+ updateLabel(args: UpdateLabelScriptInput): Promise<UpdateLabelScriptOutput>;
4586
+ updateOutlookRule(args: UpdateOutlookRuleScriptInput): Promise<UpdateOutlookRuleScriptOutput>;
4587
+ updateStatus(args: UpdateStatusScriptInput): Promise<UpdateStatusScriptOutput>;
4588
+ viewThreadContent(args: ViewThreadContentScriptInput): Promise<ViewThreadContentScriptOutput>;
4589
+ }
4590
+ //# sourceMappingURL=mail.generated.d.ts.map