reply-to-email
Send a reply to an existing email by providing the email ID and your message content.
Instructions
Reply to an existing email
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emailId | Yes | The ID of the email to reply to | |
| message | Yes | The reply message content |
Implementation Reference
- src/tools.ts:206-240 (handler)The handler function that implements the core logic for the 'reply-to-email' tool. It uses the VercelAIToolSet (Composio) to execute the 'GMAIL_REPLY_TO_EMAIL' action with the provided emailId and message.}, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_REPLY_TO_EMAIL", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Reply sent successfully!\n\nYour reply has been sent to the original email thread.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to send reply: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error sending reply:', error); return { content: [{ type: "text", text: `Error sending reply: ${error instanceof Error ? error.message : String(error)}` }], }; } });
- src/tools.ts:204-205 (schema)Zod input schema defining the parameters for the 'reply-to-email' tool: emailId (string) and message (string).emailId: z.string().describe("The ID of the email to reply to"), message: z.string().describe("The reply message content"),
- src/tools.ts:203-240 (registration)The server.tool call that registers the 'reply-to-email' tool on the MCP server, including schema and inline handler function.server.tool("reply-to-email", "Reply to an existing email", { emailId: z.string().describe("The ID of the email to reply to"), message: z.string().describe("The reply message content"), }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_REPLY_TO_EMAIL", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Reply sent successfully!\n\nYour reply has been sent to the original email thread.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to send reply: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error sending reply:', error); return { content: [{ type: "text", text: `Error sending reply: ${error instanceof Error ? error.message : String(error)}` }], }; } });