send-draft
Send a draft email by specifying its ID to deliver prepared messages from the Meme MCP Server's email functionality.
Instructions
Send a draft email
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draftId | Yes | The ID of the draft to send |
Implementation Reference
- src/tools.ts:325-358 (handler)The handler function for the 'send-draft' tool. It uses the Composio toolset to execute the 'GMAIL_SEND_DRAFT' action with the provided draftId, handles success/error responses, and returns formatted text content.}, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_SEND_DRAFT", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Draft sent successfully!\n\nYour draft has been sent and is now in your Gmail sent folder.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to send draft: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error sending draft:', error); return { content: [{ type: "text", text: `Error sending draft: ${error instanceof Error ? error.message : String(error)}` }], }; }
- src/tools.ts:324-324 (schema)Zod input schema for the 'send-draft' tool, requiring a 'draftId' string parameter.draftId: z.string().describe("The ID of the draft to send"),
- src/tools.ts:323-359 (registration)Registration of the 'send-draft' MCP tool on the server, including description, schema, and inline handler implementation.server.tool("send-draft", "Send a draft email", { draftId: z.string().describe("The ID of the draft to send"), }, async (args, extra) => { try { const userAddress = "default-user"; const result = await toolset.executeAction({ action: "GMAIL_SEND_DRAFT", entityId: userAddress, params: args }); if (result.successful) { return { content: [{ type: "text", text: `✅ Draft sent successfully!\n\nYour draft has been sent and is now in your Gmail sent folder.` }], }; } else { return { content: [{ type: "text", text: `❌ Failed to send draft: ${result.error || 'Unknown error'}` }], }; } } catch (error) { console.error('Error sending draft:', error); return { content: [{ type: "text", text: `Error sending draft: ${error instanceof Error ? error.message : String(error)}` }], }; } });