mark-as-read
Mark emails as read by providing email IDs to clear unread notifications and organize your inbox.
Instructions
Mark emails as read
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emailIds | Yes | Array of email IDs to mark as read |
Implementation Reference
- src/tools.ts:534-570 (registration)Full registration of the 'mark-as-read' MCP tool, including schema, description, and inline handler that delegates to Composio's GMAIL_MARK_AS_READ action to mark specified Gmail email IDs as read.server.tool("mark-as-read", "Mark emails as read", { emailIds: z.array(z.string()).describe("Array of email IDs to mark as read"), }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_MARK_AS_READ", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Emails marked as read successfully!\n\nMarked ${args.emailIds.length} email(s) as read.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to mark emails as read: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error marking emails as read:', error); return { content: [{ type: "text", text: `Error marking emails as read: ${error instanceof Error ? error.message : String(error)}` }], }; } });
- src/tools.ts:536-570 (handler)The handler function that implements the core logic of the 'mark-as-read' tool by calling Composio's executeAction with 'GMAIL_MARK_AS_READ' and handling the response.}, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_MARK_AS_READ", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Emails marked as read successfully!\n\nMarked ${args.emailIds.length} email(s) as read.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to mark emails as read: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error marking emails as read:', error); return { content: [{ type: "text", text: `Error marking emails as read: ${error instanceof Error ? error.message : String(error)}` }], }; } });
- src/tools.ts:535-535 (schema)Input schema for the 'mark-as-read' tool defining the required 'emailIds' parameter as an array of strings.emailIds: z.array(z.string()).describe("Array of email IDs to mark as read"),