schedule_post
Schedule social media posts for future publication on X, Instagram, or Threads. Set content, media, and timing to automate posting.
Instructions
Schedule a post for future publication
Input Schema
TableJSON 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)The main handler function for the 'schedule_post' tool. It retrieves connected accounts, validates the platform account exists, schedules the post via the Sociona API /schedule endpoint, and returns a success message with the scheduled post ID.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:59-81 (schema)Input schema definition for the 'schedule_post' tool, specifying required fields like platform, content, scheduledFor, and optional mediaUrls.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:56-82 (registration)Registration of the 'schedule_post' tool in the list of available tools returned by ListToolsRequestSchema handler.{ 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:140-141 (registration)Dispatcher case in the CallToolRequestSchema handler that routes 'schedule_post' calls to the schedulePost method.case 'schedule_post': return await this.schedulePost(args);