trash_thread
Move an email thread to trash by providing its ID. Quickly delete conversation threads from your Gmail inbox.
Instructions
Move a thread to the trash
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the thread to move to trash |
Implementation Reference
- src/index.ts:805-816 (handler)Registration + handler for the 'trash_thread' tool. It calls gmail.users.threads.trash() with the provided thread ID to move a thread to trash.
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) }) } ) - src/index.ts:48-48 (helper)Helper that wraps the response in MCP content format
const formatResponse = (response: any) => ({ content: [{ type: "text", text: JSON.stringify(response) }] }) - src/index.ts:805-816 (registration)The tool is registered via server.tool() with name 'trash_thread'
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) }) } )