Skip to main content
Glama

trash_message

Move a Gmail message to trash to delete unwanted emails and manage your inbox efficiently.

Instructions

Move a message to the trash

Input Schema

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

Implementation Reference

  • The handler function for the 'trash_message' tool. It uses the shared handleTool utility to authenticate and call the Gmail API's users.messages.trash method with the provided message ID, then formats the response.
    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) }) }
  • Zod input schema for the 'trash_message' tool, defining a required 'id' parameter as a string representing the Gmail message ID.
    { id: z.string().describe("The ID of the message to move to trash") },
  • src/index.ts:662-673 (registration)
    Registration of the 'trash_message' MCP tool on the McpServer instance, specifying name, description, input schema, and handler function.
    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) }) } )

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