trash_message
Move an email to trash by providing its message ID, removing it from the inbox.
Instructions
Move a message to the trash
Input 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' tool on the MCP server via server.tool()
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)Handler function for trash_message that calls the Gmail API users.messages.trash with the provided message 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 trash_message - accepts a single required string parameter 'id' (the message ID to trash)
{ id: z.string().describe("The ID of the message to move to trash") },