Skip to main content
Glama

delete_message

Permanently delete a Gmail message by its ID to remove unwanted emails from your inbox and free up storage space.

Instructions

Immediately and permanently delete a message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the message to delete

Implementation Reference

  • src/index.ts:529-539 (registration)
    Registration of the 'delete_message' tool including input schema and handler function. The handler authenticates via handleTool, calls Gmail API to permanently delete the message by ID, and formats the response.
    server.tool("delete_message", "Immediately and permanently delete a message", { id: z.string().describe("The ID of the message to delete") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) }
  • Handler function that executes the delete_message tool logic: deletes the specified message ID using Gmail API after authentication.
    async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.delete({ userId: 'me', id: params.id }) return formatResponse(data) }) }
  • Input schema for delete_message tool: requires a string 'id' parameter for the message ID.
    { id: z.string().describe("The ID of the message to delete") },

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/HitmanLy007/gmail-mcp'

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