Skip to main content
Glama
messages-batch-delete.ts977 B
import {z} from 'zod'; import type {McpServer} from '@modelcontextprotocol/sdk/server/mcp.js'; import type {Config} from './types.js'; import {makeGmailApiCall} from '../utils/gmail-api.js'; import {jsonResult} from '../utils/response.js'; const inputSchema = { messageIds: z.array(z.string()).describe('The IDs of messages to permanently delete'), }; const outputSchema = z.object({ success: z.literal(true), deletedCount: z.number(), }); export function registerMessagesBatchDelete(server: McpServer, config: Config): void { server.registerTool( 'gmail_messages_batch_delete', { title: 'Batch delete messages', description: 'Permanently delete multiple messages. This cannot be undone.', inputSchema, outputSchema, }, async ({messageIds}) => { await makeGmailApiCall('POST', '/users/me/messages/batchDelete', config.token, { ids: messageIds, }); return jsonResult({success: true as const, deletedCount: messageIds.length}); }, ); }

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

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