move-to-trash
Move emails to trash by specifying their IDs, helping users manage inbox clutter effectively within the Meme MCP Server environment.
Instructions
Move emails to trash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emailIds | Yes | Array of email IDs to move to trash |
Implementation Reference
- src/tools.ts:610-646 (registration)Full registration of the 'move-to-trash' tool, including schema and inline handler function that delegates to Composio's GMAIL_MOVE_TO_TRASH action.server.tool("move-to-trash", "Move emails to trash", { emailIds: z.array(z.string()).describe("Array of email IDs to move to trash"), }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_MOVE_TO_TRASH", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `🗑️ Emails moved to trash successfully!\n\nMoved ${args.emailIds.length} email(s) to trash.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to move emails to trash: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error moving emails to trash:', error); return { content: [{ type: "text", text: `Error moving emails to trash: ${error instanceof Error ? error.message : String(error)}` }], }; } });
- src/tools.ts:612-646 (handler)The core handler logic for 'move-to-trash' tool. It executes the 'GMAIL_MOVE_TO_TRASH' action using the VercelAIToolSet with the provided emailIds, handles success/error responses, and returns formatted text content.}, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_MOVE_TO_TRASH", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `🗑️ Emails moved to trash successfully!\n\nMoved ${args.emailIds.length} email(s) to trash.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to move emails to trash: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error moving emails to trash:', error); return { content: [{ type: "text", text: `Error moving emails to trash: ${error instanceof Error ? error.message : String(error)}` }], }; } });
- src/tools.ts:611-611 (schema)Zod input schema defining the required 'emailIds' parameter as an array of strings.emailIds: z.array(z.string()).describe("Array of email IDs to move to trash"),