untrash_message
Restore deleted Gmail messages from the trash by providing the message ID to recover accidentally removed emails.
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:680-685 (handler)Handler function that executes the untrash_message tool by calling the Gmail API's users.messages.untrash method via the shared handleTool utility.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 the untrash_message tool, defining the required 'id' parameter as a string.{ id: z.string().describe("The ID of the message to remove from trash") },
- src/index.ts:675-686 (registration)Registration of the untrash_message tool on the MCP server, including name, description, input schema, and handler function.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) }) } )