posterly-mcp-server 0.47.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -228,6 +228,23 @@ export interface InstagramPostSettings {
228
228
  media_accessibility?: Array<{ index: number; asset_id?: string; source_url?: string; alt_text: string }>;
229
229
  reel_cover_url?: string;
230
230
  reel_thumb_offset?: number;
231
+ is_ai_generated?: boolean;
232
+ audio_id?: string;
233
+ caption_addon?: {
234
+ type?: 'none' | 'poll' | 'comment_prompt';
235
+ kind?: 'none' | 'poll' | 'comment_prompt';
236
+ options?: string[];
237
+ extended_duration?: boolean;
238
+ } | null;
239
+ poll_attachment?: {
240
+ option_a?: string;
241
+ option_b?: string;
242
+ option_c?: string;
243
+ option_d?: string;
244
+ options?: string[];
245
+ };
246
+ is_comment_prompt_used?: boolean;
247
+ is_poll_duration_extended?: boolean;
231
248
  }
232
249
 
233
250
  export type PlatformPostSettings = Record<string, unknown>;
@@ -1619,9 +1636,12 @@ export class PosterlyClient {
1619
1636
 
1620
1637
  async deletePost(
1621
1638
  id: number,
1622
- options?: { confirmPublished?: boolean },
1639
+ options?: { confirmPublished?: boolean; deleteMode?: 'posterly' | 'platform' },
1623
1640
  ): Promise<{ deleted: boolean; id: number; platform_delete?: string }> {
1624
- const qs = options?.confirmPublished ? '?confirm_published=true' : '';
1641
+ const params = new URLSearchParams();
1642
+ if (options?.confirmPublished) params.set('confirm_published', 'true');
1643
+ if (options?.deleteMode) params.set('delete_mode', options.deleteMode);
1644
+ const qs = params.size ? `?${params}` : '';
1625
1645
  return this.request('DELETE', `/posts/${id}${qs}`);
1626
1646
  }
1627
1647
 
@@ -5,4 +5,4 @@
5
5
  // tool set (minus the intentional pre-auth signup tools that only this stdio
6
6
  // package exposes). `npm run check:mcp-parity` enforces both the version match
7
7
  // and the tool-list match, and runs in the pre-commit hook.
8
- export const POSTERLY_MCP_VERSION = '0.47.0';
8
+ export const POSTERLY_MCP_VERSION = '0.48.0';
@@ -31,6 +31,31 @@ export const instagramSettingsSchema = z.object({
31
31
  reel_thumb_offset: z.number().nonnegative().optional(),
32
32
  is_ai_generated: z.boolean().optional().describe('Label the parent Instagram media container as AI-generated. For carousels, set on the parent only.'),
33
33
  audio_id: z.string().optional().describe('Licensed Instagram audio ID for Reels. Meta-linked Facebook Login accounts only.'),
34
+ caption_addon: z.union([
35
+ z.object({
36
+ type: z.enum(['none', 'poll', 'comment_prompt']).optional(),
37
+ kind: z.enum(['none', 'poll', 'comment_prompt']).optional(),
38
+ options: z.array(z.string()).max(4).optional(),
39
+ extended_duration: z.boolean().optional(),
40
+ poll_attachment: z.object({
41
+ option_a: z.string().optional(),
42
+ option_b: z.string().optional(),
43
+ option_c: z.string().optional(),
44
+ option_d: z.string().optional(),
45
+ options: z.array(z.string()).max(4).optional(),
46
+ }).optional(),
47
+ }),
48
+ z.null(),
49
+ ]).optional().describe('Optional Instagram caption add-on. type is none, poll, or comment_prompt. A poll needs 2 to 4 options of 1 to 25 characters (an emoji counts as one) and the caption is the question. A comment prompt uses the caption as the prompt. Facebook Login only. Not available on Stories. At most one add-on per post. Pass null or type none to clear it.'),
50
+ poll_attachment: z.object({
51
+ option_a: z.string().optional(),
52
+ option_b: z.string().optional(),
53
+ option_c: z.string().optional(),
54
+ option_d: z.string().optional(),
55
+ options: z.array(z.string()).max(4).optional(),
56
+ }).optional().describe('Instagram poll choices. option_a and option_b are required, option_c and option_d are optional, and option_d requires option_c. Mutually exclusive with a comment prompt. The caption is the question. Serialised JSON must be 200 characters or fewer.'),
57
+ is_comment_prompt_used: z.boolean().optional().describe('Set true to attach an Instagram comment prompt. The caption is the prompt. Mutually exclusive with a poll. Facebook Login only. Not available on Stories.'),
58
+ is_poll_duration_extended: z.boolean().optional().describe('Set true only together with a poll, to request the longer Instagram poll duration.'),
34
59
  });
35
60
 
36
61
  export const platformSettingsSchema = z.object({
@@ -124,6 +149,17 @@ export const platformSettingsSchema = z.object({
124
149
  paid_partnership: z.boolean().optional(), // X paid partnership
125
150
  is_ai_generated: z.boolean().optional(),
126
151
  audio_id: z.string().optional(),
152
+ caption_addon: z.union([
153
+ z.object({
154
+ type: z.enum(['none', 'poll', 'comment_prompt']).optional(),
155
+ options: z.array(z.string()).max(4).optional(),
156
+ extended_duration: z.boolean().optional(),
157
+ }),
158
+ z.null(),
159
+ ]).optional(),
160
+ poll_attachment: z.record(z.string(), z.unknown()).optional(),
161
+ is_comment_prompt_used: z.boolean().optional(),
162
+ is_poll_duration_extended: z.boolean().optional(),
127
163
  // tags (z.array of strings) also serve as Bluesky hidden discovery tags
128
164
  // AI-content disclosure (TikTok is_aigc, X made_with_ai, YouTube containsSyntheticMedia, Pinterest ai_disclosures)
129
165
  ai_generated: z.boolean().optional(),
@@ -314,7 +350,7 @@ export const createPostTool = {
314
350
  'Provide either account_id OR username+platform to identify the account. If scheduled_at is omitted, the post publishes immediately. If workspace_id is omitted, the server resolves one from the social account, falling back to the caller\'s default (personal) workspace - pass workspace_id explicitly if the user has more than one workspace.\n\n' +
315
351
  'MEDIA URLS: Posterly storage URLs are used as-is. Third-party HTTP(S) media URLs are copied into posterly storage before the post is saved, so API-created posts do not later fail on expired signed URLs. Short-lived signed URLs must still be live when this tool runs. You can also call `upload_media` with `url` first if you want to upload once and reuse the returned posterly URL across posts.\n\n' +
316
352
  'THREADS: Pass `thread_posts` (an array of 2+ strings) to schedule a multi-post thread on X (Twitter) or Threads (Meta). The first entry is the lead post; the rest are published as replies in the same chain. X entries are capped at 280 characters each (4000 for verified, 25000 for organization accounts); Threads entries are capped at 500 characters each. When `thread_posts` is set, `caption` is ignored.\n\n' +
317
- 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/brandPartner, LinkedIn document titles/mentions/polls/content_call_to_action_label (including BUY_NOW and SHOP_NOW), TikTok direct-post privacy/toggles/commercial disclosure, Pinterest board/title/link/product_tags, GBP event/offer/CTA/recurrence, X reply settings/polls/paid_partnership, Threads reply controls/text attachments/ghost posts/spoilers/reply approvals/GIPHY, Telegram polls/buttons/video cover/live photo, Slack markdown/blocks, Mastodon visibility/quote/poll (media+poll allowed), and Instagram feed/story/reel/carousel/native media tags/collaborators/first comments/trial Reels/is_ai_generated/audio_id. For Instagram, @username in caption is only a caption mention; `user_tags` creates native media tags and `collaborators` sends co-author invitations only when the selected Meta-linked account reports those capabilities. Call `list_platforms` with `view: "schema"` and the account ID first. `instagram_settings` remains as a backwards-compatible alias.\n\n' +
353
+ 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/brandPartner, LinkedIn document titles/mentions/polls/content_call_to_action_label (including BUY_NOW and SHOP_NOW), TikTok direct-post privacy/toggles/commercial disclosure, Pinterest board/title/link/product_tags, GBP event/offer/CTA/recurrence, X reply settings/polls/paid_partnership, Threads reply controls/text attachments/ghost posts/spoilers/reply approvals/GIPHY, Telegram polls/buttons/video cover/live photo, Slack markdown/blocks, Mastodon visibility/quote/poll (media+poll allowed), and Instagram feed/story/reel/carousel/native media tags/collaborators/first comments/trial Reels/is_ai_generated/audio_id/caption add-ons. Instagram caption add-ons (`caption_addon`, or `poll_attachment` / `is_comment_prompt_used`) need a Facebook Login account, a non-empty caption, and a feed photo, Reel, or carousel parent. Stories are rejected. A poll and a comment prompt cannot be combined. For Instagram, @username in caption is only a caption mention; `user_tags` creates native media tags and `collaborators` sends co-author invitations only when the selected Meta-linked account reports those capabilities. Call `list_platforms` with `view: "schema"` and the account ID first. `instagram_settings` remains as a backwards-compatible alias.\n\n' +
318
354
  'TIKTOK MEDIA: TikTok supports a single video or a photo slideshow of 1 to 35 images, never multiple videos. Image media auto-detects as a slideshow, so you usually do not set post_type or media_type for photos and every image is posted. Pass `platform_settings.media_type: "PHOTO"` to force a slideshow explicitly.',
319
355
  inputSchema: createPostInputSchema,
320
356
 
@@ -363,6 +399,16 @@ export const createPostTool = {
363
399
  if (instagram_settings?.first_comment) {
364
400
  lines.push('• Instagram first comment: yes');
365
401
  }
402
+ const captionAddonType = instagram_settings?.caption_addon && typeof instagram_settings.caption_addon === 'object'
403
+ ? instagram_settings.caption_addon.type || instagram_settings.caption_addon.kind
404
+ : null;
405
+ if (captionAddonType && captionAddonType !== 'none') {
406
+ lines.push(`• Instagram caption add-on: ${captionAddonType}`);
407
+ } else if (instagram_settings?.is_comment_prompt_used) {
408
+ lines.push('• Instagram caption add-on: comment_prompt');
409
+ } else if (instagram_settings?.poll_attachment) {
410
+ lines.push('• Instagram caption add-on: poll');
411
+ }
366
412
  if (platform_settings) {
367
413
  lines.push('• Platform settings: yes');
368
414
  }
@@ -6,6 +6,7 @@ import { previewThenConfirm, validateArgs, type ToolContext } from '../lib/tool-
6
6
  type DeletePostInput = {
7
7
  post_id?: number;
8
8
  group_id?: string;
9
+ delete_mode?: 'posterly' | 'platform';
9
10
  confirm_published?: boolean;
10
11
  confirm?: boolean;
11
12
  preview_id?: string;
@@ -14,14 +15,15 @@ type DeletePostInput = {
14
15
  export const deletePostTool = {
15
16
  name: 'delete_post',
16
17
  description:
17
- 'Delete posts. DESTRUCTIVE and IRREVERSIBLE: deleted posts and captions cannot be recovered. post_id: delete one post; fetch it with `get_post` first, show the user what will be deleted (caption, account, scheduled time), and pass confirm=true only after explicit confirmation ("yes delete it", "remove it"). A post that is currently publishing is never deleted. A published post is taken down only when the user also explicitly confirms the live removal and you pass confirm_published=true. Instagram and Facebook are attempted when the stored id and token allow it. Every other platform, or a live URL with no id, returns platform_delete_unsupported and the posterly row is kept. A published post with no live URL and no platform id is removed from posterly only. group_id: delete every draft, scheduled, failed, or paused post matching a caller-defined group_id, post_group_id, api_group_id, or release_id. A group delete never removes published posts. Preview then confirm: call without confirm to get a preview and preview_id, show it, then call again with confirm=true and that preview_id. Never delete several posts one by one without listing each and confirming the full list.',
18
+ 'Delete posts. DESTRUCTIVE and IRREVERSIBLE: deleted posts and captions cannot be recovered. post_id: delete one post; fetch it with `get_post` first, show the user what will be deleted (caption, account, scheduled time), and pass confirm=true only after explicit confirmation ("yes delete it", "remove it"). A post that is currently publishing is never deleted. A published post is taken down only when the user also explicitly confirms the live removal and you pass confirm_published=true. Choose delete_mode=posterly to remove only the posterly record and leave the live post up, or delete_mode=platform with confirm_published=true to take down the live post too. Live deletion supports eligible connected platforms with saved post IDs and deletion permissions; refusals keep the record. Threads requires threads_delete. YouTube requires youtube.force-ssl or equivalent, upload alone is insufficient. A published post with no live URL and no platform id is removed from posterly only. group_id: delete every draft, scheduled, failed, or paused post matching a caller-defined group_id, post_group_id, api_group_id, or release_id. A group delete never removes published posts. Preview then confirm: call without confirm to get a preview and preview_id, show it, then call again with confirm=true and that preview_id. Never delete several posts one by one without listing each and confirming the full list.',
18
19
  inputSchema: z.object({
19
20
  post_id: z.number().optional().describe('Delete this one post.'),
20
21
  group_id: z.string().min(1).max(160).optional().describe('Delete every unpublished post in this group or release instead. Never deletes published posts.'),
22
+ delete_mode: z.enum(['posterly', 'platform']).optional().describe('posterly removes only the record; platform also takes down live content and requires confirm_published=true.'),
21
23
  confirm_published: z
22
24
  .boolean()
23
25
  .optional()
24
- .describe('With post_id only. True only after the user explicitly confirms taking a live Instagram or Facebook post down. Without it, a published post is refused and kept.'),
26
+ .describe('With post_id only. True only after the user explicitly confirms taking a live post down. Required with delete_mode=platform. Use delete_mode=posterly to leave the live post up.'),
25
27
  confirm: z
26
28
  .boolean()
27
29
  .optional()
@@ -58,24 +60,27 @@ export const deletePostTool = {
58
60
  },
59
61
  });
60
62
  }
61
- return deleteOne(client, args as { post_id: number; confirm?: boolean; confirm_published?: boolean });
63
+ return deleteOne(client, args as { post_id: number; confirm?: boolean; confirm_published?: boolean; delete_mode?: 'posterly' | 'platform' });
62
64
  },
63
65
  };
64
66
 
65
67
  async function deleteOne(
66
68
  client: PosterlyClient,
67
- input: { post_id: number; confirm?: boolean; confirm_published?: boolean },
69
+ input: { post_id: number; confirm?: boolean; confirm_published?: boolean; delete_mode?: 'posterly' | 'platform' },
68
70
  ): Promise<string> {
69
71
  if (input.confirm !== true) {
70
72
  throw new Error('Refusing to delete post without confirm=true after explicit user confirmation.');
71
73
  }
72
- const result = await client.deletePost(input.post_id, { confirmPublished: input.confirm_published === true });
73
- const platformDelete = result.platform_delete ? ` Platform delete: ${result.platform_delete}.` : '';
74
+ const result = await client.deletePost(input.post_id, { confirmPublished: input.confirm_published === true, deleteMode: input.delete_mode });
75
+ const platformDelete = result.platform_delete === 'deleted' ? ' The platform confirmed removal of the live content.'
76
+ : result.platform_delete === 'not_requested' ? ' Only the posterly record was removed; no platform deletion was requested.'
77
+ : result.platform_delete === 'no_live_target' ? ' Only the posterly record was removed because no live target was saved.'
78
+ : '';
74
79
  return [
75
80
  `Post #${result.id} deleted successfully.${platformDelete}`,
76
81
  'It has been removed from the posterly queue.',
77
82
  `View queue in posterly: ${dashboardUrlForPosts()}`,
78
83
  '',
79
- 'Next step for the AI agent: tell the user the post is gone and offer to create, reschedule, or review the next post.',
84
+ 'Tell the user whether the live post was deleted or kept on the platform.',
80
85
  ].join('\n');
81
86
  }
@@ -32,6 +32,31 @@ const instagramSettingsSchema = z.object({
32
32
  reel_thumb_offset: z.number().nonnegative().optional(),
33
33
  is_ai_generated: z.boolean().optional().describe('Label the parent Instagram media container as AI-generated. For carousels, set on the parent only.'),
34
34
  audio_id: z.string().optional().describe('Licensed Instagram audio ID for Reels. Meta-linked Facebook Login accounts only.'),
35
+ caption_addon: z.union([
36
+ z.object({
37
+ type: z.enum(['none', 'poll', 'comment_prompt']).optional(),
38
+ kind: z.enum(['none', 'poll', 'comment_prompt']).optional(),
39
+ options: z.array(z.string()).max(4).optional(),
40
+ extended_duration: z.boolean().optional(),
41
+ poll_attachment: z.object({
42
+ option_a: z.string().optional(),
43
+ option_b: z.string().optional(),
44
+ option_c: z.string().optional(),
45
+ option_d: z.string().optional(),
46
+ options: z.array(z.string()).max(4).optional(),
47
+ }).optional(),
48
+ }),
49
+ z.null(),
50
+ ]).optional().describe('Optional Instagram caption add-on. type is none, poll, or comment_prompt. A poll needs 2 to 4 options of 1 to 25 characters (an emoji counts as one) and the caption is the question. A comment prompt uses the caption as the prompt. Facebook Login only. Not available on Stories. At most one add-on per post. Pass null or type none to clear it.'),
51
+ poll_attachment: z.object({
52
+ option_a: z.string().optional(),
53
+ option_b: z.string().optional(),
54
+ option_c: z.string().optional(),
55
+ option_d: z.string().optional(),
56
+ options: z.array(z.string()).max(4).optional(),
57
+ }).optional().describe('Instagram poll choices. option_a and option_b are required, option_c and option_d are optional, and option_d requires option_c. Mutually exclusive with a comment prompt. The caption is the question. Serialised JSON must be 200 characters or fewer.'),
58
+ is_comment_prompt_used: z.boolean().optional().describe('Set true to attach an Instagram comment prompt. The caption is the prompt. Mutually exclusive with a poll. Facebook Login only. Not available on Stories.'),
59
+ is_poll_duration_extended: z.boolean().optional().describe('Set true only together with a poll, to request the longer Instagram poll duration.'),
35
60
  });
36
61
 
37
62
  const platformSettingsSchema = z.object({
@@ -108,6 +133,17 @@ const platformSettingsSchema = z.object({
108
133
  paid_partnership: z.boolean().optional(),
109
134
  is_ai_generated: z.boolean().optional(),
110
135
  audio_id: z.string().optional(),
136
+ caption_addon: z.union([
137
+ z.object({
138
+ type: z.enum(['none', 'poll', 'comment_prompt']).optional(),
139
+ options: z.array(z.string()).max(4).optional(),
140
+ extended_duration: z.boolean().optional(),
141
+ }),
142
+ z.null(),
143
+ ]).optional(),
144
+ poll_attachment: z.record(z.string(), z.unknown()).optional(),
145
+ is_comment_prompt_used: z.boolean().optional(),
146
+ is_poll_duration_extended: z.boolean().optional(),
111
147
  ai_generated: z.boolean().optional(),
112
148
  }).passthrough();
113
149
 
@@ -161,6 +161,7 @@
161
161
  "cancel_subscription",
162
162
  "pause_subscription",
163
163
  "resume_subscription",
164
- "downgrade_subscription"
164
+ "downgrade_subscription",
165
+ "delete_post"
165
166
  ]
166
167
  }
@@ -781,7 +781,7 @@
781
781
  "label": "Delete posts",
782
782
  "exception": {
783
783
  "category": "publishing",
784
- "reason": "Removes scheduled content before it goes out to a social network."
784
+ "reason": "Removes a post record or live platform content after explicit confirmation."
785
785
  },
786
786
  "selector": "params",
787
787
  "defaultMode": "post",
@@ -790,7 +790,7 @@
790
790
  "label": "Delete one post",
791
791
  "destructive": true,
792
792
  "idempotent": true,
793
- "openWorld": false,
793
+ "openWorld": true,
794
794
  "confirm": "confirm",
795
795
  "params": {
796
796
  "post_id": {
@@ -800,6 +800,13 @@
800
800
  },
801
801
  "confirm_published": {
802
802
  "type": "boolean"
803
+ },
804
+ "delete_mode": {
805
+ "type": "string",
806
+ "enum": [
807
+ "posterly",
808
+ "platform"
809
+ ]
803
810
  }
804
811
  }
805
812
  },