You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add attachment support to gmail.createDraft tool
- Update MimeHelper.createMimeMessageWithAttachments to support inReplyTo
and references headers for proper threading with attachments
- Add attachments parameter to GmailService.createDraft with file reading
and MIME type inference from file extension
- Extend gmail.createDraft MCP tool schema to accept attachments array
- Add comprehensive tests for attachment handling, MIME type detection,
threading with attachments, error handling, and empty attachments
- All 522 tests pass
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
"Bash(git -C /c/Users/James/dev/workspace diff main HEAD -- workspace-server/src/services/GmailService.ts workspace-server/src/utils/MimeHelper.ts workspace-server/src/index.ts)",
Copy file name to clipboardExpand all lines: workspace-server/src/index.ts
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1299,6 +1299,32 @@ System labels that can be modified:
1299
1299
.describe(
1300
1300
'The thread ID to create the draft as a reply to. When provided, the draft will be linked to the existing thread with appropriate reply headers.',
1301
1301
),
1302
+
attachments: z
1303
+
.array(
1304
+
z.object({
1305
+
filePath: z
1306
+
.string()
1307
+
.describe(
1308
+
'Absolute local filesystem path to the file to attach (e.g., "/Users/name/downloads/report.pdf"). Use gmail.downloadAttachment first to save an email attachment locally before referencing it here.',
1309
+
),
1310
+
filename: z
1311
+
.string()
1312
+
.optional()
1313
+
.describe(
1314
+
'Display name for the attachment in the email. Defaults to the filename portion of filePath.',
1315
+
),
1316
+
mimeType: z
1317
+
.string()
1318
+
.optional()
1319
+
.describe(
1320
+
'MIME type of the attachment (e.g., "application/pdf"). Inferred from the file extension when omitted; falls back to "application/octet-stream".',
1321
+
),
1322
+
}),
1323
+
)
1324
+
.optional()
1325
+
.describe(
1326
+
'Files to attach to the draft. Each entry must reference an absolute local path. Download attachments first with gmail.downloadAttachment if needed.',
0 commit comments