Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/components/nodes/tools/Gmail/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const CreateDraftSchema = z.object({
bcc: z.string().optional().describe('BCC email address(es), comma-separated')
})

const UpdateDraftSchema = CreateDraftSchema.extend({
id: z
.string()
.regex(/^[A-Za-z0-9_-]+$/, 'Draft ID must contain only URL-safe characters')
.describe('ID of the draft to update')
})

const SendMessageSchema = z.object({
to: z.string().describe('Recipient email address(es), comma-separated'),
subject: z.string().optional().describe('Email subject'),
Expand Down Expand Up @@ -222,7 +229,7 @@ class UpdateDraftTool extends BaseGmailTool {
const toolInput = {
name: 'update_draft',
description: 'Update a specific draft in Gmail',
schema: CreateDraftSchema,
schema: UpdateDraftSchema,
baseUrl: 'https://gmail.googleapis.com/gmail/v1/users/me/drafts',
method: 'PUT',
headers: {}
Expand Down
Loading