Skip to main content
Glama

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
NameRequiredDescriptionDefault
messageIdYesEmail message ID to delete

Implementation Reference

  • 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.` }] }; }
  • 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() }));
  • 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 }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/muammar-yacoob/GMail-Manager-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server