Skip to main content
Glama

trash_message

Move unwanted Gmail messages to trash to declutter your inbox and manage email storage 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 handleTool to authenticate and calls the Gmail API's users.messages.trash method to move the specified message 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) }) }
  • Input schema for the 'trash_message' tool using Zod, requiring a single 'id' parameter for the message ID.
    { id: z.string().describe("The ID of the message to move to trash") },
  • src/index.ts:643-654 (registration)
    Registration of the 'trash_message' tool on the MCP server, including name, description, input schema, and inline 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/HitmanLy007/gmail-mcp'

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