Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe ID of the message to remove from trash

Implementation Reference

  • 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) }) }
  • 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) }) } )

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