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.
- package/README.md +35 -1
- package/dist/generated/platform-manifest.d.ts +392 -0
- package/dist/generated/platform-manifest.js +695 -0
- package/dist/index.js +321 -1
- package/dist/lib/api-client.d.ts +346 -0
- package/dist/lib/api-client.js +173 -0
- package/dist/tools/audit-google-business-profile.d.ts +24 -0
- package/dist/tools/audit-google-business-profile.js +27 -0
- package/dist/tools/create-oauth-client.d.ts +40 -0
- package/dist/tools/create-oauth-client.js +20 -0
- package/dist/tools/create-post.d.ts +7 -20
- package/dist/tools/create-post.js +4 -3
- package/dist/tools/create-posts-batch.d.ts +5 -5
- package/dist/tools/create-signed-upload.d.ts +24 -0
- package/dist/tools/create-signed-upload.js +20 -0
- package/dist/tools/create-webhook.d.ts +36 -0
- package/dist/tools/create-webhook.js +20 -0
- package/dist/tools/delete-google-business-review-reply.d.ts +32 -0
- package/dist/tools/delete-google-business-review-reply.js +17 -0
- package/dist/tools/delete-oauth-client.d.ts +20 -0
- package/dist/tools/delete-oauth-client.js +13 -0
- package/dist/tools/delete-post-group.d.ts +20 -0
- package/dist/tools/delete-post-group.js +13 -0
- package/dist/tools/delete-webhook.d.ts +20 -0
- package/dist/tools/delete-webhook.js +13 -0
- package/dist/tools/disconnect-account.d.ts +20 -0
- package/dist/tools/disconnect-account.js +22 -0
- package/dist/tools/generate-image.d.ts +4 -4
- package/dist/tools/generate-video.d.ts +59 -0
- package/dist/tools/generate-video.js +34 -0
- package/dist/tools/get-connect-link.d.ts +24 -0
- package/dist/tools/get-connect-link.js +46 -0
- package/dist/tools/get-google-business-review-link.d.ts +24 -0
- package/dist/tools/get-google-business-review-link.js +19 -0
- package/dist/tools/get-platform-schema.d.ts +24 -0
- package/dist/tools/get-platform-schema.js +44 -0
- package/dist/tools/get-post-missing.d.ts +16 -0
- package/dist/tools/get-post-missing.js +12 -0
- package/dist/tools/get-video-job.d.ts +24 -0
- package/dist/tools/get-video-job.js +31 -0
- package/dist/tools/get-video-options.d.ts +8 -0
- package/dist/tools/get-video-options.js +26 -0
- package/dist/tools/get-x-posting-quota.d.ts +16 -0
- package/dist/tools/get-x-posting-quota.js +21 -0
- package/dist/tools/list-activity.d.ts +32 -0
- package/dist/tools/list-activity.js +35 -0
- package/dist/tools/list-google-business-reviews.d.ts +32 -0
- package/dist/tools/list-google-business-reviews.js +28 -0
- package/dist/tools/list-oauth-clients.d.ts +8 -0
- package/dist/tools/list-oauth-clients.js +15 -0
- package/dist/tools/list-platforms.d.ts +16 -0
- package/dist/tools/list-platforms.js +20 -0
- package/dist/tools/list-posts.d.ts +3 -3
- package/dist/tools/list-posts.js +3 -2
- package/dist/tools/list-webhooks.d.ts +16 -0
- package/dist/tools/list-webhooks.js +24 -0
- package/dist/tools/reply-google-business-review.d.ts +36 -0
- package/dist/tools/reply-google-business-review.js +18 -0
- package/dist/tools/run-video-function.d.ts +24 -0
- package/dist/tools/run-video-function.js +25 -0
- package/dist/tools/suggest-google-business-review-reply.d.ts +48 -0
- package/dist/tools/suggest-google-business-review-reply.js +27 -0
- package/dist/tools/test-webhook.d.ts +20 -0
- package/dist/tools/test-webhook.js +14 -0
- package/dist/tools/trigger-platform-helper.d.ts +28 -0
- package/dist/tools/trigger-platform-helper.js +22 -0
- package/dist/tools/update-oauth-client.d.ts +44 -0
- package/dist/tools/update-oauth-client.js +21 -0
- package/dist/tools/update-post-release-id.d.ts +28 -0
- package/dist/tools/update-post-release-id.js +18 -0
- package/dist/tools/update-post-status.d.ts +28 -0
- package/dist/tools/update-post-status.js +23 -0
- package/dist/tools/update-post.js +1 -1
- package/dist/tools/update-webhook.d.ts +40 -0
- package/dist/tools/update-webhook.js +21 -0
- package/dist/tools/upload-media-from-url.d.ts +24 -0
- package/dist/tools/upload-media-from-url.js +26 -0
- package/dist/tools/webhook-events.d.ts +3 -0
- package/dist/tools/webhook-events.js +13 -0
- package/package.json +1 -1
- package/src/generated/platform-manifest.ts +695 -0
- package/src/index.ts +481 -1
- package/src/lib/api-client.ts +461 -0
- package/src/tools/audit-google-business-profile.ts +38 -0
- package/src/tools/create-oauth-client.ts +36 -0
- package/src/tools/create-post.ts +5 -17
- package/src/tools/create-signed-upload.ts +27 -0
- package/src/tools/create-webhook.ts +35 -0
- package/src/tools/delete-google-business-review-reply.ts +30 -0
- package/src/tools/delete-oauth-client.ts +23 -0
- package/src/tools/delete-post-group.ts +17 -0
- package/src/tools/delete-webhook.ts +18 -0
- package/src/tools/disconnect-account.ts +30 -0
- package/src/tools/generate-video.ts +38 -0
- package/src/tools/get-connect-link.ts +56 -0
- package/src/tools/get-google-business-review-link.ts +30 -0
- package/src/tools/get-platform-schema.ts +52 -0
- package/src/tools/get-post-missing.ts +17 -0
- package/src/tools/get-video-job.ts +36 -0
- package/src/tools/get-video-options.ts +30 -0
- package/src/tools/get-x-posting-quota.ts +25 -0
- package/src/tools/list-activity.ts +51 -0
- package/src/tools/list-google-business-reviews.ts +43 -0
- package/src/tools/list-oauth-clients.ts +18 -0
- package/src/tools/list-platforms.ts +25 -0
- package/src/tools/list-posts.ts +3 -2
- package/src/tools/list-webhooks.ts +30 -0
- package/src/tools/reply-google-business-review.ts +32 -0
- package/src/tools/run-video-function.ts +32 -0
- package/src/tools/suggest-google-business-review-reply.ts +44 -0
- package/src/tools/test-webhook.ts +18 -0
- package/src/tools/trigger-platform-helper.ts +34 -0
- package/src/tools/update-oauth-client.ts +38 -0
- package/src/tools/update-post-release-id.ts +26 -0
- package/src/tools/update-post-status.ts +31 -0
- package/src/tools/update-post.ts +1 -1
- package/src/tools/update-webhook.ts +37 -0
- package/src/tools/upload-media-from-url.ts +33 -0
- package/src/tools/webhook-events.ts +16 -0
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PLATFORM_HELPER_NAMES, SUPPORTED_PLATFORM_INPUTS, SUPPORTED_PLATFORM_IDS } from '../generated/platform-manifest.js';
|
|
3
|
+
export const triggerPlatformHelperTool = {
|
|
4
|
+
name: 'trigger_platform_helper',
|
|
5
|
+
description: `Run account-specific platform helper discovery. Available helpers: ${PLATFORM_HELPER_NAMES.join(', ')}.`,
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
helper: z.enum(PLATFORM_HELPER_NAMES),
|
|
8
|
+
account_id: z
|
|
9
|
+
.string()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Connected social account ID when the helper needs account context.'),
|
|
12
|
+
platform: z
|
|
13
|
+
.enum(SUPPORTED_PLATFORM_INPUTS)
|
|
14
|
+
.optional()
|
|
15
|
+
.describe(`Platform hint when no account_id is supplied. Supported: ${SUPPORTED_PLATFORM_IDS.join(', ')}.`),
|
|
16
|
+
params: z.record(z.unknown()).optional(),
|
|
17
|
+
}),
|
|
18
|
+
async execute(client, input) {
|
|
19
|
+
const result = await client.triggerPlatformHelper(input);
|
|
20
|
+
return JSON.stringify(result, null, 2);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const updateOAuthClientTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
client_id: z.ZodString;
|
|
8
|
+
client_name: z.ZodOptional<z.ZodString>;
|
|
9
|
+
description: z.ZodOptional<z.ZodString>;
|
|
10
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
11
|
+
allowed_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
default_scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<["accounts:read", "accounts:write", "posts:read", "posts:write", "media:write", "analytics:read"]>, "many">>;
|
|
13
|
+
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
confirm: z.ZodLiteral<true>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
confirm: true;
|
|
17
|
+
client_id: string;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
is_active?: boolean | undefined;
|
|
20
|
+
client_name?: string | undefined;
|
|
21
|
+
homepage?: string | undefined;
|
|
22
|
+
allowed_redirect_uris?: string[] | undefined;
|
|
23
|
+
default_scopes?: ("accounts:read" | "accounts:write" | "posts:read" | "posts:write" | "media:write" | "analytics:read")[] | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
confirm: true;
|
|
26
|
+
client_id: string;
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
is_active?: boolean | undefined;
|
|
29
|
+
client_name?: string | undefined;
|
|
30
|
+
homepage?: string | undefined;
|
|
31
|
+
allowed_redirect_uris?: string[] | undefined;
|
|
32
|
+
default_scopes?: ("accounts:read" | "accounts:write" | "posts:read" | "posts:write" | "media:write" | "analytics:read")[] | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
execute(client: PosterlyClient, input: {
|
|
35
|
+
client_id: string;
|
|
36
|
+
client_name?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
homepage?: string;
|
|
39
|
+
allowed_redirect_uris?: string[];
|
|
40
|
+
default_scopes?: string[];
|
|
41
|
+
is_active?: boolean;
|
|
42
|
+
confirm: true;
|
|
43
|
+
}): Promise<string>;
|
|
44
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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 updateOAuthClientTool = {
|
|
4
|
+
name: 'update_oauth_client',
|
|
5
|
+
description: 'Update a self-serve OAuth developer client. WRITE: confirm changed redirect URIs, scopes, and active state before calling.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
client_id: z.string().min(1),
|
|
8
|
+
client_name: z.string().min(1).max(120).optional(),
|
|
9
|
+
description: z.string().max(500).optional(),
|
|
10
|
+
homepage: z.string().url().optional(),
|
|
11
|
+
allowed_redirect_uris: z.array(z.string().url()).min(1).max(10).optional(),
|
|
12
|
+
default_scopes: z.array(scopeSchema).min(1).optional(),
|
|
13
|
+
is_active: z.boolean().optional(),
|
|
14
|
+
confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
|
|
15
|
+
}),
|
|
16
|
+
async execute(client, input) {
|
|
17
|
+
const { client_id, confirm: _confirm, ...payload } = input;
|
|
18
|
+
const result = await client.updateOAuthClient(client_id, payload);
|
|
19
|
+
return `OAuth client updated: ${result.client.client_name} (${result.client.client_id}) active=${result.client.is_active}`;
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const updatePostReleaseIdTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
post_id: z.ZodNumber;
|
|
8
|
+
release_id: z.ZodString;
|
|
9
|
+
group_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
confirm: z.ZodLiteral<true>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
post_id: number;
|
|
13
|
+
confirm: true;
|
|
14
|
+
release_id: string;
|
|
15
|
+
group_id?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
post_id: number;
|
|
18
|
+
confirm: true;
|
|
19
|
+
release_id: string;
|
|
20
|
+
group_id?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
execute(client: PosterlyClient, input: {
|
|
23
|
+
post_id: number;
|
|
24
|
+
release_id: string;
|
|
25
|
+
group_id?: string;
|
|
26
|
+
confirm: true;
|
|
27
|
+
}): Promise<string>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const updatePostReleaseIdTool = {
|
|
3
|
+
name: 'update_post_release_id',
|
|
4
|
+
description: 'Set or repair an external release_id and optional group_id on a post. WRITE: call get_post first, show the target post and release/group IDs, then pass confirm=true only after explicit confirmation.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
post_id: z.number().int().positive().describe('The post ID to update.'),
|
|
7
|
+
release_id: z.string().min(1).max(160).describe('External release ID to store on the post.'),
|
|
8
|
+
group_id: z.string().min(1).max(160).optional().describe('Optional external group/campaign ID.'),
|
|
9
|
+
confirm: z.literal(true).describe('Must be true after explicit user confirmation.'),
|
|
10
|
+
}),
|
|
11
|
+
async execute(client, input) {
|
|
12
|
+
const result = await client.updatePostReleaseId(input.post_id, {
|
|
13
|
+
release_id: input.release_id,
|
|
14
|
+
group_id: input.group_id,
|
|
15
|
+
});
|
|
16
|
+
return JSON.stringify(result, null, 2);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const updatePostStatusTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
post_id: z.ZodNumber;
|
|
8
|
+
status: z.ZodEnum<["scheduled", "paused", "draft"]>;
|
|
9
|
+
scheduled_at: z.ZodOptional<z.ZodString>;
|
|
10
|
+
confirm: z.ZodBoolean;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
status: "scheduled" | "paused" | "draft";
|
|
13
|
+
post_id: number;
|
|
14
|
+
confirm: boolean;
|
|
15
|
+
scheduled_at?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
status: "scheduled" | "paused" | "draft";
|
|
18
|
+
post_id: number;
|
|
19
|
+
confirm: boolean;
|
|
20
|
+
scheduled_at?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
execute(client: PosterlyClient, input: {
|
|
23
|
+
post_id: number;
|
|
24
|
+
status: "scheduled" | "paused" | "draft";
|
|
25
|
+
scheduled_at?: string;
|
|
26
|
+
confirm: boolean;
|
|
27
|
+
}): Promise<string>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const updatePostStatusTool = {
|
|
3
|
+
name: 'update_post_status',
|
|
4
|
+
description: 'Pause, resume/schedule, or move a post back to draft. DESTRUCTIVE WRITE: changes whether content will publish.\n\n' +
|
|
5
|
+
'REQUIRED BEFORE CALLING: Fetch the post with `get_post`, show the user current status and proposed status/scheduled_at, then get explicit confirmation. Pass confirm=true only after that confirmation.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
post_id: z.number().describe('The post ID to update.'),
|
|
8
|
+
status: z.enum(['scheduled', 'paused', 'draft']).describe('Target status.'),
|
|
9
|
+
scheduled_at: z.string().optional().describe('ISO 8601 datetime. Required when scheduling a draft.'),
|
|
10
|
+
confirm: z.boolean().describe('Must be true after explicit user confirmation.'),
|
|
11
|
+
}),
|
|
12
|
+
async execute(client, input) {
|
|
13
|
+
if (input.confirm !== true) {
|
|
14
|
+
throw new Error('Refusing to update post status without confirm=true after explicit user confirmation.');
|
|
15
|
+
}
|
|
16
|
+
const result = await client.updatePostStatus(input.post_id, {
|
|
17
|
+
status: input.status,
|
|
18
|
+
scheduled_at: input.scheduled_at,
|
|
19
|
+
});
|
|
20
|
+
const transition = result.transition || {};
|
|
21
|
+
return `Post #${input.post_id} status changed from ${transition.old_status || 'unknown'} to ${transition.new_status || input.status}.`;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -74,7 +74,7 @@ export const updatePostTool = {
|
|
|
74
74
|
.describe('New post type: text, image, video, carousel, reel, story'),
|
|
75
75
|
instagram_settings: instagramSettingsSchema
|
|
76
76
|
.optional()
|
|
77
|
-
.describe('Instagram-specific updates: post_type, collaborators, user_tags, first_comment, media_alt_texts, is_trial_reel, graduation_strategy, reel_cover_url, reel_thumb_offset.'),
|
|
77
|
+
.describe('Instagram-specific updates: post_type, collaborators, user_tags, first_comment, media_alt_texts, is_trial_reel, graduation_strategy (defaults to MANUAL), reel_cover_url, reel_thumb_offset.'),
|
|
78
78
|
platform_settings: platformSettingsSchema
|
|
79
79
|
.optional()
|
|
80
80
|
.describe('Platform-specific settings to merge into the post. Prefer this over raw metadata.'),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const updateWebhookTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
webhook_id: z.ZodString;
|
|
8
|
+
url: z.ZodOptional<z.ZodString>;
|
|
9
|
+
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">>;
|
|
10
|
+
workspace_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
11
|
+
description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
12
|
+
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
confirm: z.ZodLiteral<true>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
confirm: true;
|
|
16
|
+
webhook_id: string;
|
|
17
|
+
workspace_id?: string | null | undefined;
|
|
18
|
+
url?: string | undefined;
|
|
19
|
+
events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced")[] | undefined;
|
|
20
|
+
description?: string | null | undefined;
|
|
21
|
+
is_active?: boolean | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
confirm: true;
|
|
24
|
+
webhook_id: string;
|
|
25
|
+
workspace_id?: string | null | undefined;
|
|
26
|
+
url?: string | undefined;
|
|
27
|
+
events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced")[] | undefined;
|
|
28
|
+
description?: string | null | undefined;
|
|
29
|
+
is_active?: boolean | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
execute(client: PosterlyClient, input: {
|
|
32
|
+
webhook_id: string;
|
|
33
|
+
url?: string;
|
|
34
|
+
events?: string[];
|
|
35
|
+
workspace_id?: string | null;
|
|
36
|
+
description?: string | null;
|
|
37
|
+
is_active?: boolean;
|
|
38
|
+
confirm: true;
|
|
39
|
+
}): Promise<string>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { webhookEventSchema } from './webhook-events.js';
|
|
3
|
+
export const updateWebhookTool = {
|
|
4
|
+
name: 'update_webhook',
|
|
5
|
+
description: 'Update a webhook URL, events, workspace, description, or active state. WRITE WITH OUTBOUND SIDE EFFECTS: list the current webhook first and get explicit confirmation before calling.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
webhook_id: z.string().describe('Webhook ID from list_webhooks.'),
|
|
8
|
+
url: z.string().url().optional(),
|
|
9
|
+
events: z.array(webhookEventSchema).optional(),
|
|
10
|
+
workspace_id: z.union([z.string(), z.null()]).optional(),
|
|
11
|
+
description: z.union([z.string().max(240), z.null()]).optional(),
|
|
12
|
+
is_active: z.boolean().optional(),
|
|
13
|
+
confirm: z.literal(true).describe('Must be true after the user explicitly confirms the webhook update.'),
|
|
14
|
+
}),
|
|
15
|
+
async execute(client, input) {
|
|
16
|
+
const { webhook_id, confirm: _confirm, ...payload } = input;
|
|
17
|
+
const result = await client.updateWebhook(webhook_id, payload);
|
|
18
|
+
const active = result.webhook.is_active ? 'active' : 'inactive';
|
|
19
|
+
return `Webhook updated: ${result.webhook.id}\nURL: ${result.webhook.url}\nState: ${active}\nEvents: ${result.webhook.events.join(', ')}`;
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const uploadMediaFromUrlTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
url: z.ZodString;
|
|
8
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
9
|
+
content_type: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
url: string;
|
|
12
|
+
content_type?: string | undefined;
|
|
13
|
+
filename?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
url: string;
|
|
16
|
+
content_type?: string | undefined;
|
|
17
|
+
filename?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
url: string;
|
|
21
|
+
filename?: string;
|
|
22
|
+
content_type?: string;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const uploadMediaFromUrlTool = {
|
|
3
|
+
name: 'upload_media_from_url',
|
|
4
|
+
description: 'Fetch an image or video from a public HTTPS URL into posterly storage. Returns a URL that can be used with create_post.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
url: z.string().url().describe('Public HTTPS URL for the image or video. Local/private network URLs are blocked.'),
|
|
7
|
+
filename: z.string().optional().describe('Optional filename override.'),
|
|
8
|
+
content_type: z.string().optional().describe('Optional MIME type override.'),
|
|
9
|
+
}),
|
|
10
|
+
async execute(client, input) {
|
|
11
|
+
const result = await client.uploadMediaFromUrl({
|
|
12
|
+
url: input.url,
|
|
13
|
+
filename: input.filename,
|
|
14
|
+
contentType: input.content_type,
|
|
15
|
+
});
|
|
16
|
+
return [
|
|
17
|
+
'Remote media uploaded successfully.',
|
|
18
|
+
`• URL: ${result.url}`,
|
|
19
|
+
`• Source URL: ${result.source_url}`,
|
|
20
|
+
`• Content type: ${result.content_type}`,
|
|
21
|
+
`• Size: ${result.size} bytes`,
|
|
22
|
+
'',
|
|
23
|
+
'Use this URL as media_url when creating a post.',
|
|
24
|
+
].join('\n');
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WEBHOOK_EVENTS: readonly ["webhook.test", "post.created", "post.updated", "post.deleted", "post.publishing", "post.published", "post.failed", "account.disconnected", "analytics.synced"];
|
|
3
|
+
export declare const webhookEventSchema: z.ZodEnum<["webhook.test", "post.created", "post.updated", "post.deleted", "post.publishing", "post.published", "post.failed", "account.disconnected", "analytics.synced"]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const WEBHOOK_EVENTS = [
|
|
3
|
+
'webhook.test',
|
|
4
|
+
'post.created',
|
|
5
|
+
'post.updated',
|
|
6
|
+
'post.deleted',
|
|
7
|
+
'post.publishing',
|
|
8
|
+
'post.published',
|
|
9
|
+
'post.failed',
|
|
10
|
+
'account.disconnected',
|
|
11
|
+
'analytics.synced',
|
|
12
|
+
];
|
|
13
|
+
export const webhookEventSchema = z.enum(WEBHOOK_EVENTS);
|