Skip to main content
Glama

trash_message

Move unwanted Gmail messages to trash using message ID to declutter your inbox and manage email organization.

Instructions

Move a message to the trash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the message to move to trash

Implementation Reference

  • src/index.ts:676-687 (registration)
    Registration of the 'trash_message' MCP tool, including input schema (message ID) and handler that uses the Gmail API to move the specified message to trash via the shared handleTool wrapper.
    server.tool("trash_message",
      "Move a message to the trash",
      {
        id: z.string().describe("The ID of the message to move to trash")
      },
      async (params) => {
        return handleTool(config, async (gmail: gmail_v1.Gmail) => {
          const { data } = await gmail.users.messages.trash({ userId: 'me', id: params.id })
          return formatResponse(data)
        })
      }
    )
  • The handler function for the 'trash_message' tool. It invokes the shared handleTool utility with the Gmail API call to trash the message identified by the provided ID.
    async (params) => {
      return handleTool(config, async (gmail: gmail_v1.Gmail) => {
        const { data } = await gmail.users.messages.trash({ userId: 'me', id: params.id })
        return formatResponse(data)
      })
    }
  • Input schema for the 'trash_message' tool using Zod: requires a string 'id' parameter for the Gmail message ID.
    {
      id: z.string().describe("The ID of the message to move to 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/faithk7/gmail-mcp'

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