posterly-mcp-server 0.8.2 → 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 (121) hide show
  1. package/README.md +38 -3
  2. package/dist/generated/platform-manifest.d.ts +392 -0
  3. package/dist/generated/platform-manifest.js +695 -0
  4. package/dist/index.js +331 -1
  5. package/dist/lib/api-client.d.ts +391 -24
  6. package/dist/lib/api-client.js +176 -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 +399 -20
  12. package/dist/tools/create-post.js +81 -78
  13. package/dist/tools/create-posts-batch.d.ts +567 -0
  14. package/dist/tools/create-posts-batch.js +38 -0
  15. package/dist/tools/create-signed-upload.d.ts +24 -0
  16. package/dist/tools/create-signed-upload.js +20 -0
  17. package/dist/tools/create-webhook.d.ts +36 -0
  18. package/dist/tools/create-webhook.js +20 -0
  19. package/dist/tools/delete-google-business-review-reply.d.ts +32 -0
  20. package/dist/tools/delete-google-business-review-reply.js +17 -0
  21. package/dist/tools/delete-oauth-client.d.ts +20 -0
  22. package/dist/tools/delete-oauth-client.js +13 -0
  23. package/dist/tools/delete-post-group.d.ts +20 -0
  24. package/dist/tools/delete-post-group.js +13 -0
  25. package/dist/tools/delete-webhook.d.ts +20 -0
  26. package/dist/tools/delete-webhook.js +13 -0
  27. package/dist/tools/disconnect-account.d.ts +20 -0
  28. package/dist/tools/disconnect-account.js +22 -0
  29. package/dist/tools/generate-image.d.ts +4 -4
  30. package/dist/tools/generate-video.d.ts +59 -0
  31. package/dist/tools/generate-video.js +34 -0
  32. package/dist/tools/get-connect-link.d.ts +24 -0
  33. package/dist/tools/get-connect-link.js +46 -0
  34. package/dist/tools/get-google-business-review-link.d.ts +24 -0
  35. package/dist/tools/get-google-business-review-link.js +19 -0
  36. package/dist/tools/get-platform-schema.d.ts +24 -0
  37. package/dist/tools/get-platform-schema.js +44 -0
  38. package/dist/tools/get-post-missing.d.ts +16 -0
  39. package/dist/tools/get-post-missing.js +12 -0
  40. package/dist/tools/get-video-job.d.ts +24 -0
  41. package/dist/tools/get-video-job.js +31 -0
  42. package/dist/tools/get-video-options.d.ts +8 -0
  43. package/dist/tools/get-video-options.js +26 -0
  44. package/dist/tools/get-x-posting-quota.d.ts +16 -0
  45. package/dist/tools/get-x-posting-quota.js +21 -0
  46. package/dist/tools/list-activity.d.ts +32 -0
  47. package/dist/tools/list-activity.js +35 -0
  48. package/dist/tools/list-google-business-reviews.d.ts +32 -0
  49. package/dist/tools/list-google-business-reviews.js +28 -0
  50. package/dist/tools/list-oauth-clients.d.ts +8 -0
  51. package/dist/tools/list-oauth-clients.js +15 -0
  52. package/dist/tools/list-platforms.d.ts +16 -0
  53. package/dist/tools/list-platforms.js +20 -0
  54. package/dist/tools/list-posts.d.ts +3 -3
  55. package/dist/tools/list-posts.js +3 -2
  56. package/dist/tools/list-webhooks.d.ts +16 -0
  57. package/dist/tools/list-webhooks.js +24 -0
  58. package/dist/tools/reply-google-business-review.d.ts +36 -0
  59. package/dist/tools/reply-google-business-review.js +18 -0
  60. package/dist/tools/run-video-function.d.ts +24 -0
  61. package/dist/tools/run-video-function.js +25 -0
  62. package/dist/tools/suggest-google-business-review-reply.d.ts +48 -0
  63. package/dist/tools/suggest-google-business-review-reply.js +27 -0
  64. package/dist/tools/test-webhook.d.ts +20 -0
  65. package/dist/tools/test-webhook.js +14 -0
  66. package/dist/tools/trigger-platform-helper.d.ts +28 -0
  67. package/dist/tools/trigger-platform-helper.js +22 -0
  68. package/dist/tools/update-oauth-client.d.ts +44 -0
  69. package/dist/tools/update-oauth-client.js +21 -0
  70. package/dist/tools/update-post-release-id.d.ts +28 -0
  71. package/dist/tools/update-post-release-id.js +18 -0
  72. package/dist/tools/update-post-status.d.ts +28 -0
  73. package/dist/tools/update-post-status.js +23 -0
  74. package/dist/tools/update-post.js +1 -1
  75. package/dist/tools/update-webhook.d.ts +40 -0
  76. package/dist/tools/update-webhook.js +21 -0
  77. package/dist/tools/upload-media-from-url.d.ts +24 -0
  78. package/dist/tools/upload-media-from-url.js +26 -0
  79. package/dist/tools/webhook-events.d.ts +3 -0
  80. package/dist/tools/webhook-events.js +13 -0
  81. package/package.json +1 -1
  82. package/src/generated/platform-manifest.ts +695 -0
  83. package/src/index.ts +496 -1
  84. package/src/lib/api-client.ts +497 -19
  85. package/src/tools/audit-google-business-profile.ts +38 -0
  86. package/src/tools/create-oauth-client.ts +36 -0
  87. package/src/tools/create-post.ts +91 -94
  88. package/src/tools/create-posts-batch.ts +48 -0
  89. package/src/tools/create-signed-upload.ts +27 -0
  90. package/src/tools/create-webhook.ts +35 -0
  91. package/src/tools/delete-google-business-review-reply.ts +30 -0
  92. package/src/tools/delete-oauth-client.ts +23 -0
  93. package/src/tools/delete-post-group.ts +17 -0
  94. package/src/tools/delete-webhook.ts +18 -0
  95. package/src/tools/disconnect-account.ts +30 -0
  96. package/src/tools/generate-video.ts +38 -0
  97. package/src/tools/get-connect-link.ts +56 -0
  98. package/src/tools/get-google-business-review-link.ts +30 -0
  99. package/src/tools/get-platform-schema.ts +52 -0
  100. package/src/tools/get-post-missing.ts +17 -0
  101. package/src/tools/get-video-job.ts +36 -0
  102. package/src/tools/get-video-options.ts +30 -0
  103. package/src/tools/get-x-posting-quota.ts +25 -0
  104. package/src/tools/list-activity.ts +51 -0
  105. package/src/tools/list-google-business-reviews.ts +43 -0
  106. package/src/tools/list-oauth-clients.ts +18 -0
  107. package/src/tools/list-platforms.ts +25 -0
  108. package/src/tools/list-posts.ts +3 -2
  109. package/src/tools/list-webhooks.ts +30 -0
  110. package/src/tools/reply-google-business-review.ts +32 -0
  111. package/src/tools/run-video-function.ts +32 -0
  112. package/src/tools/suggest-google-business-review-reply.ts +44 -0
  113. package/src/tools/test-webhook.ts +18 -0
  114. package/src/tools/trigger-platform-helper.ts +34 -0
  115. package/src/tools/update-oauth-client.ts +38 -0
  116. package/src/tools/update-post-release-id.ts +26 -0
  117. package/src/tools/update-post-status.ts +31 -0
  118. package/src/tools/update-post.ts +1 -1
  119. package/src/tools/update-webhook.ts +37 -0
  120. package/src/tools/upload-media-from-url.ts +33 -0
  121. package/src/tools/webhook-events.ts +16 -0
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ export const getVideoJobTool = {
3
+ name: 'get_video_job',
4
+ description: 'Get one Veo video generation job by ID, or list recent video jobs when job_id is omitted. Use after generate_video to poll for completed video_url.',
5
+ inputSchema: z.object({
6
+ job_id: z.string().optional(),
7
+ status: z.enum(['pending', 'processing', 'completed', 'failed', 'dismissed']).optional(),
8
+ limit: z.number().int().min(1).max(50).default(10).optional(),
9
+ }),
10
+ async execute(client, input) {
11
+ const result = await client.getVideoJob(input);
12
+ if (result.job)
13
+ return formatJob(result.job, true);
14
+ const jobs = result.jobs || [];
15
+ return [
16
+ `Video jobs (${jobs.length})`,
17
+ jobs.map((job) => formatJob(job, false)).join('\n\n'),
18
+ ].filter(Boolean).join('\n');
19
+ },
20
+ };
21
+ function formatJob(job, includeRaw) {
22
+ const lines = [
23
+ `${job.id} — ${job.status}`,
24
+ `Prompt: ${job.prompt}`,
25
+ `Model: ${job.model}; duration: ${job.duration_seconds}s; resolution: ${job.resolution || 'n/a'}; cost: ${job.credit_cost}`,
26
+ job.video_url ? `Video URL: ${job.video_url}` : null,
27
+ job.error_message ? `Error: ${job.error_message}` : null,
28
+ includeRaw ? `\nRaw job:\n${JSON.stringify(job, null, 2)}` : null,
29
+ ];
30
+ return lines.filter(Boolean).join('\n');
31
+ }
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const getVideoOptionsTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
7
+ execute(client: PosterlyClient): Promise<string>;
8
+ };
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export const getVideoOptionsTool = {
3
+ name: 'get_video_options',
4
+ description: 'List read-only Veo video generation options, input modes, durations, resolutions, aspect ratios, and credit-cost estimates. This does not generate video or spend credits.',
5
+ inputSchema: z.object({}),
6
+ async execute(client) {
7
+ const options = await client.getVideoOptions();
8
+ const models = Array.isArray(options.models) ? options.models : [];
9
+ const inputModes = Array.isArray(options.input_modes) ? options.input_modes : [];
10
+ const lines = [
11
+ 'Video generation options',
12
+ `Provider: ${options.provider || 'unknown'}`,
13
+ `Public generation status: ${options.public_generation_status || 'unknown'}`,
14
+ '',
15
+ `Models: ${models.map((model) => model.id).filter(Boolean).join(', ') || 'none'}`,
16
+ `Durations: ${(options.durations_seconds || []).join(', ')} seconds`,
17
+ `Resolutions: ${(options.resolutions || []).join(', ')}`,
18
+ `Aspect ratios: ${(options.aspect_ratios || []).join(', ')}`,
19
+ `Input modes: ${inputModes.map((mode) => mode.id).filter(Boolean).join(', ') || 'none'}`,
20
+ '',
21
+ 'Raw options:',
22
+ JSON.stringify(options, null, 2),
23
+ ];
24
+ return lines.join('\n');
25
+ },
26
+ };
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const getXPostingQuotaTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ workspace_id: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ workspace_id?: string | undefined;
10
+ }, {
11
+ workspace_id?: string | undefined;
12
+ }>;
13
+ execute(client: PosterlyClient, input: {
14
+ workspace_id?: string;
15
+ }): Promise<string>;
16
+ };
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export const getXPostingQuotaTool = {
3
+ name: 'get_x_posting_quota',
4
+ description: 'Get managed X posting quota for a workspace, including total monthly allowance, used posts, remaining posts, and URL-blocking status.',
5
+ inputSchema: z.object({
6
+ workspace_id: z.string().optional().describe('Workspace ID from whoami. Defaults to the caller personal workspace context.'),
7
+ }),
8
+ async execute(client, input) {
9
+ const quota = await client.getXPostingQuota(input);
10
+ return [
11
+ 'X posting quota',
12
+ `• Workspace: ${quota.workspace_id || 'default'}`,
13
+ `• Tier: ${quota.tier || 'unknown'}`,
14
+ `• Total posts: ${quota.total_posts}`,
15
+ `• Used posts: ${quota.used_posts}`,
16
+ `• Remaining posts: ${quota.remaining_posts}`,
17
+ `• URL posting blocked: ${quota.urls_blocked ? 'yes' : 'no'}`,
18
+ `• Period: ${quota.current_period_start} -> ${quota.current_period_end}`,
19
+ ].join('\n');
20
+ },
21
+ };
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const listActivityTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ workspace_id: z.ZodOptional<z.ZodString>;
8
+ post_id: z.ZodOptional<z.ZodNumber>;
9
+ since: z.ZodOptional<z.ZodString>;
10
+ type: z.ZodOptional<z.ZodEnum<["all", "activity", "publish"]>>;
11
+ limit: z.ZodOptional<z.ZodNumber>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ workspace_id?: string | undefined;
14
+ limit?: number | undefined;
15
+ post_id?: number | undefined;
16
+ since?: string | undefined;
17
+ type?: "activity" | "publish" | "all" | undefined;
18
+ }, {
19
+ workspace_id?: string | undefined;
20
+ limit?: number | undefined;
21
+ post_id?: number | undefined;
22
+ since?: string | undefined;
23
+ type?: "activity" | "publish" | "all" | undefined;
24
+ }>;
25
+ execute(client: PosterlyClient, input: {
26
+ workspace_id?: string;
27
+ post_id?: number;
28
+ since?: string;
29
+ type?: "all" | "activity" | "publish";
30
+ limit?: number;
31
+ }): Promise<string>;
32
+ };
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ export const listActivityTool = {
3
+ name: 'list_activity',
4
+ description: 'List recent activity and publish events for posts, including status changes, publish attempts, failures, and retries. Use this as the agent notifications feed.',
5
+ inputSchema: z.object({
6
+ workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
7
+ post_id: z.number().int().positive().optional().describe('Filter to one post ID.'),
8
+ since: z.string().optional().describe('ISO datetime. Return events created at or after this time.'),
9
+ type: z.enum(['all', 'activity', 'publish']).optional().describe('Event source filter. Defaults to all.'),
10
+ limit: z.number().int().min(1).max(100).optional().describe('Number of items to return. Default 50, max 100.'),
11
+ }),
12
+ async execute(client, input) {
13
+ const result = await client.listActivity(input);
14
+ if (result.items.length === 0) {
15
+ return 'No activity found matching your filters.';
16
+ }
17
+ const lines = [
18
+ `Activity (${result.items.length} of ${result.total}):`,
19
+ ];
20
+ for (const item of result.items) {
21
+ const when = item.created_at ? new Date(item.created_at).toLocaleString() : 'unknown time';
22
+ if (item.type === 'publish') {
23
+ const outcome = item.outcome || 'publish';
24
+ const platform = item.platform ? ` on ${item.platform}` : '';
25
+ const detail = item.error_message ? ` - ${item.error_message}` : '';
26
+ lines.push(`- [${when}] post #${item.post_id || '?'} ${outcome}${platform}${detail}`);
27
+ }
28
+ else {
29
+ const label = item.description || item.action || 'activity';
30
+ lines.push(`- [${when}] post #${item.post_id || '?'} ${label}`);
31
+ }
32
+ }
33
+ return lines.join('\n');
34
+ },
35
+ };
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const listGoogleBusinessReviewsTool: {
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
+ rating: z.ZodOptional<z.ZodNumber>;
11
+ unanswered: z.ZodOptional<z.ZodBoolean>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ workspace_id?: string | undefined;
14
+ account_id?: number | undefined;
15
+ location_id?: string | undefined;
16
+ rating?: number | undefined;
17
+ unanswered?: boolean | undefined;
18
+ }, {
19
+ workspace_id?: string | undefined;
20
+ account_id?: number | undefined;
21
+ location_id?: string | undefined;
22
+ rating?: number | undefined;
23
+ unanswered?: boolean | undefined;
24
+ }>;
25
+ execute(client: PosterlyClient, input: {
26
+ workspace_id?: string;
27
+ account_id?: number;
28
+ location_id?: string;
29
+ rating?: number;
30
+ unanswered?: boolean;
31
+ }): Promise<string>;
32
+ };
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ export const listGoogleBusinessReviewsTool = {
3
+ name: 'list_google_business_reviews',
4
+ description: 'List Google Business Profile reviews for one location/account or every accessible GBP location. Supports rating and unanswered-only filters.',
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
+ rating: z.number().int().min(1).max(5).optional().describe('Filter to a 1-5 star rating.'),
10
+ unanswered: z.boolean().optional().describe('Only return reviews without owner replies.'),
11
+ }),
12
+ async execute(client, input) {
13
+ const result = await client.listGoogleBusinessReviews(input);
14
+ if (result.reviews.length === 0) {
15
+ return 'No Google Business reviews found matching your filters.';
16
+ }
17
+ const lines = [`Google Business reviews (${result.reviews.length} of ${result.total}):`];
18
+ for (const review of result.reviews.slice(0, 25)) {
19
+ const name = review.reviewer?.displayName || 'Anonymous';
20
+ const rating = review.starRating ? `${review.starRating} stars` : 'unrated';
21
+ const location = review.businessName || review.locationName || review.locationId || 'location';
22
+ const text = review.comment ? ` - ${review.comment.replace(/\s+/g, ' ').slice(0, 180)}` : '';
23
+ const replied = review.reviewReply ? ' replied' : ' unanswered';
24
+ lines.push(`- ${name} (${rating}, ${location},${replied})${text}`);
25
+ }
26
+ return lines.join('\n');
27
+ },
28
+ };
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const listOAuthClientsTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
7
+ execute(client: PosterlyClient): Promise<string>;
8
+ };
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export const listOAuthClientsTool = {
3
+ name: 'list_oauth_clients',
4
+ description: 'List self-serve OAuth developer clients owned by the user. These are public PKCE clients for third-party app integrations.',
5
+ inputSchema: z.object({}),
6
+ async execute(client) {
7
+ const result = await client.listOAuthClients();
8
+ if (result.clients.length === 0)
9
+ return 'No OAuth developer clients found.';
10
+ return [
11
+ `OAuth developer clients (${result.clients.length}):`,
12
+ ...result.clients.map((item) => `- ${item.client_name} (${item.client_id}) scopes=${item.default_scopes.join(', ')} active=${item.is_active}`),
13
+ ].join('\n');
14
+ },
15
+ };
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const listPlatformsTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ include_planned: z.ZodOptional<z.ZodBoolean>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ include_planned?: boolean | undefined;
10
+ }, {
11
+ include_planned?: boolean | undefined;
12
+ }>;
13
+ execute(client: PosterlyClient, input: {
14
+ include_planned?: boolean;
15
+ }): Promise<string>;
16
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { PLANNED_PLATFORM_IDS } from '../generated/platform-manifest.js';
3
+ export const listPlatformsTool = {
4
+ name: 'list_platforms',
5
+ description: 'List posterly platform integrations, posting capabilities, content/media limits, settings schemas, helper tools, and analytics support. Use include_planned to show future integration possibilities from the Postiz parity audit.',
6
+ inputSchema: z.object({
7
+ include_planned: z
8
+ .boolean()
9
+ .optional()
10
+ .describe(`Include planned integrations such as ${PLANNED_PLATFORM_IDS.join(', ')}.`),
11
+ }),
12
+ async execute(client, input) {
13
+ const result = await client.listPlatforms(input);
14
+ const lines = result.platforms.map((platform) => {
15
+ const helperCount = platform.helper_tools?.length || 0;
16
+ return `• ${platform.label} (${platform.id}) — ${platform.status}; post types: ${platform.post_types.join(', ') || 'n/a'}; helpers: ${helperCount}; analytics: ${platform.analytics_supported ? 'yes' : 'no'}`;
17
+ });
18
+ return `Posterly platforms (${result.platforms.length}):\n${lines.join('\n')}`;
19
+ },
20
+ };
@@ -5,20 +5,20 @@ export declare const listPostsTool: {
5
5
  description: string;
6
6
  inputSchema: z.ZodObject<{
7
7
  status: z.ZodOptional<z.ZodString>;
8
- platform: z.ZodOptional<z.ZodString>;
8
+ 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"]>>;
9
9
  account_id: z.ZodOptional<z.ZodString>;
10
10
  limit: z.ZodOptional<z.ZodNumber>;
11
11
  workspace_id: z.ZodOptional<z.ZodString>;
12
12
  }, "strip", z.ZodTypeAny, {
13
13
  workspace_id?: string | undefined;
14
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
14
15
  status?: string | undefined;
15
- platform?: string | undefined;
16
16
  account_id?: string | undefined;
17
17
  limit?: number | undefined;
18
18
  }, {
19
19
  workspace_id?: string | undefined;
20
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
20
21
  status?: string | undefined;
21
- platform?: string | undefined;
22
22
  account_id?: string | undefined;
23
23
  limit?: number | undefined;
24
24
  }>;
@@ -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 listPostsTool = {
3
4
  name: 'list_posts',
4
5
  description: 'List upcoming or recent posts. Filter by status (scheduled, published, failed, draft), platform, account_id, or workspace_id. If workspace_id is omitted, posts across every workspace the caller is a member of are returned.',
@@ -8,9 +9,9 @@ export const listPostsTool = {
8
9
  .optional()
9
10
  .describe('Filter by status: draft, scheduled, published, failed'),
10
11
  platform: z
11
- .string()
12
+ .enum(SUPPORTED_PLATFORM_INPUTS)
12
13
  .optional()
13
- .describe('Filter by platform: instagram, twitter, linkedin, etc.'),
14
+ .describe(`Filter by platform: ${SUPPORTED_PLATFORM_IDS.join(', ')}.`),
14
15
  account_id: z
15
16
  .string()
16
17
  .optional()
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const listWebhooksTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ workspace_id: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ workspace_id?: string | undefined;
10
+ }, {
11
+ workspace_id?: string | undefined;
12
+ }>;
13
+ execute(client: PosterlyClient, input: {
14
+ workspace_id?: string;
15
+ }): Promise<string>;
16
+ };
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export const listWebhooksTool = {
3
+ name: 'list_webhooks',
4
+ description: 'List API webhook subscriptions, their event filters, active state, and most recent delivery status.',
5
+ inputSchema: z.object({
6
+ workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
7
+ }),
8
+ async execute(client, input) {
9
+ const { webhooks } = await client.listWebhooks(input);
10
+ if (webhooks.length === 0) {
11
+ return 'No webhooks found.';
12
+ }
13
+ const lines = [`Webhooks (${webhooks.length}):`];
14
+ for (const webhook of webhooks) {
15
+ const active = webhook.is_active ? 'active' : 'inactive';
16
+ const events = webhook.events?.length ? webhook.events.join(', ') : 'default events';
17
+ const last = webhook.last_delivery_at
18
+ ? ` last ${webhook.last_delivery_status || 'n/a'} at ${new Date(webhook.last_delivery_at).toLocaleString()}`
19
+ : '';
20
+ lines.push(`- ${webhook.id} [${active}] ${webhook.url} (${events})${last}`);
21
+ }
22
+ return lines.join('\n');
23
+ },
24
+ };
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const replyGoogleBusinessReviewTool: {
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
+ comment: z.ZodString;
12
+ confirm: z.ZodLiteral<true>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ confirm: true;
15
+ review_name: string;
16
+ comment: string;
17
+ workspace_id?: string | undefined;
18
+ account_id?: number | undefined;
19
+ location_id?: string | undefined;
20
+ }, {
21
+ confirm: true;
22
+ review_name: string;
23
+ comment: string;
24
+ workspace_id?: string | undefined;
25
+ account_id?: number | undefined;
26
+ location_id?: string | undefined;
27
+ }>;
28
+ execute(client: PosterlyClient, input: {
29
+ workspace_id?: string;
30
+ account_id?: number;
31
+ location_id?: string;
32
+ review_name: string;
33
+ comment: string;
34
+ confirm: true;
35
+ }): Promise<any>;
36
+ };
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export const replyGoogleBusinessReviewTool = {
3
+ name: 'reply_google_business_review',
4
+ description: 'Post or update the owner reply on a Google Business Profile review. WRITE: show the review, location, and exact reply text to 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
+ comment: z.string().min(1).max(4096).describe('Exact owner reply text to post.'),
11
+ confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
12
+ }),
13
+ async execute(client, input) {
14
+ const { confirm: _confirm, ...payload } = input;
15
+ const result = await client.replyGoogleBusinessReview(payload);
16
+ return result.message || 'Google Business review reply posted successfully.';
17
+ },
18
+ };
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const runVideoFunctionTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ identifier: z.ZodEnum<["google_veo", "veo3"]>;
8
+ functionName: z.ZodEnum<["list_input_modes", "estimate_cost", "validate_request"]>;
9
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ identifier: "google_veo" | "veo3";
12
+ functionName: "list_input_modes" | "estimate_cost" | "validate_request";
13
+ params?: Record<string, unknown> | undefined;
14
+ }, {
15
+ identifier: "google_veo" | "veo3";
16
+ functionName: "list_input_modes" | "estimate_cost" | "validate_request";
17
+ params?: Record<string, unknown> | undefined;
18
+ }>;
19
+ execute(client: PosterlyClient, input: {
20
+ identifier: string;
21
+ functionName: string;
22
+ params?: Record<string, unknown>;
23
+ }): Promise<string>;
24
+ };
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export const runVideoFunctionTool = {
3
+ name: 'run_video_function',
4
+ description: 'Run a read-only Veo helper function before generation: list_input_modes, estimate_cost, or validate_request. This does not generate video or spend credits.',
5
+ inputSchema: z.object({
6
+ identifier: z
7
+ .enum(['google_veo', 'veo3'])
8
+ .describe('Video generator identifier from get_video_options.'),
9
+ functionName: z
10
+ .enum(['list_input_modes', 'estimate_cost', 'validate_request'])
11
+ .describe('Helper function name from get_video_options.tools.'),
12
+ params: z
13
+ .record(z.unknown())
14
+ .optional()
15
+ .describe('Function parameters. estimate_cost accepts model, duration_seconds, resolution, and output. validate_request accepts a generate_video-style payload.'),
16
+ }),
17
+ async execute(client, input) {
18
+ const result = await client.runVideoFunction(input);
19
+ return [
20
+ `Video function ${input.functionName} completed`,
21
+ '',
22
+ JSON.stringify(result, null, 2),
23
+ ].join('\n');
24
+ },
25
+ };
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const suggestGoogleBusinessReviewReplyTool: {
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_text: z.ZodOptional<z.ZodString>;
11
+ star_rating: z.ZodNumber;
12
+ reviewer_name: z.ZodOptional<z.ZodString>;
13
+ business_name: z.ZodOptional<z.ZodString>;
14
+ tone: z.ZodOptional<z.ZodEnum<["professional", "friendly", "apologetic"]>>;
15
+ count: z.ZodOptional<z.ZodNumber>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ star_rating: number;
18
+ workspace_id?: string | undefined;
19
+ account_id?: number | undefined;
20
+ count?: number | undefined;
21
+ location_id?: string | undefined;
22
+ review_text?: string | undefined;
23
+ reviewer_name?: string | undefined;
24
+ business_name?: string | undefined;
25
+ tone?: "professional" | "friendly" | "apologetic" | undefined;
26
+ }, {
27
+ star_rating: number;
28
+ workspace_id?: string | undefined;
29
+ account_id?: number | undefined;
30
+ count?: number | undefined;
31
+ location_id?: string | undefined;
32
+ review_text?: string | undefined;
33
+ reviewer_name?: string | undefined;
34
+ business_name?: string | undefined;
35
+ tone?: "professional" | "friendly" | "apologetic" | undefined;
36
+ }>;
37
+ execute(client: PosterlyClient, input: {
38
+ workspace_id?: string;
39
+ account_id?: number;
40
+ location_id?: string;
41
+ review_text?: string;
42
+ star_rating: number;
43
+ reviewer_name?: string;
44
+ business_name?: string;
45
+ tone?: "professional" | "friendly" | "apologetic";
46
+ count?: number;
47
+ }): Promise<string>;
48
+ };
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export const suggestGoogleBusinessReviewReplyTool = {
3
+ name: 'suggest_google_business_review_reply',
4
+ description: 'Generate short, brand-aware AI reply suggestions for a Google review. Uses the AI Caption Assist allowance; does not post the reply.',
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('Optional Google Business account ID for brand voice context.'),
8
+ location_id: z.string().optional().describe('Google Business location/platform_user_id.'),
9
+ review_text: z.string().optional().describe('Review text. Leave empty for rating-only reviews.'),
10
+ star_rating: z.number().min(1).max(5).describe('Review rating from 1 to 5.'),
11
+ reviewer_name: z.string().optional(),
12
+ business_name: z.string().optional(),
13
+ tone: z.enum(['professional', 'friendly', 'apologetic']).optional(),
14
+ count: z.number().int().min(1).max(5).optional(),
15
+ }),
16
+ async execute(client, input) {
17
+ const result = await client.suggestGoogleBusinessReviewReply(input);
18
+ const suggestions = Array.isArray(result.suggestions) ? result.suggestions : [];
19
+ if (suggestions.length === 0) {
20
+ return 'No reply suggestions were generated.';
21
+ }
22
+ return [
23
+ `Suggested replies (${result.tone || 'professional'}, ${result.rating || input.star_rating} stars):`,
24
+ ...suggestions.map((text, index) => `${index + 1}. ${text}`),
25
+ ].join('\n');
26
+ },
27
+ };
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const testWebhookTool: {
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,14 @@
1
+ import { z } from 'zod';
2
+ export const testWebhookTool = {
3
+ name: 'test_webhook',
4
+ description: 'Send a signed webhook.test delivery to a webhook URL. OUTBOUND SIDE EFFECT: get explicit confirmation before sending a test request.',
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 the test delivery.'),
8
+ }),
9
+ async execute(client, input) {
10
+ const result = await client.testWebhook(input.webhook_id);
11
+ const delivery = result.delivery || {};
12
+ return `Webhook test sent.\nDelivery: ${JSON.stringify(delivery, null, 2)}`;
13
+ },
14
+ };
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const triggerPlatformHelperTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ helper: z.ZodEnum<["linkedin.recent_mentions", "pinterest.boards", "tiktok.creator_info", "x.quota", "youtube.playlists"]>;
8
+ account_id: z.ZodOptional<z.ZodString>;
9
+ 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"]>>;
10
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ helper: "linkedin.recent_mentions" | "pinterest.boards" | "tiktok.creator_info" | "x.quota" | "youtube.playlists";
13
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
14
+ account_id?: string | undefined;
15
+ params?: Record<string, unknown> | undefined;
16
+ }, {
17
+ helper: "linkedin.recent_mentions" | "pinterest.boards" | "tiktok.creator_info" | "x.quota" | "youtube.playlists";
18
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "linkedin" | "youtube" | "pinterest" | "threads" | "google_business" | "telegram" | "bluesky" | "gmb" | "google-business" | "google_business_profile" | "x" | undefined;
19
+ account_id?: string | undefined;
20
+ params?: Record<string, unknown> | undefined;
21
+ }>;
22
+ execute(client: PosterlyClient, input: {
23
+ helper: string;
24
+ account_id?: string;
25
+ platform?: string;
26
+ params?: Record<string, unknown>;
27
+ }): Promise<string>;
28
+ };