feat(gmail): add edit draft and update label tools#4374
feat(gmail): add edit draft and update label tools#4374waleedlatif1 merged 6 commits intostagingsimstudioai/sim:stagingfrom waleedlatif1/gmail-edit-draft-v2simstudioai/sim:waleedlatif1/gmail-edit-draft-v2Copy head branch name to clipboard
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Wires Edit Draft into the Gmail block UI/operation selector (adds required Introduces a tool-only Reviewed by Cursor Bugbot for commit 44b97ad. Configure here. |
Greptile SummaryThis PR adds two new Gmail tools —
Confidence Score: 4/5Safe to merge after fixing the knowledge.mdx docs regression; all Gmail wiring is correct One P1 finding (knowledge.mdx shows raw JS expression in public docs) caps the score at 4. The Gmail tool implementations, contract schemas, block wiring, and registry entries are all correct. The P2 error-detail finding in edit-draft/route.ts is non-blocking. apps/docs/content/docs/en/tools/knowledge.mdx — rerankerModel description renders raw JS instead of model names Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Gmail Block (V1/V2)
participant Tool as gmail_edit_draft_v2
participant Route as /api/tools/gmail/edit-draft
participant Gmail as Gmail API
UI->>Tool: params (draftId, to, body, ...)
Tool->>Route: POST /api/tools/gmail/edit-draft
Route->>Route: checkInternalAuth()
Route->>Route: parseRequest(gmailEditDraftContract)
alt has attachments
Route->>Route: processFilesToUserFiles()
Route->>Route: downloadFileFromStorage()
Route->>Route: buildMimeMessage()
else no attachments
Route->>Route: buildSimpleEmailMessage()
end
Route->>Gmail: PUT /drafts/{draftId}
Gmail-->>Route: { id, message: { id, threadId, labelIds } }
Route-->>Tool: { success, output: { draftId, messageId, threadId, labelIds } }
Tool-->>UI: output
Note over UI,Gmail: gmail_update_label_v2 (tool-only / agent-facing)
participant Agent as Agent/MCP
participant LabelTool as gmail_update_label_v2
Agent->>LabelTool: params (labelId, name, visibility)
LabelTool->>Gmail: PATCH /labels/{labelId}
Gmail-->>LabelTool: { id, name, messageListVisibility, labelListVisibility, type }
LabelTool-->>Agent: output
Reviews (2): Last reviewed commit: "fix(knowledge): inline reranker model li..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 44b97ad. Configure here.
Summary
gmail_edit_draft_v2— updates a Gmail draft in place viaPUT /drafts/{id}so Mothership no longer has to delete and recreate (which churns the draft ID)gmail_update_label_v2— partial label updates viaPATCH /labels/{id}(rename, change visibility) without losing the label IDEdit Draftoperation into the Gmail block (V2) reusing existing send/draft fields plus adraftIdinputgmail.modify/gmail.labelsscopes — no re-auth neededType of Change
Testing
Tested manually. Validated both tools against the official Gmail API docs (drafts.update and labels.patch) and confirmed wiring across tool registry, barrel exports, and block definition.
Checklist