schedule_post
Schedule a social media post for future publication on X, Instagram, or Threads. Set content, date, and optional media attachments.
Instructions
Schedule a post for future publication
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | Yes | ||
| content | Yes | Post content | |
| scheduledFor | Yes | ISO 8601 datetime (e.g., 2025-10-14T10:00:00Z) | |
| mediaUrls | No | Optional media URLs to attach |
Implementation Reference
- src/index.ts:250-274 (handler)Handler function that schedules a post: fetches accounts, finds the matching platform account, then calls POST /schedule API with accountId, platform, content, scheduledFor, and mediaUrls.
private async schedulePost(args: any) { const { accounts } = await this.apiRequest('GET', '/accounts'); const account = accounts.find((a: any) => a.provider === args.platform); if (!account) { throw new Error(`No ${args.platform} account connected. Available accounts: ${accounts.map((a: any) => a.provider).join(', ')}`); } const result = await this.apiRequest('POST', '/schedule', { accountId: account.id, platform: args.platform, content: args.content, scheduledFor: args.scheduledFor, mediaUrls: args.mediaUrls || [], }); return { content: [ { type: 'text', text: `✅ Post scheduled for ${args.scheduledFor} on ${args.platform}!\nScheduled Post ID: ${result.scheduledPost.id}`, }, ], }; } - src/index.ts:56-81 (schema)Schema registration for schedule_post tool defining input properties: platform (enum X/INSTAGRAM/THREADS), content (string), scheduledFor (ISO 8601 string), and optional mediaUrls (string array). Required: platform, content, scheduledFor.
{ name: 'schedule_post', description: 'Schedule a post for future publication', inputSchema: { type: 'object', properties: { platform: { type: 'string', enum: ['X', 'INSTAGRAM', 'THREADS'], }, content: { type: 'string', description: 'Post content', }, scheduledFor: { type: 'string', description: 'ISO 8601 datetime (e.g., 2025-10-14T10:00:00Z)', }, mediaUrls: { type: 'array', items: { type: 'string' }, description: 'Optional media URLs to attach', }, }, required: ['platform', 'content', 'scheduledFor'], }, - src/index.ts:30-130 (registration)Tool registration via ListToolsRequestSchema handler, listing schedule_post as one of the available tools.
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { name: 'publish_post', description: 'Publish a social media post immediately', inputSchema: { type: 'object', properties: { platform: { type: 'string', enum: ['X', 'INSTAGRAM', 'THREADS'], description: 'Social media platform', }, content: { type: 'string', description: 'Post content/text', }, mediaUrls: { type: 'array', items: { type: 'string' }, description: 'Optional media URLs to attach', }, }, required: ['platform', 'content'], }, }, { name: 'schedule_post', description: 'Schedule a post for future publication', inputSchema: { type: 'object', properties: { platform: { type: 'string', enum: ['X', 'INSTAGRAM', 'THREADS'], }, content: { type: 'string', description: 'Post content', }, scheduledFor: { type: 'string', description: 'ISO 8601 datetime (e.g., 2025-10-14T10:00:00Z)', }, mediaUrls: { type: 'array', items: { type: 'string' }, description: 'Optional media URLs to attach', }, }, required: ['platform', 'content', 'scheduledFor'], }, }, { name: 'get_accounts', description: 'Get list of connected social media accounts', inputSchema: { type: 'object', properties: {}, }, }, { name: 'get_posts', description: 'Get recent posts published via the API', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of posts to retrieve (max 100)', default: 50, minimum: 1, maximum: 100, }, }, }, }, { name: 'cancel_scheduled_post', description: 'Cancel a scheduled post before it publishes', inputSchema: { type: 'object', properties: { postId: { type: 'string', description: 'The ID of the scheduled post to cancel', }, }, required: ['postId'], }, }, { name: 'get_post_stats', description: 'Get statistics about your posts', inputSchema: { type: 'object', properties: {}, }, }, ], })); - src/index.ts:140-141 (registration)Call routing in CallToolRequestSchema: when name is 'schedule_post', invokes the schedulePost handler method.
case 'schedule_post': return await this.schedulePost(args);