Skip to main content
Glama

schedule_draft

Schedule an existing email draft for automated sending at a specified time using the Buttondown newsletter service.

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
draftIdYesThe ID of the email draft to schedule
scheduledTimeYesWhen to send the email (ISO 8601 datetime format)
confirmedYesMust be true to confirm the scheduling

Implementation Reference

  • Registration of the MCP 'schedule_draft' tool using this.server.tool(). Includes tool description, Zod input schema (draftId: string, scheduledTime: string, confirmed: boolean), and inline handler function that checks confirmation, ensures API key, calls api.scheduleDraft(draftId, scheduledTime), and returns JSON response.
    this.server.tool( "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), }, ], }; } );
  • Core handler logic for scheduling a draft via Buttondown API: PATCH /emails/{draftId} with body {scheduled_for, publish_date: scheduledTime, status: 'scheduled'}.
    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", }), }); }
  • TypeScript interface IButtondownAPI defining scheduleDraft(draftId: string, scheduledTime: string): Promise<ButtondownEmail>.
    scheduleDraft( draftId: string, scheduledTime: string ): Promise<ButtondownEmail>;

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