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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the message to move to trash |
Implementation Reference
- src/index.ts:648-653 (handler)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) }) }
- src/index.ts:645-647 (schema)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) }) } )