delete_email
Permanently remove unwanted emails from your Gmail inbox to manage clutter and maintain organization.
Instructions
Permanently delete an email
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| messageId | Yes | Email message ID to delete |
Implementation Reference
- src/tools.ts:80-84 (handler)Tool handler for 'delete_email': validates input schema and delegates to GmailService.deleteEmail, returning success message.
case "delete_email": { const v = validated as z.infer<typeof schemas.delete_email>; await gmailService.deleteEmail(v.messageId); return { content: [{ type: "text", text: `Email ${v.messageId} deleted successfully.` }] }; } - src/tools.ts:11-11 (schema)Zod input schema definition for the delete_email tool.
delete_email: z.object({ messageId: z.string().describe("Email message ID to delete") }), - src/lib.ts:48-48 (registration)MCP server registration for listing tools, which includes 'delete_email' via getToolDefinitions() from tools.ts.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions() })); - src/gmail-service.ts:72-74 (helper)GmailService method implementing the actual Gmail API deletion call for a single email.
async deleteEmail(id: string): Promise<void> { await this.gmail.users.messages.delete({ userId: 'me', id }); }