posterly-mcp-server 0.52.2 → 0.53.1
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 +11 -5
- package/dist/index.js +2 -0
- package/dist/lib/api-client.d.ts +119 -0
- package/dist/lib/api-client.js +8 -0
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/tools/create-post.d.ts +22 -22
- package/dist/tools/create-posts-batch.d.ts +8 -8
- package/dist/tools/downgrade-subscription.js +3 -3
- package/dist/tools/get-subscription.js +69 -5
- package/dist/tools/manage-extra-account.d.ts +48 -0
- package/dist/tools/manage-extra-account.js +161 -0
- package/dist/tools/manage-workspace-member.d.ts +2 -2
- package/dist/tools/update-post.d.ts +10 -10
- package/dist/tools/validate-post.d.ts +12 -12
- package/package.json +1 -1
- package/server.json +2 -2
- package/tool-annotations.json +6 -2
- package/tool-registry.json +41 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ Add the same server definition to your Cursor MCP settings:
|
|
|
123
123
|
|
|
124
124
|
## Available tools
|
|
125
125
|
|
|
126
|
-
`posterly-mcp-server@0.
|
|
126
|
+
`posterly-mcp-server@0.53.1` exposes 65 tools covering 101 actions. The hosted HTTP endpoint exposes the same catalog minus the three signup tools: 62 tools covering 98 actions.
|
|
127
127
|
|
|
128
128
|
Many tools pick what to do with one parameter: `view` (reads), `action` (writes), or `type`. A few pick their mode from which parameters you pass (for example `update_post` with `status` changes the status instead of editing). Every tool description names all of its views and actions.
|
|
129
129
|
|
|
@@ -373,16 +373,22 @@ API keys, OAuth clients, webhooks, workspace members, and the publishing pause.
|
|
|
373
373
|
|
|
374
374
|
### Billing (`billing`)
|
|
375
375
|
|
|
376
|
-
Subscription changes.
|
|
376
|
+
Subscription changes and Agency extra accounts.
|
|
377
377
|
|
|
378
378
|
| Tool | What it does |
|
|
379
379
|
| --- | --- |
|
|
380
|
-
| `get_subscription` | Subscription |
|
|
380
|
+
| `get_subscription` | Subscription, plans above yours with prices, extra accounts (Agency owners) and the exact next steps |
|
|
381
381
|
| `cancel_subscription` | Cancel subscription |
|
|
382
382
|
| `pause_subscription` | Pause subscription |
|
|
383
383
|
| `resume_subscription` | Resume subscription |
|
|
384
384
|
| `downgrade_subscription` | Downgrade subscription |
|
|
385
385
|
|
|
386
|
+
**`manage_extra_account`**: Buy or remove extra accounts
|
|
387
|
+
|
|
388
|
+
| Action | What it does |
|
|
389
|
+
| --- | --- |
|
|
390
|
+
| `set` | Set extra accounts: quote the exact charge, then buy, raise, lower, or remove them after `confirm: true` with the `preview_id` (preview then confirm) |
|
|
391
|
+
|
|
386
392
|
### Signup (`signup`)
|
|
387
393
|
|
|
388
394
|
Pre-auth signup for brand-new users. Local npm package only; always on.
|
|
@@ -492,7 +498,7 @@ This package uses the posterly API/MCP add-on:
|
|
|
492
498
|
- user-created API keys per plan: Starter 1, Pro 2, Power 3, Agency 4
|
|
493
499
|
- works across all 18 supported platforms: Instagram, Facebook, TikTok, X, LinkedIn, YouTube, Pinterest, Threads, Google Business, Telegram, Bluesky, Discord, Slack, Mastodon, Dev.to, Hashnode, WordPress, and Lemmy
|
|
494
500
|
|
|
495
|
-
Each API call counts as one request, so use `create_posts_batch` when you need to schedule multiple posts in one confirmed operation.
|
|
501
|
+
Each API call counts as one request, so use `create_posts_batch` when you need to schedule multiple posts in one confirmed operation. A batch signed upload (`create_signed_upload` with `files`) counts one point per file against the media upload limit.
|
|
496
502
|
|
|
497
503
|
Details: [poster.ly/dashboard/api](https://www.poster.ly/dashboard/api)
|
|
498
504
|
|
|
@@ -537,6 +543,6 @@ The package reads:
|
|
|
537
543
|
|
|
538
544
|
The optional directory profile provides 52 tools over HTTP or 55 tools over local stdio for social publishing, existing-media uploads, analytics, and inbox work. AI image and video generation, generation-job helpers, billing mutations, and legacy tool aliases are unavailable in this profile. Text caption suggestions and read-only subscription information remain available. Tool descriptions are functional summaries; input schemas retain their validation constraints.
|
|
539
545
|
|
|
540
|
-
Hosted endpoint: `https://www.poster.ly/api/mcp?profile=claude`. For local stdio, set `POSTERLY_DIRECTORY_PROFILE=claude` alongside the existing API key. The default catalogs remain
|
|
546
|
+
Hosted endpoint: `https://www.poster.ly/api/mcp?profile=claude`. For local stdio, set `POSTERLY_DIRECTORY_PROFILE=claude` alongside the existing API key. The default catalogs remain 62 hosted tools and 65 local tools. This profile does not grant authorization, bypass scopes, or change the existing preview and confirmation checks.
|
|
541
547
|
|
|
542
548
|
Directory approval remains Anthropic's decision. This profile addresses the generation and financial-transaction restrictions in the [Anthropic Software Directory Policy](https://support.claude.com/en/articles/13145358-anthropic-software-directory-policy).
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ import { cancelSubscriptionTool } from './tools/cancel-subscription.js';
|
|
|
30
30
|
import { pauseSubscriptionTool } from './tools/pause-subscription.js';
|
|
31
31
|
import { resumeSubscriptionTool } from './tools/resume-subscription.js';
|
|
32
32
|
import { downgradeSubscriptionTool } from './tools/downgrade-subscription.js';
|
|
33
|
+
import { manageExtraAccountTool } from './tools/manage-extra-account.js';
|
|
33
34
|
import { listOAuthClientsTool } from './tools/list-oauth-clients.js';
|
|
34
35
|
import { manageOAuthClientTool } from './tools/manage-oauth-client.js';
|
|
35
36
|
import { listPlatformsTool } from './tools/list-platforms.js';
|
|
@@ -100,6 +101,7 @@ const STDIO_TOOLS = [
|
|
|
100
101
|
pauseSubscriptionTool,
|
|
101
102
|
resumeSubscriptionTool,
|
|
102
103
|
downgradeSubscriptionTool,
|
|
104
|
+
manageExtraAccountTool,
|
|
103
105
|
listOAuthClientsTool,
|
|
104
106
|
manageOAuthClientTool,
|
|
105
107
|
listPlatformsTool,
|
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -600,6 +600,34 @@ export type SubscriptionSummary = {
|
|
|
600
600
|
paused_at: string | null;
|
|
601
601
|
pause_resumes_at: string | null;
|
|
602
602
|
stripe_subscription_id: string | null;
|
|
603
|
+
/** Connected accounts for the workspace this caller is acting in. */
|
|
604
|
+
accounts?: {
|
|
605
|
+
workspace_id: string | null;
|
|
606
|
+
used: number;
|
|
607
|
+
limit: number;
|
|
608
|
+
} | null;
|
|
609
|
+
/** The plans above this user's, with real prices, limits and credits. */
|
|
610
|
+
upgrade_options?: SubscriptionUpgradeOption[];
|
|
611
|
+
/** What to do next for this user's tier and status. */
|
|
612
|
+
next_steps?: SubscriptionNextStep[];
|
|
613
|
+
/** Where plan changes are made (no tool upgrades a plan). */
|
|
614
|
+
billing_url?: string;
|
|
615
|
+
/** Agency workspace owners only. Same body as GET /subscription/extra-accounts. */
|
|
616
|
+
extra_accounts?: ExtraAccountsStateResponse;
|
|
617
|
+
};
|
|
618
|
+
export type SubscriptionUpgradeOption = {
|
|
619
|
+
tier: SubscriptionTierName;
|
|
620
|
+
name: string;
|
|
621
|
+
monthly_price: number;
|
|
622
|
+
yearly_price: number;
|
|
623
|
+
max_accounts: number;
|
|
624
|
+
included_credits: number;
|
|
625
|
+
};
|
|
626
|
+
export type SubscriptionNextStep = {
|
|
627
|
+
id: string;
|
|
628
|
+
text: string;
|
|
629
|
+
tool?: string;
|
|
630
|
+
params?: Record<string, unknown>;
|
|
603
631
|
};
|
|
604
632
|
export type SubscriptionSummaryResponse = {
|
|
605
633
|
subscription: SubscriptionSummary;
|
|
@@ -646,6 +674,83 @@ export type DowngradeSubscriptionResponse = {
|
|
|
646
674
|
success: true;
|
|
647
675
|
tier: SubscriptionTierName;
|
|
648
676
|
};
|
|
677
|
+
export type ExtraAccountsPaymentPending = {
|
|
678
|
+
hosted_invoice_url: string | null;
|
|
679
|
+
requested_extra_accounts: number;
|
|
680
|
+
amount_due_cents: number | null;
|
|
681
|
+
expires_at: string | null;
|
|
682
|
+
};
|
|
683
|
+
export type ExtraAccountsStateResponse = {
|
|
684
|
+
eligible: boolean;
|
|
685
|
+
code: string | null;
|
|
686
|
+
reason: string | null;
|
|
687
|
+
trialing: boolean;
|
|
688
|
+
interval: 'month' | 'year' | null;
|
|
689
|
+
included_accounts: number;
|
|
690
|
+
admin_granted_accounts: number;
|
|
691
|
+
paid_extra_accounts: number;
|
|
692
|
+
account_limit: number;
|
|
693
|
+
accounts_in_use: number;
|
|
694
|
+
highest_accounts_in_use: number;
|
|
695
|
+
min_paid_extra_accounts: number;
|
|
696
|
+
min_purchase: number;
|
|
697
|
+
price_per_account_cents: number | null;
|
|
698
|
+
price_per_account: string | null;
|
|
699
|
+
recurring_cents: number | null;
|
|
700
|
+
payment_pending: ExtraAccountsPaymentPending | null;
|
|
701
|
+
};
|
|
702
|
+
export type ExtraAccountsQuote = {
|
|
703
|
+
kind: 'none' | 'increase' | 'decrease' | 'remove';
|
|
704
|
+
current_extra_accounts: number;
|
|
705
|
+
new_extra_accounts: number;
|
|
706
|
+
change: number;
|
|
707
|
+
included_accounts: number;
|
|
708
|
+
account_limit_after: number;
|
|
709
|
+
accounts_in_use: number;
|
|
710
|
+
interval: 'month' | 'year';
|
|
711
|
+
trialing: boolean;
|
|
712
|
+
price_per_account_cents: number;
|
|
713
|
+
current_recurring_cents: number;
|
|
714
|
+
new_recurring_cents: number;
|
|
715
|
+
new_recurring: string;
|
|
716
|
+
charge_today_cents: number;
|
|
717
|
+
charge_today: string;
|
|
718
|
+
currency: string;
|
|
719
|
+
};
|
|
720
|
+
export type ExtraAccountsQuoteResponse = {
|
|
721
|
+
dry_run: true;
|
|
722
|
+
quote: ExtraAccountsQuote;
|
|
723
|
+
};
|
|
724
|
+
export type ExtraAccountsAppliedResponse = {
|
|
725
|
+
applied: true;
|
|
726
|
+
status: 'applied' | 'unchanged';
|
|
727
|
+
kind: ExtraAccountsQuote['kind'];
|
|
728
|
+
previous_extra_accounts: number;
|
|
729
|
+
extra_accounts: number;
|
|
730
|
+
included_accounts: number;
|
|
731
|
+
account_limit: number;
|
|
732
|
+
accounts_in_use: number;
|
|
733
|
+
interval: 'month' | 'year';
|
|
734
|
+
price_per_account_cents: number;
|
|
735
|
+
recurring_cents: number;
|
|
736
|
+
};
|
|
737
|
+
export type ExtraAccountsPaymentRequiredResponse = {
|
|
738
|
+
applied: false;
|
|
739
|
+
status: 'payment_required';
|
|
740
|
+
payment_required: true;
|
|
741
|
+
message: string;
|
|
742
|
+
hosted_invoice_url: string | null;
|
|
743
|
+
payment_pending: ExtraAccountsPaymentPending;
|
|
744
|
+
kind: ExtraAccountsQuote['kind'];
|
|
745
|
+
previous_extra_accounts: number;
|
|
746
|
+
requested_extra_accounts: number;
|
|
747
|
+
included_accounts: number;
|
|
748
|
+
account_limit_after_payment: number;
|
|
749
|
+
interval: 'month' | 'year';
|
|
750
|
+
price_per_account_cents: number;
|
|
751
|
+
recurring_cents: number;
|
|
752
|
+
};
|
|
753
|
+
export type ExtraAccountsChangeResponse = ExtraAccountsAppliedResponse | ExtraAccountsPaymentRequiredResponse;
|
|
649
754
|
export type AskSupportResponse = {
|
|
650
755
|
success: boolean;
|
|
651
756
|
workspace_id: string;
|
|
@@ -1341,6 +1446,20 @@ export declare class PosterlyClient {
|
|
|
1341
1446
|
downgradeSubscription(data: {
|
|
1342
1447
|
tier?: SubscriptionTierName;
|
|
1343
1448
|
}): Promise<DowngradeSubscriptionResponse>;
|
|
1449
|
+
/** Exact price of a change; charges nothing. */
|
|
1450
|
+
quoteExtraAccounts(data: {
|
|
1451
|
+
extra_accounts: number;
|
|
1452
|
+
workspace_id?: string;
|
|
1453
|
+
}): Promise<ExtraAccountsQuoteResponse>;
|
|
1454
|
+
/** Applies the change and charges the saved card. Only call after a quote was shown and approved. */
|
|
1455
|
+
setExtraAccounts(data: {
|
|
1456
|
+
extra_accounts: number;
|
|
1457
|
+
request_id?: string;
|
|
1458
|
+
workspace_id?: string;
|
|
1459
|
+
/** What the quote was based on; the API answers 409 quote_stale when the live values differ. */
|
|
1460
|
+
expected_current_extra_accounts?: number;
|
|
1461
|
+
expected_interval?: 'month' | 'year';
|
|
1462
|
+
}): Promise<ExtraAccountsChangeResponse>;
|
|
1344
1463
|
listAccounts(params?: {
|
|
1345
1464
|
workspace_id?: string;
|
|
1346
1465
|
}): Promise<Account[]>;
|
package/dist/lib/api-client.js
CHANGED
|
@@ -264,6 +264,14 @@ export class PosterlyClient {
|
|
|
264
264
|
async downgradeSubscription(data) {
|
|
265
265
|
return this.request('POST', '/subscription/downgrade', data);
|
|
266
266
|
}
|
|
267
|
+
/** Exact price of a change; charges nothing. */
|
|
268
|
+
async quoteExtraAccounts(data) {
|
|
269
|
+
return this.request('POST', '/subscription/extra-accounts', { ...data, dry_run: true });
|
|
270
|
+
}
|
|
271
|
+
/** Applies the change and charges the saved card. Only call after a quote was shown and approved. */
|
|
272
|
+
async setExtraAccounts(data) {
|
|
273
|
+
return this.request('POST', '/subscription/extra-accounts', data);
|
|
274
|
+
}
|
|
267
275
|
async listAccounts(params) {
|
|
268
276
|
const searchParams = new URLSearchParams();
|
|
269
277
|
if (params?.workspace_id)
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const POSTERLY_MCP_VERSION = "0.
|
|
1
|
+
export declare const POSTERLY_MCP_VERSION = "0.53.1";
|
package/dist/lib/version.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
// tool set (minus the intentional pre-auth signup tools that only this stdio
|
|
6
6
|
// package exposes). `npm run check:mcp-parity` enforces both the version match
|
|
7
7
|
// and the tool-list match, and runs in the pre-commit hook.
|
|
8
|
-
export const POSTERLY_MCP_VERSION = '0.
|
|
8
|
+
export const POSTERLY_MCP_VERSION = '0.53.1';
|
|
@@ -78,9 +78,9 @@ export declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
78
78
|
option_d?: string | undefined;
|
|
79
79
|
}>>;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
81
82
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
82
83
|
options?: string[] | undefined;
|
|
83
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
84
84
|
extended_duration?: boolean | undefined;
|
|
85
85
|
poll_attachment?: {
|
|
86
86
|
options?: string[] | undefined;
|
|
@@ -90,9 +90,9 @@ export declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
90
90
|
option_d?: string | undefined;
|
|
91
91
|
} | undefined;
|
|
92
92
|
}, {
|
|
93
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
93
94
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
94
95
|
options?: string[] | undefined;
|
|
95
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
96
96
|
extended_duration?: boolean | undefined;
|
|
97
97
|
poll_attachment?: {
|
|
98
98
|
options?: string[] | undefined;
|
|
@@ -158,9 +158,9 @@ export declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
158
158
|
option_d?: string | undefined;
|
|
159
159
|
} | undefined;
|
|
160
160
|
caption_addon?: {
|
|
161
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
161
162
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
162
163
|
options?: string[] | undefined;
|
|
163
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
164
164
|
extended_duration?: boolean | undefined;
|
|
165
165
|
poll_attachment?: {
|
|
166
166
|
options?: string[] | undefined;
|
|
@@ -207,9 +207,9 @@ export declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
207
207
|
option_d?: string | undefined;
|
|
208
208
|
} | undefined;
|
|
209
209
|
caption_addon?: {
|
|
210
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
210
211
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
211
212
|
options?: string[] | undefined;
|
|
212
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
213
213
|
extended_duration?: boolean | undefined;
|
|
214
214
|
poll_attachment?: {
|
|
215
215
|
options?: string[] | undefined;
|
|
@@ -758,9 +758,9 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
|
|
|
758
758
|
option_d?: string | undefined;
|
|
759
759
|
}>>;
|
|
760
760
|
}, "strip", z.ZodTypeAny, {
|
|
761
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
761
762
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
762
763
|
options?: string[] | undefined;
|
|
763
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
764
764
|
extended_duration?: boolean | undefined;
|
|
765
765
|
poll_attachment?: {
|
|
766
766
|
options?: string[] | undefined;
|
|
@@ -770,9 +770,9 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
|
|
|
770
770
|
option_d?: string | undefined;
|
|
771
771
|
} | undefined;
|
|
772
772
|
}, {
|
|
773
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
773
774
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
774
775
|
options?: string[] | undefined;
|
|
775
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
776
776
|
extended_duration?: boolean | undefined;
|
|
777
777
|
poll_attachment?: {
|
|
778
778
|
options?: string[] | undefined;
|
|
@@ -838,9 +838,9 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
|
|
|
838
838
|
option_d?: string | undefined;
|
|
839
839
|
} | undefined;
|
|
840
840
|
caption_addon?: {
|
|
841
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
841
842
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
842
843
|
options?: string[] | undefined;
|
|
843
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
844
844
|
extended_duration?: boolean | undefined;
|
|
845
845
|
poll_attachment?: {
|
|
846
846
|
options?: string[] | undefined;
|
|
@@ -887,9 +887,9 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
|
|
|
887
887
|
option_d?: string | undefined;
|
|
888
888
|
} | undefined;
|
|
889
889
|
caption_addon?: {
|
|
890
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
890
891
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
891
892
|
options?: string[] | undefined;
|
|
892
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
893
893
|
extended_duration?: boolean | undefined;
|
|
894
894
|
poll_attachment?: {
|
|
895
895
|
options?: string[] | undefined;
|
|
@@ -1397,9 +1397,9 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
|
|
|
1397
1397
|
option_d?: string | undefined;
|
|
1398
1398
|
} | undefined;
|
|
1399
1399
|
caption_addon?: {
|
|
1400
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1400
1401
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1401
1402
|
options?: string[] | undefined;
|
|
1402
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1403
1403
|
extended_duration?: boolean | undefined;
|
|
1404
1404
|
poll_attachment?: {
|
|
1405
1405
|
options?: string[] | undefined;
|
|
@@ -1608,9 +1608,9 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
|
|
|
1608
1608
|
option_d?: string | undefined;
|
|
1609
1609
|
} | undefined;
|
|
1610
1610
|
caption_addon?: {
|
|
1611
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1611
1612
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1612
1613
|
options?: string[] | undefined;
|
|
1613
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1614
1614
|
extended_duration?: boolean | undefined;
|
|
1615
1615
|
poll_attachment?: {
|
|
1616
1616
|
options?: string[] | undefined;
|
|
@@ -1862,9 +1862,9 @@ export declare const createPostInputSchema: z.ZodObject<{
|
|
|
1862
1862
|
option_d?: string | undefined;
|
|
1863
1863
|
}>>;
|
|
1864
1864
|
}, "strip", z.ZodTypeAny, {
|
|
1865
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1865
1866
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1866
1867
|
options?: string[] | undefined;
|
|
1867
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1868
1868
|
extended_duration?: boolean | undefined;
|
|
1869
1869
|
poll_attachment?: {
|
|
1870
1870
|
options?: string[] | undefined;
|
|
@@ -1874,9 +1874,9 @@ export declare const createPostInputSchema: z.ZodObject<{
|
|
|
1874
1874
|
option_d?: string | undefined;
|
|
1875
1875
|
} | undefined;
|
|
1876
1876
|
}, {
|
|
1877
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1877
1878
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1878
1879
|
options?: string[] | undefined;
|
|
1879
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1880
1880
|
extended_duration?: boolean | undefined;
|
|
1881
1881
|
poll_attachment?: {
|
|
1882
1882
|
options?: string[] | undefined;
|
|
@@ -1942,9 +1942,9 @@ export declare const createPostInputSchema: z.ZodObject<{
|
|
|
1942
1942
|
option_d?: string | undefined;
|
|
1943
1943
|
} | undefined;
|
|
1944
1944
|
caption_addon?: {
|
|
1945
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1945
1946
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1946
1947
|
options?: string[] | undefined;
|
|
1947
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1948
1948
|
extended_duration?: boolean | undefined;
|
|
1949
1949
|
poll_attachment?: {
|
|
1950
1950
|
options?: string[] | undefined;
|
|
@@ -1991,9 +1991,9 @@ export declare const createPostInputSchema: z.ZodObject<{
|
|
|
1991
1991
|
option_d?: string | undefined;
|
|
1992
1992
|
} | undefined;
|
|
1993
1993
|
caption_addon?: {
|
|
1994
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1994
1995
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1995
1996
|
options?: string[] | undefined;
|
|
1996
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1997
1997
|
extended_duration?: boolean | undefined;
|
|
1998
1998
|
poll_attachment?: {
|
|
1999
1999
|
options?: string[] | undefined;
|
|
@@ -2504,9 +2504,9 @@ export declare const createPostInputSchema: z.ZodObject<{
|
|
|
2504
2504
|
option_d?: string | undefined;
|
|
2505
2505
|
} | undefined;
|
|
2506
2506
|
caption_addon?: {
|
|
2507
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2507
2508
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2508
2509
|
options?: string[] | undefined;
|
|
2509
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2510
2510
|
extended_duration?: boolean | undefined;
|
|
2511
2511
|
poll_attachment?: {
|
|
2512
2512
|
options?: string[] | undefined;
|
|
@@ -2716,9 +2716,9 @@ export declare const createPostInputSchema: z.ZodObject<{
|
|
|
2716
2716
|
option_d?: string | undefined;
|
|
2717
2717
|
} | undefined;
|
|
2718
2718
|
caption_addon?: {
|
|
2719
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2719
2720
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2720
2721
|
options?: string[] | undefined;
|
|
2721
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2722
2722
|
extended_duration?: boolean | undefined;
|
|
2723
2723
|
poll_attachment?: {
|
|
2724
2724
|
options?: string[] | undefined;
|
|
@@ -2999,9 +2999,9 @@ export declare const createPostTool: {
|
|
|
2999
2999
|
option_d?: string | undefined;
|
|
3000
3000
|
}>>;
|
|
3001
3001
|
}, "strip", z.ZodTypeAny, {
|
|
3002
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3002
3003
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3003
3004
|
options?: string[] | undefined;
|
|
3004
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3005
3005
|
extended_duration?: boolean | undefined;
|
|
3006
3006
|
poll_attachment?: {
|
|
3007
3007
|
options?: string[] | undefined;
|
|
@@ -3011,9 +3011,9 @@ export declare const createPostTool: {
|
|
|
3011
3011
|
option_d?: string | undefined;
|
|
3012
3012
|
} | undefined;
|
|
3013
3013
|
}, {
|
|
3014
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3014
3015
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3015
3016
|
options?: string[] | undefined;
|
|
3016
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3017
3017
|
extended_duration?: boolean | undefined;
|
|
3018
3018
|
poll_attachment?: {
|
|
3019
3019
|
options?: string[] | undefined;
|
|
@@ -3079,9 +3079,9 @@ export declare const createPostTool: {
|
|
|
3079
3079
|
option_d?: string | undefined;
|
|
3080
3080
|
} | undefined;
|
|
3081
3081
|
caption_addon?: {
|
|
3082
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3082
3083
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3083
3084
|
options?: string[] | undefined;
|
|
3084
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3085
3085
|
extended_duration?: boolean | undefined;
|
|
3086
3086
|
poll_attachment?: {
|
|
3087
3087
|
options?: string[] | undefined;
|
|
@@ -3128,9 +3128,9 @@ export declare const createPostTool: {
|
|
|
3128
3128
|
option_d?: string | undefined;
|
|
3129
3129
|
} | undefined;
|
|
3130
3130
|
caption_addon?: {
|
|
3131
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3131
3132
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3132
3133
|
options?: string[] | undefined;
|
|
3133
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3134
3134
|
extended_duration?: boolean | undefined;
|
|
3135
3135
|
poll_attachment?: {
|
|
3136
3136
|
options?: string[] | undefined;
|
|
@@ -3641,9 +3641,9 @@ export declare const createPostTool: {
|
|
|
3641
3641
|
option_d?: string | undefined;
|
|
3642
3642
|
} | undefined;
|
|
3643
3643
|
caption_addon?: {
|
|
3644
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3644
3645
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3645
3646
|
options?: string[] | undefined;
|
|
3646
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3647
3647
|
extended_duration?: boolean | undefined;
|
|
3648
3648
|
poll_attachment?: {
|
|
3649
3649
|
options?: string[] | undefined;
|
|
@@ -3853,9 +3853,9 @@ export declare const createPostTool: {
|
|
|
3853
3853
|
option_d?: string | undefined;
|
|
3854
3854
|
} | undefined;
|
|
3855
3855
|
caption_addon?: {
|
|
3856
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3856
3857
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3857
3858
|
options?: string[] | undefined;
|
|
3858
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
3859
3859
|
extended_duration?: boolean | undefined;
|
|
3860
3860
|
poll_attachment?: {
|
|
3861
3861
|
options?: string[] | undefined;
|
|
@@ -93,9 +93,9 @@ export declare const createPostsBatchTool: {
|
|
|
93
93
|
option_d?: string | undefined;
|
|
94
94
|
}>>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
96
97
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
97
98
|
options?: string[] | undefined;
|
|
98
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
99
99
|
extended_duration?: boolean | undefined;
|
|
100
100
|
poll_attachment?: {
|
|
101
101
|
options?: string[] | undefined;
|
|
@@ -105,9 +105,9 @@ export declare const createPostsBatchTool: {
|
|
|
105
105
|
option_d?: string | undefined;
|
|
106
106
|
} | undefined;
|
|
107
107
|
}, {
|
|
108
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
108
109
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
109
110
|
options?: string[] | undefined;
|
|
110
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
111
111
|
extended_duration?: boolean | undefined;
|
|
112
112
|
poll_attachment?: {
|
|
113
113
|
options?: string[] | undefined;
|
|
@@ -173,9 +173,9 @@ export declare const createPostsBatchTool: {
|
|
|
173
173
|
option_d?: string | undefined;
|
|
174
174
|
} | undefined;
|
|
175
175
|
caption_addon?: {
|
|
176
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
176
177
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
177
178
|
options?: string[] | undefined;
|
|
178
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
179
179
|
extended_duration?: boolean | undefined;
|
|
180
180
|
poll_attachment?: {
|
|
181
181
|
options?: string[] | undefined;
|
|
@@ -222,9 +222,9 @@ export declare const createPostsBatchTool: {
|
|
|
222
222
|
option_d?: string | undefined;
|
|
223
223
|
} | undefined;
|
|
224
224
|
caption_addon?: {
|
|
225
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
225
226
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
226
227
|
options?: string[] | undefined;
|
|
227
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
228
228
|
extended_duration?: boolean | undefined;
|
|
229
229
|
poll_attachment?: {
|
|
230
230
|
options?: string[] | undefined;
|
|
@@ -732,9 +732,9 @@ export declare const createPostsBatchTool: {
|
|
|
732
732
|
option_d?: string | undefined;
|
|
733
733
|
} | undefined;
|
|
734
734
|
caption_addon?: {
|
|
735
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
735
736
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
736
737
|
options?: string[] | undefined;
|
|
737
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
738
738
|
extended_duration?: boolean | undefined;
|
|
739
739
|
poll_attachment?: {
|
|
740
740
|
options?: string[] | undefined;
|
|
@@ -943,9 +943,9 @@ export declare const createPostsBatchTool: {
|
|
|
943
943
|
option_d?: string | undefined;
|
|
944
944
|
} | undefined;
|
|
945
945
|
caption_addon?: {
|
|
946
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
946
947
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
947
948
|
options?: string[] | undefined;
|
|
948
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
949
949
|
extended_duration?: boolean | undefined;
|
|
950
950
|
poll_attachment?: {
|
|
951
951
|
options?: string[] | undefined;
|
|
@@ -1158,9 +1158,9 @@ export declare const createPostsBatchTool: {
|
|
|
1158
1158
|
option_d?: string | undefined;
|
|
1159
1159
|
} | undefined;
|
|
1160
1160
|
caption_addon?: {
|
|
1161
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1161
1162
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1162
1163
|
options?: string[] | undefined;
|
|
1163
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1164
1164
|
extended_duration?: boolean | undefined;
|
|
1165
1165
|
poll_attachment?: {
|
|
1166
1166
|
options?: string[] | undefined;
|
|
@@ -1372,9 +1372,9 @@ export declare const createPostsBatchTool: {
|
|
|
1372
1372
|
option_d?: string | undefined;
|
|
1373
1373
|
} | undefined;
|
|
1374
1374
|
caption_addon?: {
|
|
1375
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1375
1376
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1376
1377
|
options?: string[] | undefined;
|
|
1377
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1378
1378
|
extended_duration?: boolean | undefined;
|
|
1379
1379
|
poll_attachment?: {
|
|
1380
1380
|
options?: string[] | undefined;
|
|
@@ -3,15 +3,15 @@ import { mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
|
|
|
3
3
|
const TIER_VALUES = ['starter', 'pro', 'power_user', 'agency'];
|
|
4
4
|
function formatDowngraded(result) {
|
|
5
5
|
return [
|
|
6
|
-
mdTitle('Subscription
|
|
6
|
+
mdTitle('Subscription downgraded'),
|
|
7
7
|
mdSection('Details', mdKeyValue([
|
|
8
|
-
['New tier
|
|
8
|
+
['New tier (limits apply now, lower price from the next renewal)', result.tier],
|
|
9
9
|
])),
|
|
10
10
|
].join('\n\n');
|
|
11
11
|
}
|
|
12
12
|
export const downgradeSubscriptionTool = {
|
|
13
13
|
name: 'downgrade_subscription',
|
|
14
|
-
description: "
|
|
14
|
+
description: "Move the subscription down one tier (or to an explicit lower `tier`) now: the lower limits and credits apply right away, the lower price starts at the next renewal, and the rest of the current period is not refunded. Strictly downward only. Requires billing:write. Only call after the user explicitly confirms.",
|
|
15
15
|
inputSchema: z.object({
|
|
16
16
|
tier: z.enum(TIER_VALUES).optional().describe('Optional explicit target tier. Omit to drop one tier automatically.'),
|
|
17
17
|
confirm: z.literal(true).describe('Must be true after the user explicitly confirms the downgrade.'),
|
|
@@ -1,7 +1,55 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { formatDateTime, mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
|
|
3
|
-
|
|
2
|
+
import { formatDateTime, mdBullets, mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
|
|
3
|
+
import { formatExtraAccountsPaymentPending, intervalWord, usdFromCents } from './manage-extra-account.js';
|
|
4
|
+
function formatConnectedAccounts(accounts) {
|
|
5
|
+
if (!accounts || typeof accounts.limit !== 'number' || !Number.isFinite(accounts.limit))
|
|
6
|
+
return null;
|
|
7
|
+
const used = typeof accounts.used === 'number' && Number.isFinite(accounts.used)
|
|
8
|
+
? Math.max(0, Math.floor(accounts.used))
|
|
9
|
+
: 0;
|
|
10
|
+
if (accounts.limit < 0)
|
|
11
|
+
return `${used} of unlimited`;
|
|
12
|
+
return `${used} of ${accounts.limit}`;
|
|
13
|
+
}
|
|
14
|
+
/** The Agency extra-accounts block (owner only). Same wording as the hosted endpoint. */
|
|
15
|
+
function formatExtraAccountsSection(state, directoryProfile = false) {
|
|
16
|
+
const word = intervalWord(state.interval);
|
|
17
|
+
const price = state.price_per_account_cents === null || state.price_per_account_cents === undefined
|
|
18
|
+
? 'n/a'
|
|
19
|
+
: `${usdFromCents(state.price_per_account_cents)} per extra account per ${word}`;
|
|
20
|
+
const rows = [
|
|
21
|
+
['Included with Agency', state.included_accounts],
|
|
22
|
+
['Granted by posterly', state.admin_granted_accounts],
|
|
23
|
+
['Paid extra accounts', state.paid_extra_accounts],
|
|
24
|
+
['Account limit', state.account_limit],
|
|
25
|
+
['Connected accounts in use', state.accounts_in_use],
|
|
26
|
+
];
|
|
27
|
+
if (!directoryProfile)
|
|
28
|
+
rows.push(['Price', price]);
|
|
29
|
+
rows.push(['Current extra accounts cost', state.recurring_cents === null || state.recurring_cents === undefined ? 'n/a' : `${usdFromCents(state.recurring_cents)} per ${word}`]);
|
|
30
|
+
if (!directoryProfile) {
|
|
31
|
+
rows.push(['Minimum purchase', `${state.min_purchase} accounts at a time, no maximum`]);
|
|
32
|
+
rows.push(['Lowest total you can set now', state.min_paid_extra_accounts]);
|
|
33
|
+
}
|
|
34
|
+
rows.push(['On a trial', state.trialing ? 'yes, no charge until the trial ends' : 'no']);
|
|
35
|
+
if (!directoryProfile) {
|
|
36
|
+
rows.push(['Can change now', state.eligible
|
|
37
|
+
? 'yes, with manage_extra_account'
|
|
38
|
+
: `no (${state.code || 'not eligible'}). ${state.reason || 'Extra accounts are not available for this subscription right now.'}`]);
|
|
39
|
+
}
|
|
40
|
+
return mdSection('Extra accounts', mdKeyValue(rows));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* `directoryProfile` is the Claude directory profile: its catalog has no
|
|
44
|
+
* billing mutations, so the output is facts only (no tool names, no offers,
|
|
45
|
+
* no money steps) plus one line pointing at the billing page.
|
|
46
|
+
*/
|
|
47
|
+
function formatSubscription(result, options_) {
|
|
4
48
|
const sub = result.subscription;
|
|
49
|
+
const connectedAccounts = formatConnectedAccounts(sub.accounts);
|
|
50
|
+
const directoryProfile = options_?.directoryProfile === true;
|
|
51
|
+
const options = directoryProfile ? [] : Array.isArray(sub.upgrade_options) ? sub.upgrade_options : [];
|
|
52
|
+
const steps = directoryProfile ? [] : Array.isArray(sub.next_steps) ? sub.next_steps : [];
|
|
5
53
|
return [
|
|
6
54
|
mdTitle('posterly subscription'),
|
|
7
55
|
mdSection('Details', mdKeyValue([
|
|
@@ -12,15 +60,31 @@ function formatSubscription(result) {
|
|
|
12
60
|
['Trial ends', sub.trial_ends_at ? formatDateTime(sub.trial_ends_at) : 'n/a'],
|
|
13
61
|
['Paused at', sub.paused_at ? formatDateTime(sub.paused_at) : 'n/a'],
|
|
14
62
|
['Pause resumes at', sub.pause_resumes_at ? formatDateTime(sub.pause_resumes_at) : 'n/a'],
|
|
63
|
+
...(connectedAccounts ? [['Connected accounts', connectedAccounts]] : []),
|
|
15
64
|
])),
|
|
16
|
-
|
|
65
|
+
sub.extra_accounts ? formatExtraAccountsSection(sub.extra_accounts, directoryProfile) : '',
|
|
66
|
+
sub.extra_accounts?.payment_pending ? formatExtraAccountsPaymentPending(sub.extra_accounts.payment_pending) : '',
|
|
67
|
+
directoryProfile
|
|
68
|
+
? `Plan and billing changes are made on the billing page: ${typeof sub.billing_url === 'string' && sub.billing_url ? sub.billing_url : 'https://www.poster.ly/dashboard/account/billing'}`
|
|
69
|
+
: '',
|
|
70
|
+
options.length
|
|
71
|
+
? mdSection('Plans you can move to', mdBullets(options.map((o) => `${o.name}: $${o.monthly_price}/month or $${o.yearly_price}/year, ${o.max_accounts} connected accounts, ${o.included_credits} AI credits a month`)))
|
|
72
|
+
: '',
|
|
73
|
+
steps.length
|
|
74
|
+
? mdSection('Next steps', steps.map((step, index) => [
|
|
75
|
+
`${index + 1}. ${step.text}`,
|
|
76
|
+
step.tool ? ` Tool: ${step.tool}${step.params ? ` ${JSON.stringify(step.params)}` : ''}` : '',
|
|
77
|
+
].filter(Boolean).join('\n')).join('\n'))
|
|
78
|
+
: '',
|
|
79
|
+
].filter(Boolean).join('\n\n');
|
|
17
80
|
}
|
|
18
81
|
export const getSubscriptionTool = {
|
|
19
82
|
name: 'get_subscription',
|
|
20
|
-
description: "Get the authenticated user's posterly subscription: status, tier, cancel-at-period-end,
|
|
83
|
+
description: "Get the authenticated user's posterly subscription: status, tier, cancel-at-period-end, period end, trial end and pause state. Also reports connected accounts in use and the account limit for the workspace this caller is acting in (plan tier plus any extra slots). Call this FIRST for \"upgrade\", \"change plan\", \"add accounts\" or \"how many accounts\": it returns the plans above this user's with prices, limits and credits, the Agency extra-accounts state (owners), and the exact next steps, ending at the billing page. Read-only. Requires the billing:read scope.",
|
|
21
84
|
inputSchema: z.object({}),
|
|
22
85
|
async execute(client) {
|
|
23
86
|
const result = await client.getSubscription();
|
|
24
|
-
|
|
87
|
+
// Same switch index.ts uses to drop the billing mutations from the catalog.
|
|
88
|
+
return formatSubscription(result, { directoryProfile: process.env.POSTERLY_DIRECTORY_PROFILE === 'claude' });
|
|
25
89
|
},
|
|
26
90
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ExtraAccountsPaymentPending, ExtraAccountsQuote, PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
import { type ToolContext } from '../lib/tool-runtime.js';
|
|
4
|
+
export declare function usdFromCents(cents: number | null | undefined): string;
|
|
5
|
+
export declare function intervalWord(interval: unknown): string;
|
|
6
|
+
/** Same wording as the hosted endpoint (lib/mcp/http-tools.ts). */
|
|
7
|
+
export declare function formatExtraAccountsPaymentPending(pending: ExtraAccountsPaymentPending | null | undefined): string;
|
|
8
|
+
export declare function formatExtraAccountsQuote(q: ExtraAccountsQuote): string;
|
|
9
|
+
type ManageExtraAccountInput = {
|
|
10
|
+
action: 'set';
|
|
11
|
+
extra_accounts: number;
|
|
12
|
+
workspace_id?: string;
|
|
13
|
+
expected_current_extra_accounts?: number;
|
|
14
|
+
expected_interval?: 'month' | 'year';
|
|
15
|
+
confirm?: boolean;
|
|
16
|
+
preview_id?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const manageExtraAccountTool: {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
inputSchema: z.ZodObject<{
|
|
22
|
+
action: z.ZodEnum<["set"]>;
|
|
23
|
+
extra_accounts: z.ZodNumber;
|
|
24
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
25
|
+
expected_current_extra_accounts: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
expected_interval: z.ZodOptional<z.ZodEnum<["month", "year"]>>;
|
|
27
|
+
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
preview_id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
action: "set";
|
|
31
|
+
extra_accounts: number;
|
|
32
|
+
workspace_id?: string | undefined;
|
|
33
|
+
confirm?: boolean | undefined;
|
|
34
|
+
preview_id?: string | undefined;
|
|
35
|
+
expected_current_extra_accounts?: number | undefined;
|
|
36
|
+
expected_interval?: "month" | "year" | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
action: "set";
|
|
39
|
+
extra_accounts: number;
|
|
40
|
+
workspace_id?: string | undefined;
|
|
41
|
+
confirm?: boolean | undefined;
|
|
42
|
+
preview_id?: string | undefined;
|
|
43
|
+
expected_current_extra_accounts?: number | undefined;
|
|
44
|
+
expected_interval?: "month" | "year" | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
execute(client: PosterlyClient, input: ManageExtraAccountInput, ctx: ToolContext): Promise<string>;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { formatDateTime, mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
|
|
4
|
+
import { previewThenConfirm, readForPreview, validateArgs } from '../lib/tool-runtime.js';
|
|
5
|
+
export function usdFromCents(cents) {
|
|
6
|
+
const n = typeof cents === 'number' && Number.isFinite(cents) ? Math.round(cents) : 0;
|
|
7
|
+
return `$${(n / 100).toFixed(2)}`;
|
|
8
|
+
}
|
|
9
|
+
export function intervalWord(interval) {
|
|
10
|
+
return interval === 'year' ? 'year' : 'month';
|
|
11
|
+
}
|
|
12
|
+
/** Same wording as the hosted endpoint (lib/mcp/http-tools.ts). */
|
|
13
|
+
export function formatExtraAccountsPaymentPending(pending) {
|
|
14
|
+
if (!pending)
|
|
15
|
+
return '';
|
|
16
|
+
return mdSection('Payment waiting', [
|
|
17
|
+
mdKeyValue([
|
|
18
|
+
['Requested extra accounts', pending.requested_extra_accounts],
|
|
19
|
+
['Amount due', pending.amount_due_cents === null || pending.amount_due_cents === undefined ? 'n/a' : usdFromCents(pending.amount_due_cents)],
|
|
20
|
+
['Expires', pending.expires_at ? formatDateTime(pending.expires_at) : 'n/a'],
|
|
21
|
+
['Payment link', pending.hosted_invoice_url || 'not available, finish it in Billing'],
|
|
22
|
+
]),
|
|
23
|
+
'Nothing has been added yet. The accounts apply automatically once this invoice is paid. Until then posterly will not accept another change.',
|
|
24
|
+
].join('\n\n'));
|
|
25
|
+
}
|
|
26
|
+
export function formatExtraAccountsQuote(q) {
|
|
27
|
+
const word = intervalWord(q.interval);
|
|
28
|
+
const verb = q.kind === 'none' ? 'No change' : q.kind === 'increase' ? 'Add accounts' : q.kind === 'remove' ? 'Remove all extra accounts' : 'Lower extra accounts';
|
|
29
|
+
const chargeLine = q.kind === 'increase'
|
|
30
|
+
? (q.trialing
|
|
31
|
+
? 'Nothing is charged today because the subscription is on a trial. Billing starts when the trial ends.'
|
|
32
|
+
: `The saved card on file is charged ${q.charge_today || usdFromCents(q.charge_today_cents)} today (prorated for the rest of this billing period) when this is confirmed. If the card needs confirmation or declines, nothing is added and a payment link is returned instead.`)
|
|
33
|
+
: q.kind === 'none'
|
|
34
|
+
? 'Nothing changes and nothing is charged.'
|
|
35
|
+
: 'Nothing is charged and nothing is refunded for the rest of this billing period. The lower limit applies right away.';
|
|
36
|
+
return [
|
|
37
|
+
mdSection(verb, mdKeyValue([
|
|
38
|
+
['Extra accounts now', q.current_extra_accounts],
|
|
39
|
+
['Extra accounts after', q.new_extra_accounts],
|
|
40
|
+
['Account limit after', q.account_limit_after],
|
|
41
|
+
['Connected accounts in use', q.accounts_in_use],
|
|
42
|
+
['Charge today', q.kind === 'increase' ? (q.trialing ? '$0.00 (trial)' : q.charge_today || usdFromCents(q.charge_today_cents)) : '$0.00'],
|
|
43
|
+
['New recurring cost', `${q.new_recurring || usdFromCents(q.new_recurring_cents)} per ${word} for ${q.new_extra_accounts} extra accounts (${usdFromCents(q.price_per_account_cents)} each)`],
|
|
44
|
+
])),
|
|
45
|
+
chargeLine,
|
|
46
|
+
].join('\n\n');
|
|
47
|
+
}
|
|
48
|
+
export const manageExtraAccountTool = {
|
|
49
|
+
name: 'manage_extra_account',
|
|
50
|
+
description: 'Buy, raise, lower, or remove Agency extra-account slots. MONEY: raising charges the saved card. Owner only; billing:write. action=set (extra_accounts = desired TOTAL, 0 removes all; add 20+ at a time). Call without confirm for the quote and preview_id; after the user agrees, call with confirm=true, that preview_id and the expected_ fields from the quote. 3D Secure or a decline returns a payment link; nothing is added.',
|
|
51
|
+
inputSchema: z.object({
|
|
52
|
+
action: z.enum(['set']),
|
|
53
|
+
extra_accounts: z.number().int().min(0),
|
|
54
|
+
workspace_id: z.string().optional(),
|
|
55
|
+
expected_current_extra_accounts: z.number().int().min(0).optional(),
|
|
56
|
+
expected_interval: z.enum(['month', 'year']).optional(),
|
|
57
|
+
confirm: z.boolean().optional(),
|
|
58
|
+
preview_id: z.string().optional(),
|
|
59
|
+
}),
|
|
60
|
+
async execute(client, input, ctx) {
|
|
61
|
+
const { args } = validateArgs(ctx, 'manage_extra_account', input);
|
|
62
|
+
const call = args;
|
|
63
|
+
const workspace = call.workspace_id ? { workspace_id: call.workspace_id } : {};
|
|
64
|
+
// A preview is only issued for a change posterly can actually make: price
|
|
65
|
+
// it first, and answer a failed quote with an error and NO preview_id. The
|
|
66
|
+
// quote's current total and interval are pinned into the previewed args,
|
|
67
|
+
// so the confirm must repeat them and the API refuses a stale quote.
|
|
68
|
+
let quote = null;
|
|
69
|
+
let previewArgs = args;
|
|
70
|
+
if (call.confirm !== true) {
|
|
71
|
+
const read = await readForPreview(() => client.quoteExtraAccounts({ extra_accounts: call.extra_accounts, ...workspace }));
|
|
72
|
+
if (!read.ok) {
|
|
73
|
+
throw new Error([
|
|
74
|
+
'No preview: this change cannot be made right now.',
|
|
75
|
+
read.error,
|
|
76
|
+
'Nothing was changed and no preview_id was issued. Tell the user why, and fix the cause first (for example disconnect accounts, finish the pending payment, or pick at least 20 more than the current total).',
|
|
77
|
+
].join('\n\n'));
|
|
78
|
+
}
|
|
79
|
+
quote = read.data.quote;
|
|
80
|
+
previewArgs = {
|
|
81
|
+
...args,
|
|
82
|
+
expected_current_extra_accounts: quote.current_extra_accounts,
|
|
83
|
+
expected_interval: quote.interval,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return previewThenConfirm({
|
|
87
|
+
tool: 'manage_extra_account',
|
|
88
|
+
action: 'set',
|
|
89
|
+
args: previewArgs,
|
|
90
|
+
nonce: true,
|
|
91
|
+
legacyRefusal: 'Refusing to change extra accounts without confirm=true after explicit user confirmation.',
|
|
92
|
+
ctx,
|
|
93
|
+
describe: async () => [
|
|
94
|
+
formatExtraAccountsQuote(quote),
|
|
95
|
+
quote.kind === 'none' ? '' : 'Only confirm after the user has seen the price and agreed. The change is billed to the saved card, not to anything the user types here.',
|
|
96
|
+
mdSection('Fields to repeat on confirm', mdKeyValue([
|
|
97
|
+
['extra_accounts', quote.new_extra_accounts],
|
|
98
|
+
['expected_current_extra_accounts', quote.current_extra_accounts],
|
|
99
|
+
['expected_interval', quote.interval],
|
|
100
|
+
])),
|
|
101
|
+
].filter(Boolean).join('\n\n'),
|
|
102
|
+
run: async () => {
|
|
103
|
+
if (typeof call.expected_current_extra_accounts !== 'number' || !call.expected_interval) {
|
|
104
|
+
throw new Error('Confirm needs expected_current_extra_accounts and expected_interval from the preview. Get a new preview.');
|
|
105
|
+
}
|
|
106
|
+
// The same preview_id always maps to the same request_id, so a replayed
|
|
107
|
+
// confirm can never buy twice.
|
|
108
|
+
const requestId = typeof call.preview_id === 'string' && call.preview_id
|
|
109
|
+
? `mcp-${createHash('sha256').update(call.preview_id).digest('hex').slice(0, 40)}`
|
|
110
|
+
: undefined;
|
|
111
|
+
const result = await client.setExtraAccounts({
|
|
112
|
+
extra_accounts: call.extra_accounts,
|
|
113
|
+
expected_current_extra_accounts: call.expected_current_extra_accounts,
|
|
114
|
+
expected_interval: call.expected_interval,
|
|
115
|
+
...(requestId ? { request_id: requestId } : {}),
|
|
116
|
+
...workspace,
|
|
117
|
+
});
|
|
118
|
+
return formatExtraAccountsResult(result);
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
function formatExtraAccountsResult(d) {
|
|
124
|
+
if (d.status === 'payment_required') {
|
|
125
|
+
return [
|
|
126
|
+
mdTitle('Payment needed: nothing was added yet'),
|
|
127
|
+
'The saved card needs confirmation (3D Secure) or was declined, so posterly did not add the accounts. Send the user to the payment link. The accounts apply automatically once it is paid.',
|
|
128
|
+
mdKeyValue([
|
|
129
|
+
['Requested extra accounts', d.requested_extra_accounts],
|
|
130
|
+
['Account limit once paid', d.account_limit_after_payment],
|
|
131
|
+
['Amount due', d.payment_pending?.amount_due_cents === null || d.payment_pending?.amount_due_cents === undefined ? 'n/a' : usdFromCents(d.payment_pending.amount_due_cents)],
|
|
132
|
+
['Link expires', d.payment_pending?.expires_at ? formatDateTime(d.payment_pending.expires_at) : 'n/a'],
|
|
133
|
+
['Payment link', d.hosted_invoice_url || 'not available, ask the user to finish it in Billing'],
|
|
134
|
+
]),
|
|
135
|
+
'Call get_subscription afterwards to confirm the new limit.',
|
|
136
|
+
].join('\n\n');
|
|
137
|
+
}
|
|
138
|
+
if (d.status === 'unchanged') {
|
|
139
|
+
return [
|
|
140
|
+
mdTitle('No change needed'),
|
|
141
|
+
`The workspace already has ${d.extra_accounts} extra accounts. The account limit is ${d.account_limit}.`,
|
|
142
|
+
].join('\n\n');
|
|
143
|
+
}
|
|
144
|
+
const word = intervalWord(d.interval);
|
|
145
|
+
const headline = d.extra_accounts === 0
|
|
146
|
+
? 'Removed all extra accounts'
|
|
147
|
+
: d.kind === 'increase'
|
|
148
|
+
? `Added ${d.extra_accounts - d.previous_extra_accounts} extra accounts`
|
|
149
|
+
: `Lowered extra accounts to ${d.extra_accounts}`;
|
|
150
|
+
return [
|
|
151
|
+
mdTitle(headline),
|
|
152
|
+
`The account limit is now ${d.account_limit}.`,
|
|
153
|
+
mdKeyValue([
|
|
154
|
+
['Extra accounts', `${d.previous_extra_accounts} to ${d.extra_accounts}`],
|
|
155
|
+
['Included with Agency', d.included_accounts],
|
|
156
|
+
['Connected accounts in use', d.accounts_in_use],
|
|
157
|
+
['Recurring cost', `${usdFromCents(d.recurring_cents)} per ${word} (${usdFromCents(d.price_per_account_cents)} per extra account)`],
|
|
158
|
+
]),
|
|
159
|
+
d.kind === 'increase' ? 'The prorated amount was charged to the saved card.' : '',
|
|
160
|
+
].filter(Boolean).join('\n\n');
|
|
161
|
+
}
|
|
@@ -33,7 +33,7 @@ export declare const manageWorkspaceMemberTool: {
|
|
|
33
33
|
preview_id: z.ZodOptional<z.ZodString>;
|
|
34
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
35
|
workspace_id: string;
|
|
36
|
-
action: "
|
|
36
|
+
action: "remove" | "invite" | "update";
|
|
37
37
|
confirm?: boolean | undefined;
|
|
38
38
|
preview_id?: string | undefined;
|
|
39
39
|
email?: string | undefined;
|
|
@@ -45,7 +45,7 @@ export declare const manageWorkspaceMemberTool: {
|
|
|
45
45
|
api_access?: boolean | undefined;
|
|
46
46
|
}, {
|
|
47
47
|
workspace_id: string;
|
|
48
|
-
action: "
|
|
48
|
+
action: "remove" | "invite" | "update";
|
|
49
49
|
confirm?: boolean | undefined;
|
|
50
50
|
preview_id?: string | undefined;
|
|
51
51
|
email?: string | undefined;
|
|
@@ -80,9 +80,9 @@ declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
80
80
|
option_d?: string | undefined;
|
|
81
81
|
}>>;
|
|
82
82
|
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
83
84
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
84
85
|
options?: string[] | undefined;
|
|
85
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
86
86
|
extended_duration?: boolean | undefined;
|
|
87
87
|
poll_attachment?: {
|
|
88
88
|
options?: string[] | undefined;
|
|
@@ -92,9 +92,9 @@ declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
92
92
|
option_d?: string | undefined;
|
|
93
93
|
} | undefined;
|
|
94
94
|
}, {
|
|
95
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
95
96
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
96
97
|
options?: string[] | undefined;
|
|
97
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
98
98
|
extended_duration?: boolean | undefined;
|
|
99
99
|
poll_attachment?: {
|
|
100
100
|
options?: string[] | undefined;
|
|
@@ -161,9 +161,9 @@ declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
161
161
|
option_d?: string | undefined;
|
|
162
162
|
} | undefined;
|
|
163
163
|
caption_addon?: {
|
|
164
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
164
165
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
165
166
|
options?: string[] | undefined;
|
|
166
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
167
167
|
extended_duration?: boolean | undefined;
|
|
168
168
|
poll_attachment?: {
|
|
169
169
|
options?: string[] | undefined;
|
|
@@ -211,9 +211,9 @@ declare const instagramSettingsSchema: z.ZodObject<{
|
|
|
211
211
|
option_d?: string | undefined;
|
|
212
212
|
} | undefined;
|
|
213
213
|
caption_addon?: {
|
|
214
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
214
215
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
215
216
|
options?: string[] | undefined;
|
|
216
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
217
217
|
extended_duration?: boolean | undefined;
|
|
218
218
|
poll_attachment?: {
|
|
219
219
|
options?: string[] | undefined;
|
|
@@ -785,9 +785,9 @@ export declare const updatePostTool: {
|
|
|
785
785
|
option_d?: string | undefined;
|
|
786
786
|
}>>;
|
|
787
787
|
}, "strip", z.ZodTypeAny, {
|
|
788
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
788
789
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
789
790
|
options?: string[] | undefined;
|
|
790
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
791
791
|
extended_duration?: boolean | undefined;
|
|
792
792
|
poll_attachment?: {
|
|
793
793
|
options?: string[] | undefined;
|
|
@@ -797,9 +797,9 @@ export declare const updatePostTool: {
|
|
|
797
797
|
option_d?: string | undefined;
|
|
798
798
|
} | undefined;
|
|
799
799
|
}, {
|
|
800
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
800
801
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
801
802
|
options?: string[] | undefined;
|
|
802
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
803
803
|
extended_duration?: boolean | undefined;
|
|
804
804
|
poll_attachment?: {
|
|
805
805
|
options?: string[] | undefined;
|
|
@@ -866,9 +866,9 @@ export declare const updatePostTool: {
|
|
|
866
866
|
option_d?: string | undefined;
|
|
867
867
|
} | undefined;
|
|
868
868
|
caption_addon?: {
|
|
869
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
869
870
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
870
871
|
options?: string[] | undefined;
|
|
871
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
872
872
|
extended_duration?: boolean | undefined;
|
|
873
873
|
poll_attachment?: {
|
|
874
874
|
options?: string[] | undefined;
|
|
@@ -916,9 +916,9 @@ export declare const updatePostTool: {
|
|
|
916
916
|
option_d?: string | undefined;
|
|
917
917
|
} | undefined;
|
|
918
918
|
caption_addon?: {
|
|
919
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
919
920
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
920
921
|
options?: string[] | undefined;
|
|
921
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
922
922
|
extended_duration?: boolean | undefined;
|
|
923
923
|
poll_attachment?: {
|
|
924
924
|
options?: string[] | undefined;
|
|
@@ -1434,9 +1434,9 @@ export declare const updatePostTool: {
|
|
|
1434
1434
|
option_d?: string | undefined;
|
|
1435
1435
|
} | undefined;
|
|
1436
1436
|
caption_addon?: {
|
|
1437
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1437
1438
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1438
1439
|
options?: string[] | undefined;
|
|
1439
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1440
1440
|
extended_duration?: boolean | undefined;
|
|
1441
1441
|
poll_attachment?: {
|
|
1442
1442
|
options?: string[] | undefined;
|
|
@@ -1652,9 +1652,9 @@ export declare const updatePostTool: {
|
|
|
1652
1652
|
option_d?: string | undefined;
|
|
1653
1653
|
} | undefined;
|
|
1654
1654
|
caption_addon?: {
|
|
1655
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1655
1656
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1656
1657
|
options?: string[] | undefined;
|
|
1657
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1658
1658
|
extended_duration?: boolean | undefined;
|
|
1659
1659
|
poll_attachment?: {
|
|
1660
1660
|
options?: string[] | undefined;
|
|
@@ -88,9 +88,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
|
|
|
88
88
|
option_d?: string | undefined;
|
|
89
89
|
}>>;
|
|
90
90
|
}, "strip", import("zod").ZodTypeAny, {
|
|
91
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
91
92
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
92
93
|
options?: string[] | undefined;
|
|
93
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
94
94
|
extended_duration?: boolean | undefined;
|
|
95
95
|
poll_attachment?: {
|
|
96
96
|
options?: string[] | undefined;
|
|
@@ -100,9 +100,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
|
|
|
100
100
|
option_d?: string | undefined;
|
|
101
101
|
} | undefined;
|
|
102
102
|
}, {
|
|
103
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
103
104
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
104
105
|
options?: string[] | undefined;
|
|
105
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
106
106
|
extended_duration?: boolean | undefined;
|
|
107
107
|
poll_attachment?: {
|
|
108
108
|
options?: string[] | undefined;
|
|
@@ -168,9 +168,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
|
|
|
168
168
|
option_d?: string | undefined;
|
|
169
169
|
} | undefined;
|
|
170
170
|
caption_addon?: {
|
|
171
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
171
172
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
172
173
|
options?: string[] | undefined;
|
|
173
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
174
174
|
extended_duration?: boolean | undefined;
|
|
175
175
|
poll_attachment?: {
|
|
176
176
|
options?: string[] | undefined;
|
|
@@ -217,9 +217,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
|
|
|
217
217
|
option_d?: string | undefined;
|
|
218
218
|
} | undefined;
|
|
219
219
|
caption_addon?: {
|
|
220
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
220
221
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
221
222
|
options?: string[] | undefined;
|
|
222
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
223
223
|
extended_duration?: boolean | undefined;
|
|
224
224
|
poll_attachment?: {
|
|
225
225
|
options?: string[] | undefined;
|
|
@@ -727,9 +727,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
|
|
|
727
727
|
option_d?: string | undefined;
|
|
728
728
|
} | undefined;
|
|
729
729
|
caption_addon?: {
|
|
730
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
730
731
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
731
732
|
options?: string[] | undefined;
|
|
732
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
733
733
|
extended_duration?: boolean | undefined;
|
|
734
734
|
poll_attachment?: {
|
|
735
735
|
options?: string[] | undefined;
|
|
@@ -938,9 +938,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
|
|
|
938
938
|
option_d?: string | undefined;
|
|
939
939
|
} | undefined;
|
|
940
940
|
caption_addon?: {
|
|
941
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
941
942
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
942
943
|
options?: string[] | undefined;
|
|
943
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
944
944
|
extended_duration?: boolean | undefined;
|
|
945
945
|
poll_attachment?: {
|
|
946
946
|
options?: string[] | undefined;
|
|
@@ -1196,9 +1196,9 @@ export declare const validatePostTool: {
|
|
|
1196
1196
|
option_d?: string | undefined;
|
|
1197
1197
|
}>>;
|
|
1198
1198
|
}, "strip", import("zod").ZodTypeAny, {
|
|
1199
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1199
1200
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1200
1201
|
options?: string[] | undefined;
|
|
1201
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1202
1202
|
extended_duration?: boolean | undefined;
|
|
1203
1203
|
poll_attachment?: {
|
|
1204
1204
|
options?: string[] | undefined;
|
|
@@ -1208,9 +1208,9 @@ export declare const validatePostTool: {
|
|
|
1208
1208
|
option_d?: string | undefined;
|
|
1209
1209
|
} | undefined;
|
|
1210
1210
|
}, {
|
|
1211
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1211
1212
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1212
1213
|
options?: string[] | undefined;
|
|
1213
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1214
1214
|
extended_duration?: boolean | undefined;
|
|
1215
1215
|
poll_attachment?: {
|
|
1216
1216
|
options?: string[] | undefined;
|
|
@@ -1276,9 +1276,9 @@ export declare const validatePostTool: {
|
|
|
1276
1276
|
option_d?: string | undefined;
|
|
1277
1277
|
} | undefined;
|
|
1278
1278
|
caption_addon?: {
|
|
1279
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1279
1280
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1280
1281
|
options?: string[] | undefined;
|
|
1281
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1282
1282
|
extended_duration?: boolean | undefined;
|
|
1283
1283
|
poll_attachment?: {
|
|
1284
1284
|
options?: string[] | undefined;
|
|
@@ -1325,9 +1325,9 @@ export declare const validatePostTool: {
|
|
|
1325
1325
|
option_d?: string | undefined;
|
|
1326
1326
|
} | undefined;
|
|
1327
1327
|
caption_addon?: {
|
|
1328
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1328
1329
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1329
1330
|
options?: string[] | undefined;
|
|
1330
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1331
1331
|
extended_duration?: boolean | undefined;
|
|
1332
1332
|
poll_attachment?: {
|
|
1333
1333
|
options?: string[] | undefined;
|
|
@@ -1835,9 +1835,9 @@ export declare const validatePostTool: {
|
|
|
1835
1835
|
option_d?: string | undefined;
|
|
1836
1836
|
} | undefined;
|
|
1837
1837
|
caption_addon?: {
|
|
1838
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1838
1839
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1839
1840
|
options?: string[] | undefined;
|
|
1840
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
1841
1841
|
extended_duration?: boolean | undefined;
|
|
1842
1842
|
poll_attachment?: {
|
|
1843
1843
|
options?: string[] | undefined;
|
|
@@ -2046,9 +2046,9 @@ export declare const validatePostTool: {
|
|
|
2046
2046
|
option_d?: string | undefined;
|
|
2047
2047
|
} | undefined;
|
|
2048
2048
|
caption_addon?: {
|
|
2049
|
+
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2049
2050
|
type?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2050
2051
|
options?: string[] | undefined;
|
|
2051
|
-
kind?: "none" | "poll" | "comment_prompt" | undefined;
|
|
2052
2052
|
extended_duration?: boolean | undefined;
|
|
2053
2053
|
poll_attachment?: {
|
|
2054
2054
|
options?: string[] | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "posterly-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.1",
|
|
4
4
|
"mcpName": "io.github.awpthorp/posterly",
|
|
5
5
|
"description": "MCP server for posterly: schedule and publish social media posts across 18 platforms from any MCP client (Claude, ChatGPT, Cursor, Windsurf, Cline, and more)",
|
|
6
6
|
"license": "MIT",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.awpthorp/posterly",
|
|
4
4
|
"title": "posterly",
|
|
5
5
|
"description": "Validate, schedule, publish, and analyze social content across 18 platforms with posterly.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.53.1",
|
|
7
7
|
"websiteUrl": "https://www.poster.ly/mcp",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/awpthorp/posterly-mcp-server",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "posterly-mcp-server",
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.53.1",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|
package/tool-annotations.json
CHANGED
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"pause_subscription",
|
|
64
64
|
"resume_subscription",
|
|
65
65
|
"downgrade_subscription",
|
|
66
|
+
"manage_extra_account",
|
|
66
67
|
"get_updates"
|
|
67
68
|
],
|
|
68
69
|
"readOnlyTools": [
|
|
@@ -113,7 +114,8 @@
|
|
|
113
114
|
"cancel_subscription",
|
|
114
115
|
"manage_publishing_pause",
|
|
115
116
|
"pause_subscription",
|
|
116
|
-
"downgrade_subscription"
|
|
117
|
+
"downgrade_subscription",
|
|
118
|
+
"manage_extra_account"
|
|
117
119
|
],
|
|
118
120
|
"idempotentMutationTools": [
|
|
119
121
|
"delete_api_key",
|
|
@@ -125,7 +127,8 @@
|
|
|
125
127
|
"cancel_subscription",
|
|
126
128
|
"pause_subscription",
|
|
127
129
|
"resume_subscription",
|
|
128
|
-
"downgrade_subscription"
|
|
130
|
+
"downgrade_subscription",
|
|
131
|
+
"manage_extra_account"
|
|
129
132
|
],
|
|
130
133
|
"openWorldTools": [
|
|
131
134
|
"start_signup",
|
|
@@ -168,6 +171,7 @@
|
|
|
168
171
|
"pause_subscription",
|
|
169
172
|
"resume_subscription",
|
|
170
173
|
"downgrade_subscription",
|
|
174
|
+
"manage_extra_account",
|
|
171
175
|
"delete_post",
|
|
172
176
|
"submit_product_feedback"
|
|
173
177
|
]
|
package/tool-registry.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"billing": {
|
|
32
32
|
"label": "Billing",
|
|
33
|
-
"description": "Subscription changes."
|
|
33
|
+
"description": "Subscription changes and Agency extra accounts."
|
|
34
34
|
},
|
|
35
35
|
"signup": {
|
|
36
36
|
"label": "Signup",
|
|
@@ -1981,6 +1981,46 @@
|
|
|
1981
1981
|
"openWorld": true,
|
|
1982
1982
|
"confirm": "confirm"
|
|
1983
1983
|
},
|
|
1984
|
+
"manage_extra_account": {
|
|
1985
|
+
"set": "billing",
|
|
1986
|
+
"label": "Buy or remove extra accounts",
|
|
1987
|
+
"exception": {
|
|
1988
|
+
"category": "money",
|
|
1989
|
+
"reason": "Buying extra accounts charges the saved card; read the state with get_subscription."
|
|
1990
|
+
},
|
|
1991
|
+
"selector": "action",
|
|
1992
|
+
"actions": {
|
|
1993
|
+
"set": {
|
|
1994
|
+
"label": "Set extra accounts",
|
|
1995
|
+
"destructive": true,
|
|
1996
|
+
"idempotent": true,
|
|
1997
|
+
"openWorld": true,
|
|
1998
|
+
"confirm": "preview",
|
|
1999
|
+
"nonce": true,
|
|
2000
|
+
"params": {
|
|
2001
|
+
"extra_accounts": {
|
|
2002
|
+
"type": "integer",
|
|
2003
|
+
"min": 0,
|
|
2004
|
+
"required": true
|
|
2005
|
+
},
|
|
2006
|
+
"workspace_id": {
|
|
2007
|
+
"type": "string"
|
|
2008
|
+
},
|
|
2009
|
+
"expected_current_extra_accounts": {
|
|
2010
|
+
"type": "integer",
|
|
2011
|
+
"min": 0
|
|
2012
|
+
},
|
|
2013
|
+
"expected_interval": {
|
|
2014
|
+
"type": "string",
|
|
2015
|
+
"enum": [
|
|
2016
|
+
"month",
|
|
2017
|
+
"year"
|
|
2018
|
+
]
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
},
|
|
1984
2024
|
"get_updates": {
|
|
1985
2025
|
"set": "core",
|
|
1986
2026
|
"label": "Product updates",
|