Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe 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) }) } )
  • 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) }) }
  • 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") },

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/nk900600/gmail-mcp'

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