untrash_message
Restore deleted Gmail messages from trash by providing the message ID. This tool recovers accidentally deleted emails to your inbox.
Instructions
Remove a message from the trash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the message to remove from trash |
Implementation Reference
- src/index.ts:675-686 (registration)Registration of the 'untrash_message' MCP tool, including input schema (message ID), description, and handler function that uses the Gmail API to untrash the specified message and formats the response.server.tool("untrash_message", "Remove a message from the trash", { id: z.string().describe("The ID of the message to remove from trash") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.untrash({ userId: 'me', id: params.id }) return formatResponse(data) }) } )
- src/index.ts:680-685 (handler)The handler function for 'untrash_message' tool, which invokes the Gmail API's users.messages.untrash method with the provided message ID.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.untrash({ userId: 'me', id: params.id }) return formatResponse(data) }) }
- src/index.ts:677-679 (schema)Input schema for 'untrash_message' tool using Zod, requiring a string 'id' for the message ID.{ id: z.string().describe("The ID of the message to remove from trash") },