posterly-mcp-server 0.20.7 → 0.21.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 CHANGED
@@ -108,7 +108,7 @@ Add the same server definition to your Cursor MCP settings:
108
108
 
109
109
  ## Available tools
110
110
 
111
- `posterly-mcp-server@0.20.7` exposes 58 tools.
111
+ `posterly-mcp-server@0.20.8` exposes 59 tools.
112
112
 
113
113
  Public setup tools work before `POSTERLY_API_KEY` exists:
114
114
 
@@ -126,6 +126,7 @@ Authenticated tools require `POSTERLY_API_KEY`:
126
126
  - `create_connect_session` (create a guided browser handoff for connecting a social account)
127
127
  - `get_connect_session` (poll connection progress while the user approves OAuth or enters credentials)
128
128
  - `create_api_key` (create a new API key after explicit confirmation; scopes cannot exceed the calling dashboard key)
129
+ - `delete_api_key` (revoke a user-created API key after explicit confirmation)
129
130
  - `list_oauth_clients`
130
131
  - `create_oauth_client` (create a public PKCE client after explicit confirmation)
131
132
  - `update_oauth_client` (update redirect URIs/scopes after explicit confirmation)
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ import { getConnectLinkTool } from './tools/get-connect-link.js';
57
57
  import { createConnectSessionTool } from './tools/create-connect-session.js';
58
58
  import { getConnectSessionTool } from './tools/get-connect-session.js';
59
59
  import { createApiKeyTool } from './tools/create-api-key.js';
60
+ import { deleteApiKeyTool } from './tools/delete-api-key.js';
60
61
  import { listOAuthClientsTool } from './tools/list-oauth-clients.js';
61
62
  import { createOAuthClientTool } from './tools/create-oauth-client.js';
62
63
  import { updateOAuthClientTool } from './tools/update-oauth-client.js';
@@ -166,6 +167,15 @@ server.tool(createApiKeyTool.name, createApiKeyTool.description, createApiKeyToo
166
167
  return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
167
168
  }
168
169
  });
170
+ server.tool(deleteApiKeyTool.name, deleteApiKeyTool.description, deleteApiKeyTool.inputSchema.shape, async (input) => {
171
+ try {
172
+ const text = await deleteApiKeyTool.execute(client, input);
173
+ return { content: [{ type: 'text', text }] };
174
+ }
175
+ catch (err) {
176
+ return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
177
+ }
178
+ });
169
179
  server.tool(listOAuthClientsTool.name, listOAuthClientsTool.description, listOAuthClientsTool.inputSchema.shape, async () => {
170
180
  try {
171
181
  const text = await listOAuthClientsTool.execute(client);
@@ -187,6 +187,20 @@ export type CreateApiKeyResponse = {
187
187
  uses_grandfathered_keys?: boolean;
188
188
  };
189
189
  };
190
+ export type DeleteApiKeyResponse = {
191
+ revoked: true;
192
+ already_revoked: boolean;
193
+ api_key: {
194
+ id: string;
195
+ name: string;
196
+ key_prefix: string;
197
+ scopes: ApiKeyScope[];
198
+ workspace_id?: string | null;
199
+ expires_at?: string | null;
200
+ created_at: string;
201
+ is_revoked?: boolean;
202
+ };
203
+ };
190
204
  export type AskSupportResponse = {
191
205
  success: boolean;
192
206
  workspace_id: string;
@@ -581,6 +595,9 @@ export declare class PosterlyClient {
581
595
  getSignupSession(sessionId: string): Promise<PublicSignupSessionResponse>;
582
596
  whoami(): Promise<Whoami>;
583
597
  createApiKey(data: CreateApiKeyPayload): Promise<CreateApiKeyResponse>;
598
+ deleteApiKey(keyId: string, data: {
599
+ confirm: true;
600
+ }): Promise<DeleteApiKeyResponse>;
584
601
  listAccounts(params?: {
585
602
  workspace_id?: string;
586
603
  }): Promise<Account[]>;
@@ -116,6 +116,9 @@ export class PosterlyClient {
116
116
  async createApiKey(data) {
117
117
  return this.request('POST', '/api-keys', data);
118
118
  }
119
+ async deleteApiKey(keyId, data) {
120
+ return this.request('DELETE', `/api-keys/${encodeURIComponent(keyId)}`, data);
121
+ }
119
122
  async listAccounts(params) {
120
123
  const searchParams = new URLSearchParams();
121
124
  if (params?.workspace_id)
@@ -1 +1 @@
1
- export declare const POSTERLY_MCP_VERSION = "0.20.7";
1
+ export declare const POSTERLY_MCP_VERSION = "0.20.8";
@@ -1 +1 @@
1
- export const POSTERLY_MCP_VERSION = '0.20.7';
1
+ export const POSTERLY_MCP_VERSION = '0.20.8';
@@ -85,12 +85,18 @@ export declare const platformSettingsSchema: z.ZodObject<{
85
85
  poll: z.ZodOptional<z.ZodObject<{
86
86
  options: z.ZodArray<z.ZodString, "many">;
87
87
  duration_minutes: z.ZodOptional<z.ZodNumber>;
88
+ question: z.ZodOptional<z.ZodString>;
89
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
88
90
  }, "strip", z.ZodTypeAny, {
89
91
  options: string[];
90
92
  duration_minutes?: number | undefined;
93
+ question?: string | undefined;
94
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
91
95
  }, {
92
96
  options: string[];
93
97
  duration_minutes?: number | undefined;
98
+ question?: string | undefined;
99
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
94
100
  }>>;
95
101
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
96
102
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -134,12 +140,18 @@ export declare const platformSettingsSchema: z.ZodObject<{
134
140
  poll: z.ZodOptional<z.ZodObject<{
135
141
  options: z.ZodArray<z.ZodString, "many">;
136
142
  duration_minutes: z.ZodOptional<z.ZodNumber>;
143
+ question: z.ZodOptional<z.ZodString>;
144
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
137
145
  }, "strip", z.ZodTypeAny, {
138
146
  options: string[];
139
147
  duration_minutes?: number | undefined;
148
+ question?: string | undefined;
149
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
140
150
  }, {
141
151
  options: string[];
142
152
  duration_minutes?: number | undefined;
153
+ question?: string | undefined;
154
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
143
155
  }>>;
144
156
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
145
157
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -183,12 +195,18 @@ export declare const platformSettingsSchema: z.ZodObject<{
183
195
  poll: z.ZodOptional<z.ZodObject<{
184
196
  options: z.ZodArray<z.ZodString, "many">;
185
197
  duration_minutes: z.ZodOptional<z.ZodNumber>;
198
+ question: z.ZodOptional<z.ZodString>;
199
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
186
200
  }, "strip", z.ZodTypeAny, {
187
201
  options: string[];
188
202
  duration_minutes?: number | undefined;
203
+ question?: string | undefined;
204
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
189
205
  }, {
190
206
  options: string[];
191
207
  duration_minutes?: number | undefined;
208
+ question?: string | undefined;
209
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
192
210
  }>>;
193
211
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
194
212
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -317,12 +335,18 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
317
335
  poll: z.ZodOptional<z.ZodObject<{
318
336
  options: z.ZodArray<z.ZodString, "many">;
319
337
  duration_minutes: z.ZodOptional<z.ZodNumber>;
338
+ question: z.ZodOptional<z.ZodString>;
339
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
320
340
  }, "strip", z.ZodTypeAny, {
321
341
  options: string[];
322
342
  duration_minutes?: number | undefined;
343
+ question?: string | undefined;
344
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
323
345
  }, {
324
346
  options: string[];
325
347
  duration_minutes?: number | undefined;
348
+ question?: string | undefined;
349
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
326
350
  }>>;
327
351
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
328
352
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -366,12 +390,18 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
366
390
  poll: z.ZodOptional<z.ZodObject<{
367
391
  options: z.ZodArray<z.ZodString, "many">;
368
392
  duration_minutes: z.ZodOptional<z.ZodNumber>;
393
+ question: z.ZodOptional<z.ZodString>;
394
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
369
395
  }, "strip", z.ZodTypeAny, {
370
396
  options: string[];
371
397
  duration_minutes?: number | undefined;
398
+ question?: string | undefined;
399
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
372
400
  }, {
373
401
  options: string[];
374
402
  duration_minutes?: number | undefined;
403
+ question?: string | undefined;
404
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
375
405
  }>>;
376
406
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
377
407
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -415,12 +445,18 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
415
445
  poll: z.ZodOptional<z.ZodObject<{
416
446
  options: z.ZodArray<z.ZodString, "many">;
417
447
  duration_minutes: z.ZodOptional<z.ZodNumber>;
448
+ question: z.ZodOptional<z.ZodString>;
449
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
418
450
  }, "strip", z.ZodTypeAny, {
419
451
  options: string[];
420
452
  duration_minutes?: number | undefined;
453
+ question?: string | undefined;
454
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
421
455
  }, {
422
456
  options: string[];
423
457
  duration_minutes?: number | undefined;
458
+ question?: string | undefined;
459
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
424
460
  }>>;
425
461
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
426
462
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -497,12 +533,18 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
497
533
  poll: z.ZodOptional<z.ZodObject<{
498
534
  options: z.ZodArray<z.ZodString, "many">;
499
535
  duration_minutes: z.ZodOptional<z.ZodNumber>;
536
+ question: z.ZodOptional<z.ZodString>;
537
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
500
538
  }, "strip", z.ZodTypeAny, {
501
539
  options: string[];
502
540
  duration_minutes?: number | undefined;
541
+ question?: string | undefined;
542
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
503
543
  }, {
504
544
  options: string[];
505
545
  duration_minutes?: number | undefined;
546
+ question?: string | undefined;
547
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
506
548
  }>>;
507
549
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
508
550
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -578,12 +620,18 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
578
620
  poll: z.ZodOptional<z.ZodObject<{
579
621
  options: z.ZodArray<z.ZodString, "many">;
580
622
  duration_minutes: z.ZodOptional<z.ZodNumber>;
623
+ question: z.ZodOptional<z.ZodString>;
624
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
581
625
  }, "strip", z.ZodTypeAny, {
582
626
  options: string[];
583
627
  duration_minutes?: number | undefined;
628
+ question?: string | undefined;
629
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
584
630
  }, {
585
631
  options: string[];
586
632
  duration_minutes?: number | undefined;
633
+ question?: string | undefined;
634
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
587
635
  }>>;
588
636
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
589
637
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -713,12 +761,18 @@ export declare const createPostInputSchema: z.ZodObject<{
713
761
  poll: z.ZodOptional<z.ZodObject<{
714
762
  options: z.ZodArray<z.ZodString, "many">;
715
763
  duration_minutes: z.ZodOptional<z.ZodNumber>;
764
+ question: z.ZodOptional<z.ZodString>;
765
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
716
766
  }, "strip", z.ZodTypeAny, {
717
767
  options: string[];
718
768
  duration_minutes?: number | undefined;
769
+ question?: string | undefined;
770
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
719
771
  }, {
720
772
  options: string[];
721
773
  duration_minutes?: number | undefined;
774
+ question?: string | undefined;
775
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
722
776
  }>>;
723
777
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
724
778
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -762,12 +816,18 @@ export declare const createPostInputSchema: z.ZodObject<{
762
816
  poll: z.ZodOptional<z.ZodObject<{
763
817
  options: z.ZodArray<z.ZodString, "many">;
764
818
  duration_minutes: z.ZodOptional<z.ZodNumber>;
819
+ question: z.ZodOptional<z.ZodString>;
820
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
765
821
  }, "strip", z.ZodTypeAny, {
766
822
  options: string[];
767
823
  duration_minutes?: number | undefined;
824
+ question?: string | undefined;
825
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
768
826
  }, {
769
827
  options: string[];
770
828
  duration_minutes?: number | undefined;
829
+ question?: string | undefined;
830
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
771
831
  }>>;
772
832
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
773
833
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -811,12 +871,18 @@ export declare const createPostInputSchema: z.ZodObject<{
811
871
  poll: z.ZodOptional<z.ZodObject<{
812
872
  options: z.ZodArray<z.ZodString, "many">;
813
873
  duration_minutes: z.ZodOptional<z.ZodNumber>;
874
+ question: z.ZodOptional<z.ZodString>;
875
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
814
876
  }, "strip", z.ZodTypeAny, {
815
877
  options: string[];
816
878
  duration_minutes?: number | undefined;
879
+ question?: string | undefined;
880
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
817
881
  }, {
818
882
  options: string[];
819
883
  duration_minutes?: number | undefined;
884
+ question?: string | undefined;
885
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
820
886
  }>>;
821
887
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
822
888
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -896,12 +962,18 @@ export declare const createPostInputSchema: z.ZodObject<{
896
962
  poll: z.ZodOptional<z.ZodObject<{
897
963
  options: z.ZodArray<z.ZodString, "many">;
898
964
  duration_minutes: z.ZodOptional<z.ZodNumber>;
965
+ question: z.ZodOptional<z.ZodString>;
966
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
899
967
  }, "strip", z.ZodTypeAny, {
900
968
  options: string[];
901
969
  duration_minutes?: number | undefined;
970
+ question?: string | undefined;
971
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
902
972
  }, {
903
973
  options: string[];
904
974
  duration_minutes?: number | undefined;
975
+ question?: string | undefined;
976
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
905
977
  }>>;
906
978
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
907
979
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -978,12 +1050,18 @@ export declare const createPostInputSchema: z.ZodObject<{
978
1050
  poll: z.ZodOptional<z.ZodObject<{
979
1051
  options: z.ZodArray<z.ZodString, "many">;
980
1052
  duration_minutes: z.ZodOptional<z.ZodNumber>;
1053
+ question: z.ZodOptional<z.ZodString>;
1054
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
981
1055
  }, "strip", z.ZodTypeAny, {
982
1056
  options: string[];
983
1057
  duration_minutes?: number | undefined;
1058
+ question?: string | undefined;
1059
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
984
1060
  }, {
985
1061
  options: string[];
986
1062
  duration_minutes?: number | undefined;
1063
+ question?: string | undefined;
1064
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
987
1065
  }>>;
988
1066
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
989
1067
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1119,12 +1197,18 @@ export declare const createPostTool: {
1119
1197
  poll: z.ZodOptional<z.ZodObject<{
1120
1198
  options: z.ZodArray<z.ZodString, "many">;
1121
1199
  duration_minutes: z.ZodOptional<z.ZodNumber>;
1200
+ question: z.ZodOptional<z.ZodString>;
1201
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
1122
1202
  }, "strip", z.ZodTypeAny, {
1123
1203
  options: string[];
1124
1204
  duration_minutes?: number | undefined;
1205
+ question?: string | undefined;
1206
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1125
1207
  }, {
1126
1208
  options: string[];
1127
1209
  duration_minutes?: number | undefined;
1210
+ question?: string | undefined;
1211
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1128
1212
  }>>;
1129
1213
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
1130
1214
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1168,12 +1252,18 @@ export declare const createPostTool: {
1168
1252
  poll: z.ZodOptional<z.ZodObject<{
1169
1253
  options: z.ZodArray<z.ZodString, "many">;
1170
1254
  duration_minutes: z.ZodOptional<z.ZodNumber>;
1255
+ question: z.ZodOptional<z.ZodString>;
1256
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
1171
1257
  }, "strip", z.ZodTypeAny, {
1172
1258
  options: string[];
1173
1259
  duration_minutes?: number | undefined;
1260
+ question?: string | undefined;
1261
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1174
1262
  }, {
1175
1263
  options: string[];
1176
1264
  duration_minutes?: number | undefined;
1265
+ question?: string | undefined;
1266
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1177
1267
  }>>;
1178
1268
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
1179
1269
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1217,12 +1307,18 @@ export declare const createPostTool: {
1217
1307
  poll: z.ZodOptional<z.ZodObject<{
1218
1308
  options: z.ZodArray<z.ZodString, "many">;
1219
1309
  duration_minutes: z.ZodOptional<z.ZodNumber>;
1310
+ question: z.ZodOptional<z.ZodString>;
1311
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
1220
1312
  }, "strip", z.ZodTypeAny, {
1221
1313
  options: string[];
1222
1314
  duration_minutes?: number | undefined;
1315
+ question?: string | undefined;
1316
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1223
1317
  }, {
1224
1318
  options: string[];
1225
1319
  duration_minutes?: number | undefined;
1320
+ question?: string | undefined;
1321
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1226
1322
  }>>;
1227
1323
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
1228
1324
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1302,12 +1398,18 @@ export declare const createPostTool: {
1302
1398
  poll: z.ZodOptional<z.ZodObject<{
1303
1399
  options: z.ZodArray<z.ZodString, "many">;
1304
1400
  duration_minutes: z.ZodOptional<z.ZodNumber>;
1401
+ question: z.ZodOptional<z.ZodString>;
1402
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
1305
1403
  }, "strip", z.ZodTypeAny, {
1306
1404
  options: string[];
1307
1405
  duration_minutes?: number | undefined;
1406
+ question?: string | undefined;
1407
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1308
1408
  }, {
1309
1409
  options: string[];
1310
1410
  duration_minutes?: number | undefined;
1411
+ question?: string | undefined;
1412
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1311
1413
  }>>;
1312
1414
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
1313
1415
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1384,12 +1486,18 @@ export declare const createPostTool: {
1384
1486
  poll: z.ZodOptional<z.ZodObject<{
1385
1487
  options: z.ZodArray<z.ZodString, "many">;
1386
1488
  duration_minutes: z.ZodOptional<z.ZodNumber>;
1489
+ question: z.ZodOptional<z.ZodString>;
1490
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
1387
1491
  }, "strip", z.ZodTypeAny, {
1388
1492
  options: string[];
1389
1493
  duration_minutes?: number | undefined;
1494
+ question?: string | undefined;
1495
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1390
1496
  }, {
1391
1497
  options: string[];
1392
1498
  duration_minutes?: number | undefined;
1499
+ question?: string | undefined;
1500
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
1393
1501
  }>>;
1394
1502
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
1395
1503
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -28,7 +28,9 @@ export const platformSettingsSchema = z.object({
28
28
  reply_settings: z.enum(['everyone', 'following', 'mentionedUsers']).optional(),
29
29
  poll: z.object({
30
30
  options: z.array(z.string()),
31
- duration_minutes: z.number().positive().optional(),
31
+ duration_minutes: z.number().positive().optional(), // X poll length in minutes
32
+ question: z.string().optional(), // LinkedIn poll question (required for LinkedIn polls)
33
+ duration: z.enum(['ONE_DAY', 'THREE_DAYS', 'SEVEN_DAYS', 'FOURTEEN_DAYS']).optional(), // LinkedIn poll length
32
34
  }).optional(),
33
35
  // Threads
34
36
  reply_control: z.enum(['everyone', 'accounts_you_follow', 'mentioned_only']).optional(),
@@ -158,7 +160,7 @@ export const createPostTool = {
158
160
  'Provide either account_id OR username+platform to identify the account. If scheduled_at is omitted, the post publishes immediately. If workspace_id is omitted, the server resolves one from the social account, falling back to the caller\'s default (personal) workspace - pass workspace_id explicitly if the user has more than one workspace.\n\n' +
159
161
  'MEDIA URLS: Posterly storage URLs are used as-is. Third-party HTTP(S) media URLs are copied into Posterly storage before the post is saved, so API-created posts do not later fail on expired signed URLs. Short-lived signed URLs must still be live when this tool runs. You can also call `upload_media_from_url` first if you want to upload once and reuse the returned Posterly URL across posts.\n\n' +
160
162
  'THREADS: Pass `thread_posts` (an array of 2+ strings) to schedule a multi-post thread on X (Twitter) or Threads (Meta). The first entry is the lead post; the rest are published as replies in the same chain. X entries are capped at 280 characters each (4000 for verified, 25000 for organization accounts); Threads entries are capped at 500 characters each. When `thread_posts` is set, `caption` is ignored.\n\n' +
161
- 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/playlist, LinkedIn document titles/mentions/video thumbnails, TikTok direct-post privacy/toggles/commercial disclosure, Pinterest post_type (image/video/carousel), board (from pinterest.boards helper), title, link, and cover_image_url (video Pins), GBP event/offer/CTA, X reply settings/polls, Threads reply controls/text attachments, Bluesky languages/alt text, and Instagram feed/story/reel/carousel/collaborators/first comments/trial Reels. `instagram_settings` remains as a backwards-compatible alias.\n\n' +
163
+ 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/playlist, LinkedIn document titles/mentions/polls (poll.question, poll.options 2-4, poll.duration ONE_DAY|THREE_DAYS|SEVEN_DAYS|FOURTEEN_DAYS; text-only)/video thumbnails, TikTok direct-post privacy/toggles/commercial disclosure, Pinterest post_type (image/video/carousel), board (from pinterest.boards helper), title, link, and cover_image_url (video Pins), GBP event/offer/CTA, X reply settings/polls, Threads reply controls/text attachments, Bluesky languages/alt text, and Instagram feed/story/reel/carousel/collaborators/first comments/trial Reels. `instagram_settings` remains as a backwards-compatible alias.\n\n' +
162
164
  'TIKTOK MEDIA: TikTok supports a single video or a photo slideshow of 1 to 35 images, never multiple videos. Image media auto-detects as a slideshow, so you usually do not set post_type or media_type for photos and every image is posted. Pass `platform_settings.media_type: "PHOTO"` to force a slideshow explicitly.',
163
165
  inputSchema: createPostInputSchema,
164
166
  async execute(client, input) {
@@ -100,12 +100,18 @@ export declare const createPostsBatchTool: {
100
100
  poll: z.ZodOptional<z.ZodObject<{
101
101
  options: z.ZodArray<z.ZodString, "many">;
102
102
  duration_minutes: z.ZodOptional<z.ZodNumber>;
103
+ question: z.ZodOptional<z.ZodString>;
104
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
103
105
  }, "strip", z.ZodTypeAny, {
104
106
  options: string[];
105
107
  duration_minutes?: number | undefined;
108
+ question?: string | undefined;
109
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
106
110
  }, {
107
111
  options: string[];
108
112
  duration_minutes?: number | undefined;
113
+ question?: string | undefined;
114
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
109
115
  }>>;
110
116
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
111
117
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -149,12 +155,18 @@ export declare const createPostsBatchTool: {
149
155
  poll: z.ZodOptional<z.ZodObject<{
150
156
  options: z.ZodArray<z.ZodString, "many">;
151
157
  duration_minutes: z.ZodOptional<z.ZodNumber>;
158
+ question: z.ZodOptional<z.ZodString>;
159
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
152
160
  }, "strip", z.ZodTypeAny, {
153
161
  options: string[];
154
162
  duration_minutes?: number | undefined;
163
+ question?: string | undefined;
164
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
155
165
  }, {
156
166
  options: string[];
157
167
  duration_minutes?: number | undefined;
168
+ question?: string | undefined;
169
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
158
170
  }>>;
159
171
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
160
172
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -198,12 +210,18 @@ export declare const createPostsBatchTool: {
198
210
  poll: z.ZodOptional<z.ZodObject<{
199
211
  options: z.ZodArray<z.ZodString, "many">;
200
212
  duration_minutes: z.ZodOptional<z.ZodNumber>;
213
+ question: z.ZodOptional<z.ZodString>;
214
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
201
215
  }, "strip", z.ZodTypeAny, {
202
216
  options: string[];
203
217
  duration_minutes?: number | undefined;
218
+ question?: string | undefined;
219
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
204
220
  }, {
205
221
  options: string[];
206
222
  duration_minutes?: number | undefined;
223
+ question?: string | undefined;
224
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
207
225
  }>>;
208
226
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
209
227
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -280,12 +298,18 @@ export declare const createPostsBatchTool: {
280
298
  poll: z.ZodOptional<z.ZodObject<{
281
299
  options: z.ZodArray<z.ZodString, "many">;
282
300
  duration_minutes: z.ZodOptional<z.ZodNumber>;
301
+ question: z.ZodOptional<z.ZodString>;
302
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
283
303
  }, "strip", z.ZodTypeAny, {
284
304
  options: string[];
285
305
  duration_minutes?: number | undefined;
306
+ question?: string | undefined;
307
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
286
308
  }, {
287
309
  options: string[];
288
310
  duration_minutes?: number | undefined;
311
+ question?: string | undefined;
312
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
289
313
  }>>;
290
314
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
291
315
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -361,12 +385,18 @@ export declare const createPostsBatchTool: {
361
385
  poll: z.ZodOptional<z.ZodObject<{
362
386
  options: z.ZodArray<z.ZodString, "many">;
363
387
  duration_minutes: z.ZodOptional<z.ZodNumber>;
388
+ question: z.ZodOptional<z.ZodString>;
389
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
364
390
  }, "strip", z.ZodTypeAny, {
365
391
  options: string[];
366
392
  duration_minutes?: number | undefined;
393
+ question?: string | undefined;
394
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
367
395
  }, {
368
396
  options: string[];
369
397
  duration_minutes?: number | undefined;
398
+ question?: string | undefined;
399
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
370
400
  }>>;
371
401
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
372
402
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -446,12 +476,18 @@ export declare const createPostsBatchTool: {
446
476
  poll: z.ZodOptional<z.ZodObject<{
447
477
  options: z.ZodArray<z.ZodString, "many">;
448
478
  duration_minutes: z.ZodOptional<z.ZodNumber>;
479
+ question: z.ZodOptional<z.ZodString>;
480
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
449
481
  }, "strip", z.ZodTypeAny, {
450
482
  options: string[];
451
483
  duration_minutes?: number | undefined;
484
+ question?: string | undefined;
485
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
452
486
  }, {
453
487
  options: string[];
454
488
  duration_minutes?: number | undefined;
489
+ question?: string | undefined;
490
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
455
491
  }>>;
456
492
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
457
493
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -530,12 +566,18 @@ export declare const createPostsBatchTool: {
530
566
  poll: z.ZodOptional<z.ZodObject<{
531
567
  options: z.ZodArray<z.ZodString, "many">;
532
568
  duration_minutes: z.ZodOptional<z.ZodNumber>;
569
+ question: z.ZodOptional<z.ZodString>;
570
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
533
571
  }, "strip", z.ZodTypeAny, {
534
572
  options: string[];
535
573
  duration_minutes?: number | undefined;
574
+ question?: string | undefined;
575
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
536
576
  }, {
537
577
  options: string[];
538
578
  duration_minutes?: number | undefined;
579
+ question?: string | undefined;
580
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
539
581
  }>>;
540
582
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
541
583
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient } from '../lib/api-client.js';
3
+ export declare const deleteApiKeyTool: {
4
+ name: string;
5
+ description: string;
6
+ inputSchema: z.ZodObject<{
7
+ key_id: z.ZodString;
8
+ confirm: z.ZodLiteral<true>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ confirm: true;
11
+ key_id: string;
12
+ }, {
13
+ confirm: true;
14
+ key_id: string;
15
+ }>;
16
+ execute(client: PosterlyClient, input: {
17
+ key_id: string;
18
+ confirm: true;
19
+ }): Promise<string>;
20
+ };
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { code, mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
3
+ function formatDeletedApiKey(result) {
4
+ const key = result.api_key;
5
+ return [
6
+ mdTitle(result.already_revoked ? 'API key was already revoked' : 'API key revoked'),
7
+ mdSection('Details', mdKeyValue([
8
+ ['Key ID', code(key.id)],
9
+ ['Name', key.name],
10
+ ['Prefix', code(key.key_prefix)],
11
+ ['Workspace', key.workspace_id ? code(key.workspace_id) : 'all accessible workspaces'],
12
+ ])),
13
+ ].join('\n\n');
14
+ }
15
+ export const deleteApiKeyTool = {
16
+ name: 'delete_api_key',
17
+ description: 'Revoke a Posterly API key owned by the authenticated user. DESTRUCTIVE: call whoami or use a known key ID, show the user the exact key ID/prefix/name if available, and get explicit confirmation before calling. Cannot revoke the key currently authenticating this request, OAuth-issued keys, or managed assistant keys.',
18
+ inputSchema: z.object({
19
+ key_id: z.string().uuid().describe('API key ID to revoke. This is the API key resource ID, not the secret pst_live_ value.'),
20
+ confirm: z.literal(true).describe('Must be true after the user explicitly confirms API key revocation.'),
21
+ }),
22
+ async execute(client, input) {
23
+ const result = await client.deleteApiKey(input.key_id, { confirm: input.confirm });
24
+ return formatDeletedApiKey(result);
25
+ },
26
+ };
@@ -85,12 +85,18 @@ declare const platformSettingsSchema: z.ZodObject<{
85
85
  poll: z.ZodOptional<z.ZodObject<{
86
86
  options: z.ZodArray<z.ZodString, "many">;
87
87
  duration_minutes: z.ZodOptional<z.ZodNumber>;
88
+ question: z.ZodOptional<z.ZodString>;
89
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
88
90
  }, "strip", z.ZodTypeAny, {
89
91
  options: string[];
90
92
  duration_minutes?: number | undefined;
93
+ question?: string | undefined;
94
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
91
95
  }, {
92
96
  options: string[];
93
97
  duration_minutes?: number | undefined;
98
+ question?: string | undefined;
99
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
94
100
  }>>;
95
101
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
96
102
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -133,12 +139,18 @@ declare const platformSettingsSchema: z.ZodObject<{
133
139
  poll: z.ZodOptional<z.ZodObject<{
134
140
  options: z.ZodArray<z.ZodString, "many">;
135
141
  duration_minutes: z.ZodOptional<z.ZodNumber>;
142
+ question: z.ZodOptional<z.ZodString>;
143
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
136
144
  }, "strip", z.ZodTypeAny, {
137
145
  options: string[];
138
146
  duration_minutes?: number | undefined;
147
+ question?: string | undefined;
148
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
139
149
  }, {
140
150
  options: string[];
141
151
  duration_minutes?: number | undefined;
152
+ question?: string | undefined;
153
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
142
154
  }>>;
143
155
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
144
156
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -181,12 +193,18 @@ declare const platformSettingsSchema: z.ZodObject<{
181
193
  poll: z.ZodOptional<z.ZodObject<{
182
194
  options: z.ZodArray<z.ZodString, "many">;
183
195
  duration_minutes: z.ZodOptional<z.ZodNumber>;
196
+ question: z.ZodOptional<z.ZodString>;
197
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
184
198
  }, "strip", z.ZodTypeAny, {
185
199
  options: string[];
186
200
  duration_minutes?: number | undefined;
201
+ question?: string | undefined;
202
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
187
203
  }, {
188
204
  options: string[];
189
205
  duration_minutes?: number | undefined;
206
+ question?: string | undefined;
207
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
190
208
  }>>;
191
209
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
192
210
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -314,12 +332,18 @@ export declare const updatePostTool: {
314
332
  poll: z.ZodOptional<z.ZodObject<{
315
333
  options: z.ZodArray<z.ZodString, "many">;
316
334
  duration_minutes: z.ZodOptional<z.ZodNumber>;
335
+ question: z.ZodOptional<z.ZodString>;
336
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
317
337
  }, "strip", z.ZodTypeAny, {
318
338
  options: string[];
319
339
  duration_minutes?: number | undefined;
340
+ question?: string | undefined;
341
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
320
342
  }, {
321
343
  options: string[];
322
344
  duration_minutes?: number | undefined;
345
+ question?: string | undefined;
346
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
323
347
  }>>;
324
348
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
325
349
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -362,12 +386,18 @@ export declare const updatePostTool: {
362
386
  poll: z.ZodOptional<z.ZodObject<{
363
387
  options: z.ZodArray<z.ZodString, "many">;
364
388
  duration_minutes: z.ZodOptional<z.ZodNumber>;
389
+ question: z.ZodOptional<z.ZodString>;
390
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
365
391
  }, "strip", z.ZodTypeAny, {
366
392
  options: string[];
367
393
  duration_minutes?: number | undefined;
394
+ question?: string | undefined;
395
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
368
396
  }, {
369
397
  options: string[];
370
398
  duration_minutes?: number | undefined;
399
+ question?: string | undefined;
400
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
371
401
  }>>;
372
402
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
373
403
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -410,12 +440,18 @@ export declare const updatePostTool: {
410
440
  poll: z.ZodOptional<z.ZodObject<{
411
441
  options: z.ZodArray<z.ZodString, "many">;
412
442
  duration_minutes: z.ZodOptional<z.ZodNumber>;
443
+ question: z.ZodOptional<z.ZodString>;
444
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
413
445
  }, "strip", z.ZodTypeAny, {
414
446
  options: string[];
415
447
  duration_minutes?: number | undefined;
448
+ question?: string | undefined;
449
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
416
450
  }, {
417
451
  options: string[];
418
452
  duration_minutes?: number | undefined;
453
+ question?: string | undefined;
454
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
419
455
  }>>;
420
456
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
421
457
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -488,12 +524,18 @@ export declare const updatePostTool: {
488
524
  poll: z.ZodOptional<z.ZodObject<{
489
525
  options: z.ZodArray<z.ZodString, "many">;
490
526
  duration_minutes: z.ZodOptional<z.ZodNumber>;
527
+ question: z.ZodOptional<z.ZodString>;
528
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
491
529
  }, "strip", z.ZodTypeAny, {
492
530
  options: string[];
493
531
  duration_minutes?: number | undefined;
532
+ question?: string | undefined;
533
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
494
534
  }, {
495
535
  options: string[];
496
536
  duration_minutes?: number | undefined;
537
+ question?: string | undefined;
538
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
497
539
  }>>;
498
540
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
499
541
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -565,12 +607,18 @@ export declare const updatePostTool: {
565
607
  poll: z.ZodOptional<z.ZodObject<{
566
608
  options: z.ZodArray<z.ZodString, "many">;
567
609
  duration_minutes: z.ZodOptional<z.ZodNumber>;
610
+ question: z.ZodOptional<z.ZodString>;
611
+ duration: z.ZodOptional<z.ZodEnum<["ONE_DAY", "THREE_DAYS", "SEVEN_DAYS", "FOURTEEN_DAYS"]>>;
568
612
  }, "strip", z.ZodTypeAny, {
569
613
  options: string[];
570
614
  duration_minutes?: number | undefined;
615
+ question?: string | undefined;
616
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
571
617
  }, {
572
618
  options: string[];
573
619
  duration_minutes?: number | undefined;
620
+ question?: string | undefined;
621
+ duration?: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS" | undefined;
574
622
  }>>;
575
623
  reply_control: z.ZodOptional<z.ZodEnum<["everyone", "accounts_you_follow", "mentioned_only"]>>;
576
624
  text_attachment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -24,7 +24,7 @@ const platformSettingsSchema = z.object({
24
24
  reel_cover_url: z.string().optional(),
25
25
  reel_thumb_offset: z.number().nonnegative().optional(),
26
26
  reply_settings: z.enum(['everyone', 'following', 'mentionedUsers']).optional(),
27
- poll: z.object({ options: z.array(z.string()), duration_minutes: z.number().positive().optional() }).optional(),
27
+ poll: z.object({ options: z.array(z.string()), duration_minutes: z.number().positive().optional(), question: z.string().optional(), duration: z.enum(['ONE_DAY', 'THREE_DAYS', 'SEVEN_DAYS', 'FOURTEEN_DAYS']).optional() }).optional(),
28
28
  reply_control: z.enum(['everyone', 'accounts_you_follow', 'mentioned_only']).optional(),
29
29
  text_attachment: z.record(z.unknown()).optional(),
30
30
  text_format_preset_id: z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posterly-mcp-server",
3
- "version": "0.20.7",
3
+ "version": "0.21.0",
4
4
  "description": "MCP server for posterly: schedule social media posts from Claude Desktop",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.poster.ly/mcp",
package/src/index.ts CHANGED
@@ -58,6 +58,7 @@ import { getConnectLinkTool } from './tools/get-connect-link.js';
58
58
  import { createConnectSessionTool } from './tools/create-connect-session.js';
59
59
  import { getConnectSessionTool } from './tools/get-connect-session.js';
60
60
  import { createApiKeyTool } from './tools/create-api-key.js';
61
+ import { deleteApiKeyTool } from './tools/delete-api-key.js';
61
62
  import { listOAuthClientsTool } from './tools/list-oauth-clients.js';
62
63
  import { createOAuthClientTool } from './tools/create-oauth-client.js';
63
64
  import { updateOAuthClientTool } from './tools/update-oauth-client.js';
@@ -225,6 +226,20 @@ server.tool(
225
226
  }
226
227
  );
227
228
 
229
+ server.tool(
230
+ deleteApiKeyTool.name,
231
+ deleteApiKeyTool.description,
232
+ deleteApiKeyTool.inputSchema.shape,
233
+ async (input) => {
234
+ try {
235
+ const text = await deleteApiKeyTool.execute(client, input as any);
236
+ return { content: [{ type: 'text' as const, text }] };
237
+ } catch (err: any) {
238
+ return { content: [{ type: 'text' as const, text: `Error: ${err.message}` }], isError: true };
239
+ }
240
+ }
241
+ );
242
+
228
243
  server.tool(
229
244
  listOAuthClientsTool.name,
230
245
  listOAuthClientsTool.description,
@@ -200,6 +200,21 @@ export type CreateApiKeyResponse = {
200
200
  };
201
201
  };
202
202
 
203
+ export type DeleteApiKeyResponse = {
204
+ revoked: true;
205
+ already_revoked: boolean;
206
+ api_key: {
207
+ id: string;
208
+ name: string;
209
+ key_prefix: string;
210
+ scopes: ApiKeyScope[];
211
+ workspace_id?: string | null;
212
+ expires_at?: string | null;
213
+ created_at: string;
214
+ is_revoked?: boolean;
215
+ };
216
+ };
217
+
203
218
  export type AskSupportResponse = {
204
219
  success: boolean;
205
220
  workspace_id: string;
@@ -734,6 +749,10 @@ export class PosterlyClient {
734
749
  return this.request('POST', '/api-keys', data);
735
750
  }
736
751
 
752
+ async deleteApiKey(keyId: string, data: { confirm: true }): Promise<DeleteApiKeyResponse> {
753
+ return this.request('DELETE', `/api-keys/${encodeURIComponent(keyId)}`, data);
754
+ }
755
+
737
756
  async listAccounts(params?: { workspace_id?: string }): Promise<Account[]> {
738
757
  const searchParams = new URLSearchParams();
739
758
  if (params?.workspace_id) searchParams.set('workspace_id', params.workspace_id);
@@ -1 +1 @@
1
- export const POSTERLY_MCP_VERSION = '0.20.7';
1
+ export const POSTERLY_MCP_VERSION = '0.20.8';
@@ -31,7 +31,9 @@ export const platformSettingsSchema = z.object({
31
31
  reply_settings: z.enum(['everyone', 'following', 'mentionedUsers']).optional(),
32
32
  poll: z.object({
33
33
  options: z.array(z.string()),
34
- duration_minutes: z.number().positive().optional(),
34
+ duration_minutes: z.number().positive().optional(), // X poll length in minutes
35
+ question: z.string().optional(), // LinkedIn poll question (required for LinkedIn polls)
36
+ duration: z.enum(['ONE_DAY', 'THREE_DAYS', 'SEVEN_DAYS', 'FOURTEEN_DAYS']).optional(), // LinkedIn poll length
35
37
  }).optional(),
36
38
  // Threads
37
39
  reply_control: z.enum(['everyone', 'accounts_you_follow', 'mentioned_only']).optional(),
@@ -174,7 +176,7 @@ export const createPostTool = {
174
176
  'Provide either account_id OR username+platform to identify the account. If scheduled_at is omitted, the post publishes immediately. If workspace_id is omitted, the server resolves one from the social account, falling back to the caller\'s default (personal) workspace - pass workspace_id explicitly if the user has more than one workspace.\n\n' +
175
177
  'MEDIA URLS: Posterly storage URLs are used as-is. Third-party HTTP(S) media URLs are copied into Posterly storage before the post is saved, so API-created posts do not later fail on expired signed URLs. Short-lived signed URLs must still be live when this tool runs. You can also call `upload_media_from_url` first if you want to upload once and reuse the returned Posterly URL across posts.\n\n' +
176
178
  'THREADS: Pass `thread_posts` (an array of 2+ strings) to schedule a multi-post thread on X (Twitter) or Threads (Meta). The first entry is the lead post; the rest are published as replies in the same chain. X entries are capped at 280 characters each (4000 for verified, 25000 for organization accounts); Threads entries are capped at 500 characters each. When `thread_posts` is set, `caption` is ignored.\n\n' +
177
- 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/playlist, LinkedIn document titles/mentions/video thumbnails, TikTok direct-post privacy/toggles/commercial disclosure, Pinterest post_type (image/video/carousel), board (from pinterest.boards helper), title, link, and cover_image_url (video Pins), GBP event/offer/CTA, X reply settings/polls, Threads reply controls/text attachments, Bluesky languages/alt text, and Instagram feed/story/reel/carousel/collaborators/first comments/trial Reels. `instagram_settings` remains as a backwards-compatible alias.\n\n' +
179
+ 'PLATFORM SETTINGS: Pass `platform_settings` for composer-equivalent controls: Facebook story/reel/backgrounds, YouTube title/privacy/thumbnail/playlist, LinkedIn document titles/mentions/polls (poll.question, poll.options 2-4, poll.duration ONE_DAY|THREE_DAYS|SEVEN_DAYS|FOURTEEN_DAYS; text-only)/video thumbnails, TikTok direct-post privacy/toggles/commercial disclosure, Pinterest post_type (image/video/carousel), board (from pinterest.boards helper), title, link, and cover_image_url (video Pins), GBP event/offer/CTA, X reply settings/polls, Threads reply controls/text attachments, Bluesky languages/alt text, and Instagram feed/story/reel/carousel/collaborators/first comments/trial Reels. `instagram_settings` remains as a backwards-compatible alias.\n\n' +
178
180
  'TIKTOK MEDIA: TikTok supports a single video or a photo slideshow of 1 to 35 images, never multiple videos. Image media auto-detects as a slideshow, so you usually do not set post_type or media_type for photos and every image is posted. Pass `platform_settings.media_type: "PHOTO"` to force a slideshow explicitly.',
179
181
  inputSchema: createPostInputSchema,
180
182
 
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import type { DeleteApiKeyResponse, PosterlyClient } from '../lib/api-client.js';
3
+ import { code, mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
4
+
5
+ function formatDeletedApiKey(result: DeleteApiKeyResponse): string {
6
+ const key = result.api_key;
7
+ return [
8
+ mdTitle(result.already_revoked ? 'API key was already revoked' : 'API key revoked'),
9
+ mdSection('Details', mdKeyValue([
10
+ ['Key ID', code(key.id)],
11
+ ['Name', key.name],
12
+ ['Prefix', code(key.key_prefix)],
13
+ ['Workspace', key.workspace_id ? code(key.workspace_id) : 'all accessible workspaces'],
14
+ ])),
15
+ ].join('\n\n');
16
+ }
17
+
18
+ export const deleteApiKeyTool = {
19
+ name: 'delete_api_key',
20
+ description:
21
+ 'Revoke a Posterly API key owned by the authenticated user. DESTRUCTIVE: call whoami or use a known key ID, show the user the exact key ID/prefix/name if available, and get explicit confirmation before calling. Cannot revoke the key currently authenticating this request, OAuth-issued keys, or managed assistant keys.',
22
+ inputSchema: z.object({
23
+ key_id: z.string().uuid().describe('API key ID to revoke. This is the API key resource ID, not the secret pst_live_ value.'),
24
+ confirm: z.literal(true).describe('Must be true after the user explicitly confirms API key revocation.'),
25
+ }),
26
+
27
+ async execute(client: PosterlyClient, input: { key_id: string; confirm: true }) {
28
+ const result = await client.deleteApiKey(input.key_id, { confirm: input.confirm });
29
+ return formatDeletedApiKey(result);
30
+ },
31
+ };
@@ -27,7 +27,7 @@ const platformSettingsSchema = z.object({
27
27
  reel_cover_url: z.string().optional(),
28
28
  reel_thumb_offset: z.number().nonnegative().optional(),
29
29
  reply_settings: z.enum(['everyone', 'following', 'mentionedUsers']).optional(),
30
- poll: z.object({ options: z.array(z.string()), duration_minutes: z.number().positive().optional() }).optional(),
30
+ poll: z.object({ options: z.array(z.string()), duration_minutes: z.number().positive().optional(), question: z.string().optional(), duration: z.enum(['ONE_DAY', 'THREE_DAYS', 'SEVEN_DAYS', 'FOURTEEN_DAYS']).optional() }).optional(),
31
31
  reply_control: z.enum(['everyone', 'accounts_you_follow', 'mentioned_only']).optional(),
32
32
  text_attachment: z.record(z.unknown()).optional(),
33
33
  text_format_preset_id: z.string().optional(),