posterly-mcp-server 0.40.0 → 0.43.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.
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient, ImageJob } from '../lib/api-client.js';
3
+
4
+ export const getImageJobTool = {
5
+ name: 'get_image_job',
6
+ description:
7
+ 'Get one AI image generation job by ID, or list recent image jobs when job_id is omitted. Use after generate_image to poll for completed urls.',
8
+ inputSchema: z.object({
9
+ job_id: z.string().optional(),
10
+ status: z.enum(['pending', 'processing', 'completed', 'failed']).optional(),
11
+ limit: z.number().int().min(1).max(50).default(10).optional(),
12
+ }),
13
+
14
+ async execute(client: PosterlyClient, input: { job_id?: string; status?: string; limit?: number }) {
15
+ const result = await client.getImageJob(input);
16
+ if (result.job) return formatJob(result.job, true);
17
+
18
+ const jobs = result.jobs || [];
19
+ return [
20
+ `Image jobs (${jobs.length})`,
21
+ jobs.map((job) => formatJob(job, false)).join('\n\n'),
22
+ ].filter(Boolean).join('\n');
23
+ },
24
+ };
25
+
26
+ function formatJob(job: ImageJob, includeRaw: boolean): string {
27
+ const lines = [
28
+ `${job.id}: ${job.status}`,
29
+ `Prompt: ${job.prompt}`,
30
+ `Model: ${job.model}; resolution: ${job.resolution}; thinking: ${job.thinking_level || 'n/a'}; cost: ${job.credit_cost}`,
31
+ job.urls?.length ? `URLs: ${job.urls.join(', ')}` : null,
32
+ job.error_message ? `Error: ${job.error_message}` : null,
33
+ includeRaw ? `\nRaw job:\n${JSON.stringify(job, null, 2)}` : null,
34
+ ];
35
+ return lines.filter(Boolean).join('\n');
36
+ }
@@ -2,6 +2,13 @@ import { z } from 'zod';
2
2
  import type { PosterlyClient } from '../lib/api-client.js';
3
3
  import { code, formatDateTime, mdKeyValue, mdQuote, mdSection, mdTitle, statusLabel } from '../lib/format.js';
4
4
 
5
+ const mediaAccessibilitySchema = z.array(z.object({
6
+ index: z.number().int().nonnegative(),
7
+ asset_id: z.string().optional(),
8
+ source_url: z.string().url().optional(),
9
+ alt_text: z.string(),
10
+ })).describe('Preferred ordered media alt text. Identity follows index/asset_id through platform media preparation; media_alt_texts remains the legacy URL-map form.');
11
+
5
12
  const instagramSettingsSchema = z.object({
6
13
  __type: z.enum(['instagram', 'instagram-standalone']).optional(),
7
14
  post_type: z.enum(['post', 'feed', 'story', 'reel', 'carousel']).optional(),
@@ -18,6 +25,7 @@ const instagramSettingsSchema = z.object({
18
25
  .describe('Native clickable media tags, not caption @mentions. Supported by eligible direct Instagram and Meta-linked connections; feed images, Reels/video, and Stories. Tags apply to each carousel item and the first Story in a Story Series.'),
19
26
  first_comment: z.string().optional(),
20
27
  media_alt_texts: z.record(z.string(), z.string()).optional(),
28
+ media_accessibility: mediaAccessibilitySchema.optional(),
21
29
  reel_cover_url: z.string().optional(),
22
30
  reel_cover_method: z.string().optional(),
23
31
  reel_thumb_offset: z.number().nonnegative().optional(),
@@ -30,6 +38,7 @@ const platformSettingsSchema = z.object({
30
38
  post_type: z.string().optional(),
31
39
  content_type: z.string().optional(),
32
40
  media_alt_texts: z.record(z.string(), z.string()).optional(),
41
+ media_accessibility: mediaAccessibilitySchema.optional(),
33
42
  reel_cover_url: z.string().optional(),
34
43
  reel_cover_method: z.string().optional(),
35
44
  reel_thumb_offset: z.number().nonnegative().optional(),
@@ -51,6 +51,7 @@
51
51
  "run_video_function",
52
52
  "generate_video",
53
53
  "get_video_job",
54
+ "get_image_job",
54
55
  "generate_captions",
55
56
  "generate_image",
56
57
  "get_post",
@@ -118,6 +119,7 @@
118
119
  "list_media",
119
120
  "get_video_options",
120
121
  "get_video_job",
122
+ "get_image_job",
121
123
  "get_post",
122
124
  "get_post_missing",
123
125
  "get_account_analytics",
@@ -203,6 +205,7 @@
203
205
  "run_video_function",
204
206
  "generate_video",
205
207
  "get_video_job",
208
+ "get_image_job",
206
209
  "generate_captions",
207
210
  "generate_image",
208
211
  "ask_support",