Skip to main content
Glama

schedule_draft

Schedule an email draft for later delivery by specifying the draft ID and desired send time. Requires user confirmation to proceed with scheduling on the Buttondown MCP Server.

Instructions

Schedule an existing email draft to be sent at a specific time. This tool requires explicit user confirmation before proceeding as it will modify the draft's status and schedule.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmedYesMust be true to confirm the scheduling
draftIdYesThe ID of the email draft to schedule
scheduledTimeYesWhen to send the email (ISO 8601 datetime format)

Implementation Reference

  • The handler function for the MCP 'schedule_draft' tool. It checks for user confirmation, ensures the API key is set, calls the underlying API to schedule the draft, and returns the response as formatted text.
    async ({ draftId, scheduledTime, confirmed }) => { if (!confirmed) { return { content: [ { type: "text", text: JSON.stringify( { error: "User confirmation required", message: "Please ask the user if they want to schedule this draft and set confirmed=true if they agree", preview: { draftId, scheduledTime, localTime: new Date(scheduledTime).toLocaleString(), }, }, null, 2 ), }, ], }; } await this.ensureApiKey(); const response = await this.api.scheduleDraft(draftId, scheduledTime); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], };
  • Zod input schema defining parameters for the 'schedule_draft' tool: draftId (string), scheduledTime (ISO 8601 string), confirmed (boolean).
    { draftId: z.string().describe("The ID of the email draft to schedule"), scheduledTime: z .string() .describe("When to send the email (ISO 8601 datetime format)"), confirmed: z .boolean() .describe("Must be true to confirm the scheduling"), },
  • Registration of the 'schedule_draft' tool on the MCP server using this.server.tool() with name, description, schema, and handler.
    "schedule_draft", "Schedule an existing email draft to be sent at a specific time. This tool requires explicit user confirmation before proceeding as it will modify the draft's status and schedule.", { draftId: z.string().describe("The ID of the email draft to schedule"), scheduledTime: z .string() .describe("When to send the email (ISO 8601 datetime format)"), confirmed: z .boolean() .describe("Must be true to confirm the scheduling"), }, async ({ draftId, scheduledTime, confirmed }) => { if (!confirmed) { return { content: [ { type: "text", text: JSON.stringify( { error: "User confirmation required", message: "Please ask the user if they want to schedule this draft and set confirmed=true if they agree", preview: { draftId, scheduledTime, localTime: new Date(scheduledTime).toLocaleString(), }, }, null, 2 ), }, ], }; } await this.ensureApiKey(); const response = await this.api.scheduleDraft(draftId, scheduledTime); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } );
  • The ButtondownAPI client helper method that implements scheduling a draft by sending a PATCH request to update scheduled_for, publish_date, and status.
    async scheduleDraft( draftId: string, scheduledTime: string ): Promise<ButtondownEmail> { return this.request<ButtondownEmail>(`/emails/${draftId}`, { method: "PATCH", body: JSON.stringify({ scheduled_for: scheduledTime, publish_date: scheduledTime, status: "scheduled", }), }); }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/The-Focus-AI/buttondown-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server