delete_thread
Permanently remove a Gmail thread by providing its ID to clean up your inbox.
Instructions
Delete a thread
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the thread to delete |
Implementation Reference
- src/index.ts:721-727 (handler)The async handler function that executes the delete_thread tool logic. It calls gmail.users.threads.delete with the provided thread ID and returns the response.
async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.threads.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) } ) - src/index.ts:718-720 (schema)Zod schema defining the input parameter for delete_thread: requires an 'id' string describing the thread ID to delete.
{ id: z.string().describe("The ID of the thread to delete") }, - src/index.ts:716-727 (registration)Registration of the 'delete_thread' tool on the MCP server using server.tool(), with description 'Delete a thread', schema, and handler.
server.tool("delete_thread", "Delete a thread", { id: z.string().describe("The ID of the thread to delete") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.threads.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) } )