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,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CONNECT_INPUTS, PLANNED_PLATFORM_IDS } from '../generated/platform-manifest.js';
|
|
3
|
+
export const getConnectLinkTool = {
|
|
4
|
+
name: 'get_connect_link',
|
|
5
|
+
description: 'List dashboard handoff links/readiness for connecting social accounts, or get one platform connection URL. Use connection_url in a logged-in browser. Direct OAuth URLs are intentionally not exposed because provider callbacks rely on browser state.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
platform: z
|
|
8
|
+
.enum(CONNECT_INPUTS)
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Connection target such as instagram, meta, linkedin_page, twitter, x, google_business, telegram, reddit, or wordpress. Omit to list live connection targets.'),
|
|
11
|
+
workspace_id: z
|
|
12
|
+
.string()
|
|
13
|
+
.optional()
|
|
14
|
+
.describe('Filter connected account counts to a workspace.'),
|
|
15
|
+
include_planned: z
|
|
16
|
+
.boolean()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe(`Include planned provider expansion targets from the Postiz parity audit: ${PLANNED_PLATFORM_IDS.join(', ')}.`),
|
|
19
|
+
}),
|
|
20
|
+
async execute(client, input) {
|
|
21
|
+
const result = await client.getConnectLink(input);
|
|
22
|
+
if (result.connect) {
|
|
23
|
+
return formatConnectOption(result.connect, true);
|
|
24
|
+
}
|
|
25
|
+
const options = result.connect_options || [];
|
|
26
|
+
const lines = options.map((option) => formatConnectOption(option, false));
|
|
27
|
+
return `Posterly connection options (${options.length}):\n${lines.join('\n\n')}`;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
function formatConnectOption(option, includeRaw) {
|
|
31
|
+
const missing = option.missing_env?.length
|
|
32
|
+
? `missing env: ${option.missing_env.map((group) => group.join(' or ')).join(', ')}`
|
|
33
|
+
: 'configured';
|
|
34
|
+
const accounts = option.connected_count ?? option.connected_accounts?.length ?? 0;
|
|
35
|
+
const fields = option.credential_fields?.length
|
|
36
|
+
? `; credential fields: ${option.credential_fields.map((field) => field.key).join(', ')}`
|
|
37
|
+
: '';
|
|
38
|
+
const scopes = option.scopes?.length ? `; scopes: ${option.scopes.join(', ')}` : '';
|
|
39
|
+
const raw = includeRaw ? `\n\nRaw connect option:\n${JSON.stringify(option, null, 2)}` : '';
|
|
40
|
+
return [
|
|
41
|
+
`${option.label} (${option.platform})`,
|
|
42
|
+
`Status: ${option.status}; method: ${option.method}; ${missing}; connected accounts: ${accounts}`,
|
|
43
|
+
`Connection URL: ${option.connection_url || 'not available'}${fields}${scopes}`,
|
|
44
|
+
raw,
|
|
45
|
+
].join('\n');
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getGoogleBusinessReviewLinkTool: {
|
|
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
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
workspace_id?: string | undefined;
|
|
12
|
+
account_id?: number | undefined;
|
|
13
|
+
location_id?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
workspace_id?: string | undefined;
|
|
16
|
+
account_id?: number | undefined;
|
|
17
|
+
location_id?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
workspace_id?: string;
|
|
21
|
+
account_id?: number;
|
|
22
|
+
location_id?: string;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const getGoogleBusinessReviewLinkTool = {
|
|
3
|
+
name: 'get_google_business_review_link',
|
|
4
|
+
description: 'Get the direct public Google review link for a connected Google Business Profile location. Requires account_id or location_id.',
|
|
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
|
+
}),
|
|
10
|
+
async execute(client, input) {
|
|
11
|
+
const result = await client.getGoogleBusinessReviewLink(input);
|
|
12
|
+
return [
|
|
13
|
+
`Review link for ${result.businessName}:`,
|
|
14
|
+
result.reviewLink,
|
|
15
|
+
`Place ID: ${result.placeId}`,
|
|
16
|
+
`Account ID: ${result.account_id}`,
|
|
17
|
+
].join('\n');
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getPlatformSchemaTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
platform: z.ZodOptional<z.ZodEnum<["bluesky", "devto", "discord", "facebook", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "linkedin", "mastodon", "medium", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "youtube"]>>;
|
|
9
|
+
include_planned: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
include_planned?: boolean | undefined;
|
|
12
|
+
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" | undefined;
|
|
13
|
+
account_id?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
include_planned?: boolean | undefined;
|
|
16
|
+
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" | undefined;
|
|
17
|
+
account_id?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
account_id?: string;
|
|
21
|
+
platform?: string;
|
|
22
|
+
include_planned?: boolean;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ALL_PLATFORM_INPUTS, SUPPORTED_PLATFORM_IDS } from '../generated/platform-manifest.js';
|
|
3
|
+
export const getPlatformSchemaTool = {
|
|
4
|
+
name: 'get_platform_schema',
|
|
5
|
+
description: 'Get the platform schema for a specific connected account or platform. Call this before creating posts with platform_settings so you know allowed post types, media limits, helper tools, and field names.',
|
|
6
|
+
inputSchema: z.object({
|
|
7
|
+
account_id: z
|
|
8
|
+
.string()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe('Connected account ID from list_accounts. Preferred because it returns account context.'),
|
|
11
|
+
platform: z
|
|
12
|
+
.enum(ALL_PLATFORM_INPUTS)
|
|
13
|
+
.optional()
|
|
14
|
+
.describe(`Platform ID such as ${SUPPORTED_PLATFORM_IDS.join(', ')}. Set include_planned to inspect planned providers.`),
|
|
15
|
+
include_planned: z.boolean().optional(),
|
|
16
|
+
}),
|
|
17
|
+
async execute(client, input) {
|
|
18
|
+
const result = await client.getPlatformSchema(input);
|
|
19
|
+
const schema = result.schema || result.platform || result.platforms?.[0];
|
|
20
|
+
if (!schema)
|
|
21
|
+
return JSON.stringify(result, null, 2);
|
|
22
|
+
const fields = schema.settings_schema?.fields || [];
|
|
23
|
+
const helpers = schema.helper_tools || [];
|
|
24
|
+
const accountLine = result.account
|
|
25
|
+
? `Account: ${result.account.username || result.account.id} (${result.account.platform})\n`
|
|
26
|
+
: '';
|
|
27
|
+
return [
|
|
28
|
+
`${schema.label} (${schema.id}) schema`,
|
|
29
|
+
accountLine.trim(),
|
|
30
|
+
`Status: ${schema.status}`,
|
|
31
|
+
`Post types: ${schema.post_types.join(', ') || 'n/a'}`,
|
|
32
|
+
`Content limit: ${schema.content_limit ?? 'n/a'}`,
|
|
33
|
+
`Media: ${JSON.stringify(schema.media)}`,
|
|
34
|
+
`Analytics: ${schema.analytics_supported ? 'yes' : 'no'}`,
|
|
35
|
+
fields.length
|
|
36
|
+
? `Settings:\n${fields.map((field) => `• ${field.key}${field.required ? ' (required)' : ''}: ${field.description}`).join('\n')}`
|
|
37
|
+
: 'Settings: none',
|
|
38
|
+
helpers.length
|
|
39
|
+
? `Helpers:\n${helpers.map((helper) => `• ${helper.name}: ${helper.description}`).join('\n')}`
|
|
40
|
+
: 'Helpers: none',
|
|
41
|
+
`Example settings: ${JSON.stringify(schema.settings_schema?.example || {})}`,
|
|
42
|
+
].filter(Boolean).join('\n');
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getPostMissingTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
post_id: z.ZodNumber;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
post_id: number;
|
|
10
|
+
}, {
|
|
11
|
+
post_id: number;
|
|
12
|
+
}>;
|
|
13
|
+
execute(client: PosterlyClient, input: {
|
|
14
|
+
post_id: number;
|
|
15
|
+
}): Promise<string>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const getPostMissingTool = {
|
|
3
|
+
name: 'get_post_missing',
|
|
4
|
+
description: 'Inspect whether a post is missing required content, media, account, platform settings, or metadata before it can publish. Use this to repair failed or imported posts.',
|
|
5
|
+
inputSchema: z.object({
|
|
6
|
+
post_id: z.number().int().positive().describe('The post ID to inspect.'),
|
|
7
|
+
}),
|
|
8
|
+
async execute(client, input) {
|
|
9
|
+
const result = await client.getPostMissing(input.post_id);
|
|
10
|
+
return JSON.stringify(result, null, 2);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
export declare const getVideoJobTool: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: z.ZodObject<{
|
|
7
|
+
job_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed", "dismissed"]>>;
|
|
9
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
status?: "pending" | "processing" | "completed" | "failed" | "dismissed" | undefined;
|
|
12
|
+
limit?: number | undefined;
|
|
13
|
+
job_id?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
status?: "pending" | "processing" | "completed" | "failed" | "dismissed" | undefined;
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
job_id?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
execute(client: PosterlyClient, input: {
|
|
20
|
+
job_id?: string;
|
|
21
|
+
status?: string;
|
|
22
|
+
limit?: number;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
};
|
|
@@ -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.
|
|
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
|
}>;
|
package/dist/tools/list-posts.js
CHANGED
|
@@ -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
|
-
.
|
|
12
|
+
.enum(SUPPORTED_PLATFORM_INPUTS)
|
|
12
13
|
.optional()
|
|
13
|
-
.describe(
|
|
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
|
+
};
|