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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The 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) }) } )
- src/index.ts:681-686 (handler)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) }) }
- src/index.ts:678-680 (schema)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") },