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