Skip to content

Commit cc2a87e

Browse files
authored
fix(gmail): include draft id in update_draft tool schema (#5925)
* fix(gmail): require draft id in update_draft schema * fix(gmail): validate update_draft id format
1 parent 6d668fb commit cc2a87e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • packages/components/nodes/tools/Gmail

packages/components/nodes/tools/Gmail/core.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ const CreateDraftSchema = z.object({
3838
bcc: z.string().optional().describe('BCC email address(es), comma-separated')
3939
})
4040

41+
const UpdateDraftSchema = CreateDraftSchema.extend({
42+
id: z
43+
.string()
44+
.regex(/^[A-Za-z0-9_-]+$/, 'Draft ID must contain only URL-safe characters')
45+
.describe('ID of the draft to update')
46+
})
47+
4148
const SendMessageSchema = z.object({
4249
to: z.string().describe('Recipient email address(es), comma-separated'),
4350
subject: z.string().optional().describe('Email subject'),
@@ -222,7 +229,7 @@ class UpdateDraftTool extends BaseGmailTool {
222229
const toolInput = {
223230
name: 'update_draft',
224231
description: 'Update a specific draft in Gmail',
225-
schema: CreateDraftSchema,
232+
schema: UpdateDraftSchema,
226233
baseUrl: 'https://gmail.googleapis.com/gmail/v1/users/me/drafts',
227234
method: 'PUT',
228235
headers: {}

0 commit comments

Comments
 (0)