Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe ID of the thread to move to trash

Implementation Reference

  • 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) }) } )
  • 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) }) } )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/faithk7/gmail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server