mark-as-unread
Mark specific emails as unread by inputting their IDs. Useful for managing email follow-ups or reminders within the Meme MCP Server environment.
Instructions
Mark emails as unread
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emailIds | Yes | Array of email IDs to mark as unread |
Implementation Reference
- src/tools.ts:572-608 (registration)Registration of the MCP tool 'mark-as-unread', including Zod schema for emailIds parameter and inline async handler that delegates to VercelAIToolSet.executeAction for 'GMAIL_MARK_AS_UNREAD' action.server.tool("mark-as-unread", "Mark emails as unread", { emailIds: z.array(z.string()).describe("Array of email IDs to mark as unread"), }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_MARK_AS_UNREAD", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Emails marked as unread successfully!\n\nMarked ${args.emailIds.length} email(s) as unread.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to mark emails as unread: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error marking emails as unread:', error); return { content: [{ type: "text", text: `Error marking emails as unread: ${error instanceof Error ? error.message : String(error)}` }], }; } });
- src/tools.ts:573-574 (schema)Input schema using Zod: array of email ID strings.emailIds: z.array(z.string()).describe("Array of email IDs to mark as unread"), }, async (args, extra) => {
- src/tools.ts:574-608 (handler)Handler function that executes the tool logic: calls toolset.executeAction with GMAIL_MARK_AS_UNREAD, handles success/error and returns MCP content response.}, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_MARK_AS_UNREAD", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Emails marked as unread successfully!\n\nMarked ${args.emailIds.length} email(s) as unread.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to mark emails as unread: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error marking emails as unread:', error); return { content: [{ type: "text", text: `Error marking emails as unread: ${error instanceof Error ? error.message : String(error)}` }], }; } });
- src/tools.ts:6-8 (helper)VercelAIToolSet instance (from composio-core) used by the handler to perform the actual Gmail 'mark as unread' action.const toolset = new VercelAIToolSet({ apiKey: process.env.COMPOSIO_API_KEY || '4xyic69yfd4610srw8cebg', });
- src/index.ts:11-11 (registration)Calls registerTools(server) which includes registration of the 'mark-as-unread' tool.registerTools(server);