send-draft
Send a draft email from the Meme MCP Server by providing the draft ID. Simplify the process of dispatching pre-composed emails directly through the server.
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:323-359 (registration)Registration of the 'send-draft' tool using server.tool(), including inline schema and handler function.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)}` }], }; } });
- src/tools.ts:324-325 (schema)Input schema for the 'send-draft' tool: requires draftId as string.draftId: z.string().describe("The ID of the draft to send"), }, async (args, extra) => {
- src/tools.ts:325-359 (handler)Handler function executes GMAIL_SEND_DRAFT action via toolset, handles success/error responses with formatted text output.}, 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/index.ts:11-12 (registration)Invocation of registerTools(server) which registers all tools including 'send-draft'.registerTools(server);