trash_thread
Move email threads to trash in Gmail to organize your inbox by removing unwanted conversations.
Instructions
Move a thread to the trash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the thread to move to trash |
Implementation Reference
- src/index.ts:810-816 (handler)The handler function for the 'trash_thread' tool. It uses the Gmail API to move the specified thread to the trash by calling gmail.users.threads.trash with the provided thread ID.async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.threads.trash({ userId: 'me', id: params.id }) return formatResponse(data) }) } )
- src/index.ts:807-809 (schema)The input schema for the 'trash_thread' tool, defined using Zod. It requires a single 'id' parameter which is the thread ID.{ id: z.string().describe("The ID of the thread to move to trash") },
- src/index.ts:805-816 (registration)The registration of the 'trash_thread' tool on the MCP server using server.tool, including description, schema, and handler.server.tool("trash_thread", "Move a thread to the trash", { id: z.string().describe("The ID of the thread to move to trash") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.threads.trash({ userId: 'me', id: params.id }) return formatResponse(data) }) } )