Skip to main content
Glama

batch_delete_messages

Delete multiple Gmail messages at once by specifying their IDs to clear inbox clutter and manage email storage efficiently.

Instructions

Delete multiple messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesThe IDs of the messages to delete

Implementation Reference

  • The handler function for the batch_delete_messages tool. It invokes handleTool for authentication and calls the Gmail API's users.messages.batchDelete method with the provided message IDs.
    async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.batchDelete({ userId: 'me', requestBody: { ids: params.ids } }) return formatResponse(data) }) }
  • Zod input schema for the batch_delete_messages tool, requiring an array of message ID strings.
    { ids: z.array(z.string()).describe("The IDs of the messages to delete") },
  • src/index.ts:534-545 (registration)
    Registration of the batch_delete_messages tool on the MCP server using server.tool(), including name, description, schema, and handler.
    server.tool("batch_delete_messages", "Delete multiple messages", { ids: z.array(z.string()).describe("The IDs of the messages to delete") }, async (params) => { return handleTool(config, async (gmail: gmail_v1.Gmail) => { const { data } = await gmail.users.messages.batchDelete({ userId: 'me', requestBody: { ids: params.ids } }) 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