cancel_scheduled_post
Cancel a scheduled social media post before it publishes by providing the post ID. This allows you to stop content from going live on X, Instagram, or Threads.
Instructions
Cancel a scheduled post before it publishes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| postId | Yes | The ID of the scheduled post to cancel |
Implementation Reference
- src/index.ts:318-333 (handler)The core handler function that performs the tool logic: makes a DELETE API request to `/schedule/${postId}` using the shared apiRequest method, checks for success, and returns a success message or throws an error.private async cancelScheduledPost(args: any) { const result = await this.apiRequest('DELETE', `/schedule/${args.postId}`); if (result.success) { return { content: [ { type: 'text', text: `✅ Scheduled post ${args.postId} has been canceled.`, }, ], }; } else { throw new Error(result.message || 'Failed to cancel scheduled post'); } }
- src/index.ts:110-119 (schema)Input schema definition for the cancel_scheduled_post tool, specifying the required 'postId' parameter.inputSchema: { type: 'object', properties: { postId: { type: 'string', description: 'The ID of the scheduled post to cancel', }, }, required: ['postId'], },
- src/index.ts:107-120 (registration)Tool registration in the ListTools response, including name, description, and input schema.{ 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'], }, },
- src/index.ts:148-149 (registration)Dispatch/registration in the CallToolRequest handler switch statement that routes to the cancelScheduledPost method.case 'cancel_scheduled_post': return await this.cancelScheduledPost(args);