delete_message
Permanently delete a Gmail message by its ID to remove unwanted emails from your inbox and free up storage space.
Instructions
Immediately and permanently delete a message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the message to delete |
Implementation Reference
- src/index.ts:529-539 (registration)Registration of the 'delete_message' tool including input schema and handler function. The handler authenticates via handleTool, calls Gmail API to permanently delete the message by ID, and formats the response.server.tool("delete_message", "Immediately and permanently delete a message", { id: z.string().describe("The ID of the message to delete") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) }
- src/index.ts:534-539 (handler)Handler function that executes the delete_message tool logic: deletes the specified message ID using Gmail API after authentication.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) }
- src/index.ts:531-533 (schema)Input schema for delete_message tool: requires a string 'id' parameter for the message ID.{ id: z.string().describe("The ID of the message to delete") },