posterly-mcp-server 0.8.3 → 0.19.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.
Files changed (119) hide show
  1. package/README.md +35 -1
  2. package/dist/generated/platform-manifest.d.ts +392 -0
  3. package/dist/generated/platform-manifest.js +695 -0
  4. package/dist/index.js +321 -1
  5. package/dist/lib/api-client.d.ts +346 -0
  6. package/dist/lib/api-client.js +173 -0
  7. package/dist/tools/audit-google-business-profile.d.ts +24 -0
  8. package/dist/tools/audit-google-business-profile.js +27 -0
  9. package/dist/tools/create-oauth-client.d.ts +40 -0
  10. package/dist/tools/create-oauth-client.js +20 -0
  11. package/dist/tools/create-post.d.ts +7 -20
  12. package/dist/tools/create-post.js +4 -3
  13. package/dist/tools/create-posts-batch.d.ts +5 -5
  14. package/dist/tools/create-signed-upload.d.ts +24 -0
  15. package/dist/tools/create-signed-upload.js +20 -0
  16. package/dist/tools/create-webhook.d.ts +36 -0
  17. package/dist/tools/create-webhook.js +20 -0
  18. package/dist/tools/delete-google-business-review-reply.d.ts +32 -0
  19. package/dist/tools/delete-google-business-review-reply.js +17 -0
  20. package/dist/tools/delete-oauth-client.d.ts +20 -0
  21. package/dist/tools/delete-oauth-client.js +13 -0
  22. package/dist/tools/delete-post-group.d.ts +20 -0
  23. package/dist/tools/delete-post-group.js +13 -0
  24. package/dist/tools/delete-webhook.d.ts +20 -0
  25. package/dist/tools/delete-webhook.js +13 -0
  26. package/dist/tools/disconnect-account.d.ts +20 -0
  27. package/dist/tools/disconnect-account.js +22 -0
  28. package/dist/tools/generate-image.d.ts +4 -4
  29. package/dist/tools/generate-video.d.ts +59 -0
  30. package/dist/tools/generate-video.js +34 -0
  31. package/dist/tools/get-connect-link.d.ts +24 -0
  32. package/dist/tools/get-connect-link.js +46 -0
  33. package/dist/tools/get-google-business-review-link.d.ts +24 -0
  34. package/dist/tools/get-google-business-review-link.js +19 -0
  35. package/dist/tools/get-platform-schema.d.ts +24 -0
  36. package/dist/tools/get-platform-schema.js +44 -0
  37. package/dist/tools/get-post-missing.d.ts +16 -0
  38. package/dist/tools/get-post-missing.js +12 -0
  39. package/dist/tools/get-video-job.d.ts +24 -0
  40. package/dist/tools/get-video-job.js +31 -0
  41. package/dist/tools/get-video-options.d.ts +8 -0
  42. package/dist/tools/get-video-options.js +26 -0
  43. package/dist/tools/get-x-posting-quota.d.ts +16 -0
  44. package/dist/tools/get-x-posting-quota.js +21 -0
  45. package/dist/tools/list-activity.d.ts +32 -0
  46. package/dist/tools/list-activity.js +35 -0
  47. package/dist/tools/list-google-business-reviews.d.ts +32 -0
  48. package/dist/tools/list-google-business-reviews.js +28 -0
  49. package/dist/tools/list-oauth-clients.d.ts +8 -0
  50. package/dist/tools/list-oauth-clients.js +15 -0
  51. package/dist/tools/list-platforms.d.ts +16 -0
  52. package/dist/tools/list-platforms.js +20 -0
  53. package/dist/tools/list-posts.d.ts +3 -3
  54. package/dist/tools/list-posts.js +3 -2
  55. package/dist/tools/list-webhooks.d.ts +16 -0
  56. package/dist/tools/list-webhooks.js +24 -0
  57. package/dist/tools/reply-google-business-review.d.ts +36 -0
  58. package/dist/tools/reply-google-business-review.js +18 -0
  59. package/dist/tools/run-video-function.d.ts +24 -0
  60. package/dist/tools/run-video-function.js +25 -0
  61. package/dist/tools/suggest-google-business-review-reply.d.ts +48 -0
  62. package/dist/tools/suggest-google-business-review-reply.js +27 -0
  63. package/dist/tools/test-webhook.d.ts +20 -0
  64. package/dist/tools/test-webhook.js +14 -0
  65. package/dist/tools/trigger-platform-helper.d.ts +28 -0
  66. package/dist/tools/trigger-platform-helper.js +22 -0
  67. package/dist/tools/update-oauth-client.d.ts +44 -0
  68. package/dist/tools/update-oauth-client.js +21 -0
  69. package/dist/tools/update-post-release-id.d.ts +28 -0
  70. package/dist/tools/update-post-release-id.js +18 -0
  71. package/dist/tools/update-post-status.d.ts +28 -0
  72. package/dist/tools/update-post-status.js +23 -0
  73. package/dist/tools/update-post.js +1 -1
  74. package/dist/tools/update-webhook.d.ts +40 -0
  75. package/dist/tools/update-webhook.js +21 -0
  76. package/dist/tools/upload-media-from-url.d.ts +24 -0
  77. package/dist/tools/upload-media-from-url.js +26 -0
  78. package/dist/tools/webhook-events.d.ts +3 -0
  79. package/dist/tools/webhook-events.js +13 -0
  80. package/package.json +1 -1
  81. package/src/generated/platform-manifest.ts +695 -0
  82. package/src/index.ts +481 -1
  83. package/src/lib/api-client.ts +461 -0
  84. package/src/tools/audit-google-business-profile.ts +38 -0
  85. package/src/tools/create-oauth-client.ts +36 -0
  86. package/src/tools/create-post.ts +5 -17
  87. package/src/tools/create-signed-upload.ts +27 -0
  88. package/src/tools/create-webhook.ts +35 -0
  89. package/src/tools/delete-google-business-review-reply.ts +30 -0
  90. package/src/tools/delete-oauth-client.ts +23 -0
  91. package/src/tools/delete-post-group.ts +17 -0
  92. package/src/tools/delete-webhook.ts +18 -0
  93. package/src/tools/disconnect-account.ts +30 -0
  94. package/src/tools/generate-video.ts +38 -0
  95. package/src/tools/get-connect-link.ts +56 -0
  96. package/src/tools/get-google-business-review-link.ts +30 -0
  97. package/src/tools/get-platform-schema.ts +52 -0
  98. package/src/tools/get-post-missing.ts +17 -0
  99. package/src/tools/get-video-job.ts +36 -0
  100. package/src/tools/get-video-options.ts +30 -0
  101. package/src/tools/get-x-posting-quota.ts +25 -0
  102. package/src/tools/list-activity.ts +51 -0
  103. package/src/tools/list-google-business-reviews.ts +43 -0
  104. package/src/tools/list-oauth-clients.ts +18 -0
  105. package/src/tools/list-platforms.ts +25 -0
  106. package/src/tools/list-posts.ts +3 -2
  107. package/src/tools/list-webhooks.ts +30 -0
  108. package/src/tools/reply-google-business-review.ts +32 -0
  109. package/src/tools/run-video-function.ts +32 -0
  110. package/src/tools/suggest-google-business-review-reply.ts +44 -0
  111. package/src/tools/test-webhook.ts +18 -0
  112. package/src/tools/trigger-platform-helper.ts +34 -0
  113. package/src/tools/update-oauth-client.ts +38 -0
  114. package/src/tools/update-post-release-id.ts +26 -0
  115. package/src/tools/update-post-status.ts +31 -0
  116. package/src/tools/update-post.ts +1 -1
  117. package/src/tools/update-webhook.ts +37 -0
  118. package/src/tools/upload-media-from-url.ts +33 -0
  119. package/src/tools/webhook-events.ts +16 -0
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ const scopeSchema = z.enum(['accounts:read', 'accounts:write', 'posts:read', 'posts:write', 'media:write', 'analytics:read']);
3
+ export const createOAuthClientTool = {
4
+ name: 'create_oauth_client',
5
+ description: 'Create a public OAuth 2.1 + PKCE developer client. WRITE: confirm app name, redirect URIs, and scopes with the user before calling.',
6
+ inputSchema: z.object({
7
+ client_name: z.string().min(1).max(120),
8
+ description: z.string().max(500).optional(),
9
+ homepage: z.string().url().optional(),
10
+ allowed_redirect_uris: z.array(z.string().url()).min(1).max(10),
11
+ default_scopes: z.array(scopeSchema).min(1),
12
+ is_active: z.boolean().optional(),
13
+ confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
14
+ }),
15
+ async execute(client, input) {
16
+ const { confirm: _confirm, ...payload } = input;
17
+ const result = await client.createOAuthClient(payload);
18
+ return `OAuth client created: ${result.client.client_name}\nclient_id: ${result.client.client_id}\nRedirect URIs: ${result.client.allowed_redirect_uris.join(', ')}`;
19
+ },
20
+ };
@@ -222,7 +222,7 @@ export declare const platformSettingsSchema: z.ZodObject<{
222
222
  export declare const createPostInputSchema: z.ZodObject<{
223
223
  account_id: z.ZodOptional<z.ZodString>;
224
224
  username: z.ZodOptional<z.ZodString>;
225
- platform: z.ZodOptional<z.ZodString>;
225
+ platform: z.ZodOptional<z.ZodEnum<["bluesky", "facebook", "gmb", "google-business", "google_business", "google_business_profile", "instagram", "instagram-standalone", "linkedin", "pinterest", "telegram", "threads", "tiktok", "twitter", "x", "youtube"]>>;
226
226
  caption: z.ZodOptional<z.ZodString>;
227
227
  scheduled_at: z.ZodOptional<z.ZodString>;
228
228
  media_url: z.ZodOptional<z.ZodString>;
@@ -451,7 +451,7 @@ export declare const createPostInputSchema: z.ZodObject<{
451
451
  workspace_id: z.ZodOptional<z.ZodString>;
452
452
  }, "strip", z.ZodTypeAny, {
453
453
  workspace_id?: string | undefined;
454
- platform?: string | undefined;
454
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
455
455
  account_id?: string | undefined;
456
456
  post_type?: string | undefined;
457
457
  username?: string | undefined;
@@ -531,7 +531,7 @@ export declare const createPostInputSchema: z.ZodObject<{
531
531
  }, z.ZodTypeAny, "passthrough"> | undefined;
532
532
  }, {
533
533
  workspace_id?: string | undefined;
534
- platform?: string | undefined;
534
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
535
535
  account_id?: string | undefined;
536
536
  post_type?: string | undefined;
537
537
  username?: string | undefined;
@@ -618,7 +618,7 @@ export declare const createPostTool: {
618
618
  inputSchema: z.ZodObject<{
619
619
  account_id: z.ZodOptional<z.ZodString>;
620
620
  username: z.ZodOptional<z.ZodString>;
621
- platform: z.ZodOptional<z.ZodString>;
621
+ platform: z.ZodOptional<z.ZodEnum<["bluesky", "facebook", "gmb", "google-business", "google_business", "google_business_profile", "instagram", "instagram-standalone", "linkedin", "pinterest", "telegram", "threads", "tiktok", "twitter", "x", "youtube"]>>;
622
622
  caption: z.ZodOptional<z.ZodString>;
623
623
  scheduled_at: z.ZodOptional<z.ZodString>;
624
624
  media_url: z.ZodOptional<z.ZodString>;
@@ -847,7 +847,7 @@ export declare const createPostTool: {
847
847
  workspace_id: z.ZodOptional<z.ZodString>;
848
848
  }, "strip", z.ZodTypeAny, {
849
849
  workspace_id?: string | undefined;
850
- platform?: string | undefined;
850
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
851
851
  account_id?: string | undefined;
852
852
  post_type?: string | undefined;
853
853
  username?: string | undefined;
@@ -927,7 +927,7 @@ export declare const createPostTool: {
927
927
  }, z.ZodTypeAny, "passthrough"> | undefined;
928
928
  }, {
929
929
  workspace_id?: string | undefined;
930
- platform?: string | undefined;
930
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
931
931
  account_id?: string | undefined;
932
932
  post_type?: string | undefined;
933
933
  username?: string | undefined;
@@ -1006,18 +1006,5 @@ export declare const createPostTool: {
1006
1006
  langs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1007
1007
  }, z.ZodTypeAny, "passthrough"> | undefined;
1008
1008
  }>;
1009
- execute(client: PosterlyClient, input: {
1010
- account_id?: string;
1011
- username?: string;
1012
- platform?: string;
1013
- caption?: string;
1014
- scheduled_at?: string;
1015
- media_url?: string;
1016
- media_urls?: string[];
1017
- post_type?: string;
1018
- thread_posts?: string[];
1019
- instagram_settings?: z.infer<typeof instagramSettingsSchema>;
1020
- platform_settings?: z.infer<typeof platformSettingsSchema>;
1021
- workspace_id?: string;
1022
- }): Promise<string>;
1009
+ execute(client: PosterlyClient, input: CreatePostInput): Promise<string>;
1023
1010
  };
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { SUPPORTED_PLATFORM_INPUTS, SUPPORTED_PLATFORM_IDS } from '../generated/platform-manifest.js';
2
3
  export const instagramSettingsSchema = z.object({
3
4
  __type: z.enum(['instagram', 'instagram-standalone']).optional(),
4
5
  post_type: z.enum(['post', 'feed', 'story', 'reel', 'carousel']).optional(),
@@ -71,9 +72,9 @@ export const createPostInputSchema = z.object({
71
72
  account_id: z.string().optional().describe('Social account ID (from list_accounts)'),
72
73
  username: z.string().optional().describe('Account username (alternative to account_id)'),
73
74
  platform: z
74
- .string()
75
+ .enum(SUPPORTED_PLATFORM_INPUTS)
75
76
  .optional()
76
- .describe('Platform name (required with username): instagram, twitter, linkedin, facebook, tiktok, threads, youtube, pinterest, google_business'),
77
+ .describe(`Platform name (required with username). Supported: ${SUPPORTED_PLATFORM_IDS.join(', ')}. Aliases such as x, gmb, and instagram-standalone are accepted.`),
77
78
  caption: z.string().optional().describe('The post caption/text content. Ignored when `thread_posts` is provided.'),
78
79
  scheduled_at: z
79
80
  .string()
@@ -150,7 +151,7 @@ export const createPostTool = {
150
151
  '4. If scheduling multiple posts in one turn, list every post first and confirm the batch as a whole, then prefer `create_posts_batch` so they are created in one API request.\n\n' +
151
152
  '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' +
152
153
  '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' +
153
- 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/playlist, LinkedIn document titles/mentions/video thumbnails, TikTok direct-post privacy/toggles/commercial disclosure, Pinterest board/link/title/video cover, GBP event/offer/CTA, X reply settings/polls, Threads reply controls/text attachments, Bluesky languages/alt text, and Instagram feed/story/reel/carousel/collaborators/first comments/trial Reels. `instagram_settings` remains as a backwards-compatible alias.',
154
+ 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/playlist, LinkedIn document titles/mentions/video thumbnails, TikTok direct-post privacy/toggles/commercial disclosure, Pinterest post_type (image/video/carousel), board (from pinterest.boards helper), title, link, and cover_image_url (video Pins), GBP event/offer/CTA, X reply settings/polls, Threads reply controls/text attachments, Bluesky languages/alt text, and Instagram feed/story/reel/carousel/collaborators/first comments/trial Reels. `instagram_settings` remains as a backwards-compatible alias.',
154
155
  inputSchema: createPostInputSchema,
155
156
  async execute(client, input) {
156
157
  const payload = buildCreatePostPayload(input);
@@ -8,7 +8,7 @@ export declare const createPostsBatchTool: {
8
8
  posts: z.ZodArray<z.ZodObject<{
9
9
  account_id: z.ZodOptional<z.ZodString>;
10
10
  username: z.ZodOptional<z.ZodString>;
11
- platform: z.ZodOptional<z.ZodString>;
11
+ platform: z.ZodOptional<z.ZodEnum<["bluesky", "facebook", "gmb", "google-business", "google_business", "google_business_profile", "instagram", "instagram-standalone", "linkedin", "pinterest", "telegram", "threads", "tiktok", "twitter", "x", "youtube"]>>;
12
12
  caption: z.ZodOptional<z.ZodString>;
13
13
  scheduled_at: z.ZodOptional<z.ZodString>;
14
14
  media_url: z.ZodOptional<z.ZodString>;
@@ -237,7 +237,7 @@ export declare const createPostsBatchTool: {
237
237
  workspace_id: z.ZodOptional<z.ZodString>;
238
238
  }, "strip", z.ZodTypeAny, {
239
239
  workspace_id?: string | undefined;
240
- platform?: string | undefined;
240
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
241
241
  account_id?: string | undefined;
242
242
  post_type?: string | undefined;
243
243
  username?: string | undefined;
@@ -317,7 +317,7 @@ export declare const createPostsBatchTool: {
317
317
  }, z.ZodTypeAny, "passthrough"> | undefined;
318
318
  }, {
319
319
  workspace_id?: string | undefined;
320
- platform?: string | undefined;
320
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
321
321
  account_id?: string | undefined;
322
322
  post_type?: string | undefined;
323
323
  username?: string | undefined;
@@ -399,7 +399,7 @@ export declare const createPostsBatchTool: {
399
399
  }, "strip", z.ZodTypeAny, {
400
400
  posts: {
401
401
  workspace_id?: string | undefined;
402
- platform?: string | undefined;
402
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
403
403
  account_id?: string | undefined;
404
404
  post_type?: string | undefined;
405
405
  username?: string | undefined;
@@ -481,7 +481,7 @@ export declare const createPostsBatchTool: {
481
481
  }, {
482
482
  posts: {
483
483
  workspace_id?: string | undefined;
484
- platform?: string | undefined;
484
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
485
485
  account_id?: string | undefined;
486
486
  post_type?: string | undefined;
487
487
  username?: string | undefined;
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const createSignedUploadTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ filename: z.ZodString;
8
+ content_type: z.ZodString;
9
+ size: z.ZodNumber;
10
+ }, "strip", z.ZodTypeAny, {
11
+ content_type: string;
12
+ filename: string;
13
+ size: number;
14
+ }, {
15
+ content_type: string;
16
+ filename: string;
17
+ size: number;
18
+ }>;
19
+ execute(client: PosterlyClient, input: {
20
+ filename: string;
21
+ content_type: string;
22
+ size: number;
23
+ }): Promise<string>;
24
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export const createSignedUploadTool = {
3
+ name: 'create_signed_upload',
4
+ description: 'Create a signed direct-upload URL for a larger image or video. Upload the binary to upload_url, then use public_url with create_post.',
5
+ inputSchema: z.object({
6
+ filename: z.string().describe('Filename with extension, e.g. launch-video.mp4'),
7
+ content_type: z.string().describe('MIME type, e.g. video/mp4'),
8
+ size: z.number().int().positive().describe('File size in bytes'),
9
+ }),
10
+ async execute(client, input) {
11
+ const signed = await client.getSignedUploadUrl(input.filename, input.content_type, input.size);
12
+ return [
13
+ 'Signed upload created.',
14
+ `• Upload URL: ${signed.upload_url}`,
15
+ `• Token: ${signed.token}`,
16
+ `• Storage path: ${signed.path}`,
17
+ `• Public URL after upload: ${signed.public_url}`,
18
+ ].join('\n');
19
+ },
20
+ };
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const createWebhookTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ url: z.ZodString;
8
+ events: z.ZodOptional<z.ZodArray<z.ZodEnum<["webhook.test", "post.created", "post.updated", "post.deleted", "post.publishing", "post.published", "post.failed", "account.disconnected", "analytics.synced"]>, "many">>;
9
+ workspace_id: z.ZodOptional<z.ZodString>;
10
+ description: z.ZodOptional<z.ZodString>;
11
+ is_active: z.ZodOptional<z.ZodBoolean>;
12
+ confirm: z.ZodLiteral<true>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ url: string;
15
+ confirm: true;
16
+ workspace_id?: string | undefined;
17
+ events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced")[] | undefined;
18
+ description?: string | undefined;
19
+ is_active?: boolean | undefined;
20
+ }, {
21
+ url: string;
22
+ confirm: true;
23
+ workspace_id?: string | undefined;
24
+ events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced")[] | undefined;
25
+ description?: string | undefined;
26
+ is_active?: boolean | undefined;
27
+ }>;
28
+ execute(client: PosterlyClient, input: {
29
+ url: string;
30
+ events?: string[];
31
+ workspace_id?: string;
32
+ description?: string;
33
+ is_active?: boolean;
34
+ confirm: true;
35
+ }): Promise<string>;
36
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { webhookEventSchema } from './webhook-events.js';
3
+ export const createWebhookTool = {
4
+ name: 'create_webhook',
5
+ description: 'Create a webhook subscription for post/account/analytics events. WRITE WITH OUTBOUND SIDE EFFECTS: show the user the target URL, workspace, events, and active state, then get explicit confirmation before calling. The response includes the signing secret once.',
6
+ inputSchema: z.object({
7
+ url: z.string().url().describe('HTTPS webhook endpoint URL. Localhost HTTP is allowed by the API for development.'),
8
+ events: z.array(webhookEventSchema).optional().describe('Events to deliver. Defaults to core post lifecycle events.'),
9
+ workspace_id: z.string().optional().describe('Optional workspace filter. Omit for all workspaces owned by the API key user.'),
10
+ description: z.string().max(240).optional(),
11
+ is_active: z.boolean().optional().describe('Defaults to true.'),
12
+ confirm: z.literal(true).describe('Must be true after the user explicitly confirms webhook creation.'),
13
+ }),
14
+ async execute(client, input) {
15
+ const { confirm: _confirm, ...payload } = input;
16
+ const result = await client.createWebhook(payload);
17
+ const secret = result.secret ? `\nSigning secret: ${result.secret}` : '';
18
+ return `Webhook created: ${result.webhook.id}\nURL: ${result.webhook.url}\nEvents: ${result.webhook.events.join(', ')}${secret}`;
19
+ },
20
+ };
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const deleteGoogleBusinessReviewReplyTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ workspace_id: z.ZodOptional<z.ZodString>;
8
+ account_id: z.ZodOptional<z.ZodNumber>;
9
+ location_id: z.ZodOptional<z.ZodString>;
10
+ review_name: z.ZodString;
11
+ confirm: z.ZodLiteral<true>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ confirm: true;
14
+ review_name: string;
15
+ workspace_id?: string | undefined;
16
+ account_id?: number | undefined;
17
+ location_id?: string | undefined;
18
+ }, {
19
+ confirm: true;
20
+ review_name: string;
21
+ workspace_id?: string | undefined;
22
+ account_id?: number | undefined;
23
+ location_id?: string | undefined;
24
+ }>;
25
+ execute(client: PosterlyClient, input: {
26
+ workspace_id?: string;
27
+ account_id?: number;
28
+ location_id?: string;
29
+ review_name: string;
30
+ confirm: true;
31
+ }): Promise<any>;
32
+ };
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export const deleteGoogleBusinessReviewReplyTool = {
3
+ name: 'delete_google_business_review_reply',
4
+ description: 'Delete the owner reply from a Google Business Profile review. DESTRUCTIVE: confirm the review and location with the user, then pass confirm=true only after explicit confirmation.',
5
+ inputSchema: z.object({
6
+ workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
7
+ account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
8
+ location_id: z.string().optional().describe('Google Business location/platform_user_id.'),
9
+ review_name: z.string().min(1).describe('Full Google review resource name.'),
10
+ confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
11
+ }),
12
+ async execute(client, input) {
13
+ const { confirm: _confirm, ...payload } = input;
14
+ const result = await client.deleteGoogleBusinessReviewReply(payload);
15
+ return result.message || 'Google Business review reply deleted successfully.';
16
+ },
17
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const deleteOAuthClientTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ client_id: z.ZodString;
8
+ confirm: z.ZodLiteral<true>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ confirm: true;
11
+ client_id: string;
12
+ }, {
13
+ confirm: true;
14
+ client_id: string;
15
+ }>;
16
+ execute(client: PosterlyClient, input: {
17
+ client_id: string;
18
+ confirm: true;
19
+ }): Promise<string>;
20
+ };
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export const deleteOAuthClientTool = {
3
+ name: 'delete_oauth_client',
4
+ description: 'Delete a self-serve OAuth developer client. DESTRUCTIVE: prevents new authorizations for that client_id; existing access tokens remain revocable as API keys.',
5
+ inputSchema: z.object({
6
+ client_id: z.string().min(1),
7
+ confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
8
+ }),
9
+ async execute(client, input) {
10
+ const result = await client.deleteOAuthClient(input.client_id);
11
+ return `OAuth client deleted: ${result.client_id}`;
12
+ },
13
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const deletePostGroupTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ group_id: z.ZodString;
8
+ confirm: z.ZodLiteral<true>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ confirm: true;
11
+ group_id: string;
12
+ }, {
13
+ confirm: true;
14
+ group_id: string;
15
+ }>;
16
+ execute(client: PosterlyClient, input: {
17
+ group_id: string;
18
+ confirm: true;
19
+ }): Promise<string>;
20
+ };
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export const deletePostGroupTool = {
3
+ name: 'delete_post_group',
4
+ description: 'Delete every draft/scheduled/failed/paused post matching a caller-defined group_id, post_group_id, api_group_id, or release_id. DESTRUCTIVE: inspect the group first, list the affected posts, and pass confirm=true only after explicit confirmation.',
5
+ inputSchema: z.object({
6
+ group_id: z.string().min(1).max(160).describe('Group/release ID to delete.'),
7
+ confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
8
+ }),
9
+ async execute(client, input) {
10
+ const result = await client.deletePostGroup(input.group_id);
11
+ return JSON.stringify(result, null, 2);
12
+ },
13
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const deleteWebhookTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ webhook_id: z.ZodString;
8
+ confirm: z.ZodLiteral<true>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ confirm: true;
11
+ webhook_id: string;
12
+ }, {
13
+ confirm: true;
14
+ webhook_id: string;
15
+ }>;
16
+ execute(client: PosterlyClient, input: {
17
+ webhook_id: string;
18
+ confirm: true;
19
+ }): Promise<string>;
20
+ };
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export const deleteWebhookTool = {
3
+ name: 'delete_webhook',
4
+ description: 'Delete a webhook subscription. DESTRUCTIVE: list the webhook first, show the user its URL/events/workspace, and get explicit confirmation before calling.',
5
+ inputSchema: z.object({
6
+ webhook_id: z.string().describe('Webhook ID from list_webhooks.'),
7
+ confirm: z.literal(true).describe('Must be true after the user explicitly confirms webhook deletion.'),
8
+ }),
9
+ async execute(client, input) {
10
+ const result = await client.deleteWebhook(input.webhook_id);
11
+ return `Webhook deleted: ${result.id}`;
12
+ },
13
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const disconnectAccountTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ account_id: z.ZodString;
8
+ confirm: z.ZodBoolean;
9
+ }, "strip", z.ZodTypeAny, {
10
+ account_id: string;
11
+ confirm: boolean;
12
+ }, {
13
+ account_id: string;
14
+ confirm: boolean;
15
+ }>;
16
+ execute(client: PosterlyClient, input: {
17
+ account_id: string;
18
+ confirm: boolean;
19
+ }): Promise<string>;
20
+ };
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ export const disconnectAccountTool = {
3
+ name: 'disconnect_account',
4
+ description: 'Disconnect a connected social account from posterly. DESTRUCTIVE and IRREVERSIBLE: removes the account connection, emits account.disconnected webhooks, and may transfer Instagram scheduled posts to a replacement account.\n\n' +
5
+ 'REQUIRED BEFORE CALLING: Call `list_accounts` first, show the user the exact platform, username, account ID, and workspace that will be disconnected, then get explicit confirmation. Pass confirm=true only after that confirmation.',
6
+ inputSchema: z.object({
7
+ account_id: z.string().describe('Connected social account ID from list_accounts.'),
8
+ confirm: z.boolean().describe('Must be true after explicit user confirmation.'),
9
+ }),
10
+ async execute(client, input) {
11
+ if (input.confirm !== true) {
12
+ throw new Error('Refusing to disconnect account without confirm=true after explicit user confirmation.');
13
+ }
14
+ const result = await client.disconnectAccount(input.account_id);
15
+ const account = result.account || {};
16
+ return [
17
+ `Disconnected ${account.platform || 'account'}${account.username ? ` @${account.username}` : ''} (ID: ${account.id || input.account_id}).`,
18
+ `Transferred posts: ${result.transferred_post_count ?? 0}.`,
19
+ `Stamped posts: ${result.stamped_post_count ?? 0}.`,
20
+ ].join('\n');
21
+ },
22
+ };
@@ -12,15 +12,15 @@ export declare const generateImageTool: {
12
12
  resolution: z.ZodOptional<z.ZodEnum<["512", "1K", "2K", "4K"]>>;
13
13
  }, "strip", z.ZodTypeAny, {
14
14
  prompt: string;
15
- aspect_ratio?: "1:1" | "9:16" | "4:5" | "3:4" | "2:3" | "1:4" | "1:8" | "21:9" | "16:9" | "4:3" | "3:2" | "4:1" | "8:1" | "5:4" | undefined;
16
- style?: "photographic" | "illustration" | "minimal" | "vibrant" | "professional" | "youtube_thumbnail" | "reel_cover" | "review_background" | undefined;
15
+ aspect_ratio?: "16:9" | "9:16" | "1:1" | "4:5" | "3:4" | "2:3" | "1:4" | "1:8" | "21:9" | "4:3" | "3:2" | "4:1" | "8:1" | "5:4" | undefined;
16
+ style?: "professional" | "photographic" | "illustration" | "minimal" | "vibrant" | "youtube_thumbnail" | "reel_cover" | "review_background" | undefined;
17
17
  variations?: number | undefined;
18
18
  model?: "flash" | "pro" | undefined;
19
19
  resolution?: "512" | "1K" | "2K" | "4K" | undefined;
20
20
  }, {
21
21
  prompt: string;
22
- aspect_ratio?: "1:1" | "9:16" | "4:5" | "3:4" | "2:3" | "1:4" | "1:8" | "21:9" | "16:9" | "4:3" | "3:2" | "4:1" | "8:1" | "5:4" | undefined;
23
- style?: "photographic" | "illustration" | "minimal" | "vibrant" | "professional" | "youtube_thumbnail" | "reel_cover" | "review_background" | undefined;
22
+ aspect_ratio?: "16:9" | "9:16" | "1:1" | "4:5" | "3:4" | "2:3" | "1:4" | "1:8" | "21:9" | "4:3" | "3:2" | "4:1" | "8:1" | "5:4" | undefined;
23
+ style?: "professional" | "photographic" | "illustration" | "minimal" | "vibrant" | "youtube_thumbnail" | "reel_cover" | "review_background" | undefined;
24
24
  variations?: number | undefined;
25
25
  model?: "flash" | "pro" | undefined;
26
26
  resolution?: "512" | "1K" | "2K" | "4K" | undefined;
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const generateVideoTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ prompt: z.ZodString;
8
+ negative_prompt: z.ZodOptional<z.ZodString>;
9
+ aspect_ratio: z.ZodOptional<z.ZodDefault<z.ZodEnum<["16:9", "9:16"]>>>;
10
+ duration_seconds: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodLiteral<4>, z.ZodLiteral<6>, z.ZodLiteral<8>]>>>;
11
+ resolution: z.ZodOptional<z.ZodDefault<z.ZodEnum<["720p", "1080p"]>>>;
12
+ model: z.ZodOptional<z.ZodDefault<z.ZodEnum<["fast", "standard"]>>>;
13
+ image_url: z.ZodOptional<z.ZodString>;
14
+ end_image_url: z.ZodOptional<z.ZodString>;
15
+ reference_images: z.ZodOptional<z.ZodArray<z.ZodObject<{
16
+ url: z.ZodString;
17
+ type: z.ZodEnum<["character", "object", "scene"]>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ type: "object" | "character" | "scene";
20
+ url: string;
21
+ }, {
22
+ type: "object" | "character" | "scene";
23
+ url: string;
24
+ }>, "many">>;
25
+ generate_audio: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
26
+ source_video_url: z.ZodOptional<z.ZodString>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ prompt: string;
29
+ aspect_ratio?: "16:9" | "9:16" | undefined;
30
+ model?: "fast" | "standard" | undefined;
31
+ resolution?: "720p" | "1080p" | undefined;
32
+ negative_prompt?: string | undefined;
33
+ duration_seconds?: 4 | 6 | 8 | undefined;
34
+ image_url?: string | undefined;
35
+ end_image_url?: string | undefined;
36
+ reference_images?: {
37
+ type: "object" | "character" | "scene";
38
+ url: string;
39
+ }[] | undefined;
40
+ generate_audio?: boolean | undefined;
41
+ source_video_url?: string | undefined;
42
+ }, {
43
+ prompt: string;
44
+ aspect_ratio?: "16:9" | "9:16" | undefined;
45
+ model?: "fast" | "standard" | undefined;
46
+ resolution?: "720p" | "1080p" | undefined;
47
+ negative_prompt?: string | undefined;
48
+ duration_seconds?: 4 | 6 | 8 | undefined;
49
+ image_url?: string | undefined;
50
+ end_image_url?: string | undefined;
51
+ reference_images?: {
52
+ type: "object" | "character" | "scene";
53
+ url: string;
54
+ }[] | undefined;
55
+ generate_audio?: boolean | undefined;
56
+ source_video_url?: string | undefined;
57
+ }>;
58
+ execute(client: PosterlyClient, input: any): Promise<string>;
59
+ };
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ export const generateVideoTool = {
3
+ name: 'generate_video',
4
+ description: 'Queue a Veo AI video generation job. COSTS VEO CREDITS: confirm prompt, model, duration, resolution, aspect ratio, audio choice, and credit cost with the user before calling. Poll get_video_job for status and final video_url.',
5
+ inputSchema: z.object({
6
+ prompt: z.string().min(5).max(1024),
7
+ negative_prompt: z.string().max(500).optional(),
8
+ aspect_ratio: z.enum(['16:9', '9:16']).default('16:9').optional(),
9
+ duration_seconds: z.union([z.literal(4), z.literal(6), z.literal(8)]).default(8).optional(),
10
+ resolution: z.enum(['720p', '1080p']).default('720p').optional(),
11
+ model: z.enum(['fast', 'standard']).default('fast').optional(),
12
+ image_url: z.string().url().optional(),
13
+ end_image_url: z.string().url().optional(),
14
+ reference_images: z.array(z.object({
15
+ url: z.string().url(),
16
+ type: z.enum(['character', 'object', 'scene']),
17
+ })).max(3).optional(),
18
+ generate_audio: z.boolean().default(true).optional(),
19
+ source_video_url: z.string().url().optional(),
20
+ }),
21
+ async execute(client, input) {
22
+ const result = await client.generateVideo(input);
23
+ return [
24
+ 'Video generation job queued',
25
+ `Job ID: ${result.job_id}`,
26
+ `Status: ${result.status}`,
27
+ `Credit cost: ${result.credit_cost} (${result.included_credit_cost || 0} included, ${result.purchased_credit_cost || 0} purchased)`,
28
+ result.message,
29
+ '',
30
+ 'Raw response:',
31
+ JSON.stringify(result, null, 2),
32
+ ].filter(Boolean).join('\n');
33
+ },
34
+ };
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const getConnectLinkTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ platform: z.ZodOptional<z.ZodEnum<["bluesky", "devto", "discord", "facebook", "facebook_instagram", "facebook_pages", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "instagram_direct", "linkedin", "linkedin-company", "linkedin-page", "linkedin_company", "linkedin_page", "linkedin_personal", "mastodon", "medium", "meta", "meta_business", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "x_twitter", "youtube"]>>;
8
+ workspace_id: z.ZodOptional<z.ZodString>;
9
+ include_planned: z.ZodOptional<z.ZodBoolean>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ workspace_id?: string | undefined;
12
+ include_planned?: boolean | undefined;
13
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "reddit" | "wordpress" | "mastodon" | "medium" | "devto" | "hashnode" | "discord" | "slack" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "x" | "meta" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "instagram_direct" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter" | undefined;
14
+ }, {
15
+ workspace_id?: string | undefined;
16
+ include_planned?: boolean | undefined;
17
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "reddit" | "wordpress" | "mastodon" | "medium" | "devto" | "hashnode" | "discord" | "slack" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "x" | "meta" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "instagram_direct" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter" | undefined;
18
+ }>;
19
+ execute(client: PosterlyClient, input: {
20
+ platform?: string;
21
+ workspace_id?: string;
22
+ include_planned?: boolean;
23
+ }): Promise<string>;
24
+ };