posterly-mcp-server 0.54.6 → 0.55.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.
Files changed (87) hide show
  1. package/README.md +45 -4
  2. package/dist/generated/platform-manifest.d.ts +4 -4
  3. package/dist/generated/platform-manifest.js +9 -4
  4. package/dist/index.js +15 -2
  5. package/dist/lib/alias-transport.js +4 -0
  6. package/dist/lib/api-client.d.ts +148 -0
  7. package/dist/lib/api-client.js +84 -0
  8. package/dist/lib/claude-directory-profile.js +3 -1
  9. package/dist/lib/format.d.ts +44 -0
  10. package/dist/lib/format.js +125 -5
  11. package/dist/lib/gbp-location-preview.d.ts +21 -0
  12. package/dist/lib/gbp-location-preview.js +27 -0
  13. package/dist/lib/google-business-review-name.d.ts +4 -0
  14. package/dist/lib/google-business-review-name.js +11 -0
  15. package/dist/lib/id-schema.d.ts +14 -0
  16. package/dist/lib/id-schema.js +82 -0
  17. package/dist/lib/id-text.d.ts +26 -0
  18. package/dist/lib/id-text.js +63 -0
  19. package/dist/lib/reply-window.d.ts +5 -0
  20. package/dist/lib/reply-window.js +14 -0
  21. package/dist/lib/service-area-text.d.ts +27 -0
  22. package/dist/lib/service-area-text.js +41 -0
  23. package/dist/lib/suggestion-accept-note.d.ts +10 -0
  24. package/dist/lib/suggestion-accept-note.js +17 -0
  25. package/dist/lib/tool-registry.js +19 -2
  26. package/dist/lib/version.d.ts +1 -1
  27. package/dist/lib/version.js +1 -1
  28. package/dist/tools/audit-google-business-profile.js +7 -3
  29. package/dist/tools/connect-account.d.ts +2 -2
  30. package/dist/tools/create-connect-session.d.ts +2 -2
  31. package/dist/tools/create-post.d.ts +6 -6
  32. package/dist/tools/create-posts-batch.d.ts +4 -4
  33. package/dist/tools/create-webhook.d.ts +3 -3
  34. package/dist/tools/delete-post.d.ts +4 -4
  35. package/dist/tools/dismiss-suggestion.d.ts +7 -0
  36. package/dist/tools/dismiss-suggestion.js +21 -2
  37. package/dist/tools/find-slot.js +7 -4
  38. package/dist/tools/get-post.js +56 -5
  39. package/dist/tools/list-accounts.d.ts +4 -0
  40. package/dist/tools/list-accounts.js +25 -6
  41. package/dist/tools/list-analytics.d.ts +4 -0
  42. package/dist/tools/list-analytics.js +29 -7
  43. package/dist/tools/list-comments.js +13 -3
  44. package/dist/tools/list-conversations.d.ts +4 -4
  45. package/dist/tools/list-conversations.js +10 -5
  46. package/dist/tools/list-google-business-locations.d.ts +27 -0
  47. package/dist/tools/list-google-business-locations.js +35 -0
  48. package/dist/tools/list-google-business-media.d.ts +8 -0
  49. package/dist/tools/list-google-business-media.js +19 -5
  50. package/dist/tools/list-google-business-reviews.js +3 -2
  51. package/dist/tools/list-google-business-service-areas.d.ts +37 -0
  52. package/dist/tools/list-google-business-service-areas.js +33 -0
  53. package/dist/tools/list-media.js +3 -2
  54. package/dist/tools/list-platforms.d.ts +10 -10
  55. package/dist/tools/list-post-suggestions.js +5 -4
  56. package/dist/tools/list-posts.d.ts +8 -2
  57. package/dist/tools/list-posts.js +12 -2
  58. package/dist/tools/list-webhooks.d.ts +18 -1
  59. package/dist/tools/list-webhooks.js +22 -3
  60. package/dist/tools/list-workspace-members.js +3 -1
  61. package/dist/tools/manage-brands.d.ts +47 -0
  62. package/dist/tools/manage-brands.js +89 -0
  63. package/dist/tools/manage-comment.js +5 -1
  64. package/dist/tools/manage-google-business-location.d.ts +123 -0
  65. package/dist/tools/manage-google-business-location.js +97 -0
  66. package/dist/tools/manage-google-business-media.js +2 -0
  67. package/dist/tools/manage-google-business-review.js +29 -3
  68. package/dist/tools/manage-google-business-service-area.d.ts +74 -0
  69. package/dist/tools/manage-google-business-service-area.js +79 -0
  70. package/dist/tools/manage-webhook.d.ts +6 -6
  71. package/dist/tools/manage-x-posting-addon.d.ts +47 -0
  72. package/dist/tools/manage-x-posting-addon.js +92 -0
  73. package/dist/tools/trigger-platform-helper.d.ts +5 -5
  74. package/dist/tools/trigger-platform-helper.js +4 -1
  75. package/dist/tools/update-post.d.ts +14 -6
  76. package/dist/tools/update-post.js +23 -2
  77. package/dist/tools/upload-media.d.ts +12 -0
  78. package/dist/tools/upload-media.js +39 -3
  79. package/dist/tools/validate-post.d.ts +4 -4
  80. package/dist/tools/webhook-events.d.ts +2 -2
  81. package/dist/tools/webhook-events.js +2 -0
  82. package/dist/tools/whoami.d.ts +4 -0
  83. package/dist/tools/whoami.js +14 -6
  84. package/package.json +1 -1
  85. package/server.json +2 -2
  86. package/tool-annotations.json +21 -2
  87. package/tool-registry.json +239 -8
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Identifiers must round-trip. A numeric id printed with a thousands
3
+ * separator ("1,961") is not the same id when an agent pastes it back, and
4
+ * list or validate calls then miss the account or post with no useful error.
5
+ *
6
+ * Counts and metrics stay on the cell formatter (toLocaleString). Only
7
+ * values that are ids, or strings that are nothing but a grouped integer,
8
+ * use these helpers.
9
+ */
10
+ const GROUPED_INTEGER = /^[+-]?\d{1,3}(?:,\d{3})+$/;
11
+ /** True for account_id, post_id, account_ids, preview_id, and the same shape. */
12
+ export function isIdParamName(name) {
13
+ return /(?:^|_)ids?$/.test(name);
14
+ }
15
+ /**
16
+ * "1,961" becomes "1961". Any other string, including UUIDs and resource
17
+ * names, is returned unchanged.
18
+ */
19
+ export function stripGroupedInteger(value) {
20
+ const trimmed = value.trim();
21
+ if (!GROUPED_INTEGER.test(trimmed))
22
+ return value;
23
+ return trimmed.replace(/,/g, '');
24
+ }
25
+ /**
26
+ * Digits to put inside backticks for an id, or null when the value is not
27
+ * an id-shaped number or grouped integer (the caller keeps its own formatter).
28
+ */
29
+ export function idCodeText(value) {
30
+ if (typeof value === 'number' && Number.isFinite(value))
31
+ return String(value);
32
+ if (typeof value === 'string') {
33
+ const stripped = stripGroupedInteger(value);
34
+ if (stripped !== value)
35
+ return stripped;
36
+ }
37
+ return null;
38
+ }
39
+ function normalizeIdValue(value) {
40
+ if (typeof value === 'string')
41
+ return stripGroupedInteger(value);
42
+ if (Array.isArray(value))
43
+ return value.map((item) => normalizeIdValue(item));
44
+ return value;
45
+ }
46
+ function walk(value, depth) {
47
+ if (depth > 8 || value === null || typeof value !== 'object')
48
+ return value;
49
+ if (Array.isArray(value))
50
+ return value.map((item) => walk(item, depth + 1));
51
+ const out = {};
52
+ for (const [key, child] of Object.entries(value)) {
53
+ out[key] = isIdParamName(key) ? normalizeIdValue(child) : walk(child, depth + 1);
54
+ }
55
+ return out;
56
+ }
57
+ /**
58
+ * Rewrites id arguments so a pasted "1,961" is the digits "1961".
59
+ * Numbers stay numbers. Non-id strings are left alone.
60
+ */
61
+ export function normalizeIdArgs(args) {
62
+ return walk(args, 0);
63
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Keep in step with lib/inbox/reply-window.ts. The npm package cannot import
3
+ * the Next.js app, so this copy only formats the stored window for assistants.
4
+ */
5
+ export declare function replyWindowPhrase(expiresAt: unknown, now?: number): string | null;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Keep in step with lib/inbox/reply-window.ts. The npm package cannot import
3
+ * the Next.js app, so this copy only formats the stored window for assistants.
4
+ */
5
+ const MESSAGING_WINDOW_LABEL = 'reply window';
6
+ export function replyWindowPhrase(expiresAt, now = Date.now()) {
7
+ if (typeof expiresAt !== 'string' || !expiresAt)
8
+ return null;
9
+ const ms = new Date(expiresAt).getTime();
10
+ if (!Number.isFinite(ms))
11
+ return null;
12
+ const stamp = `${new Date(ms).toISOString().slice(0, 16).replace('T', ' ')} UTC`;
13
+ return ms > now ? `${MESSAGING_WINDOW_LABEL} open until ${stamp}` : `${MESSAGING_WINDOW_LABEL} closed ${stamp}`;
14
+ }
@@ -0,0 +1,27 @@
1
+ /** Plain-text service areas. Keep in step with lib/google-business/service-area-text.ts. */
2
+ type ServiceAreaPayload = {
3
+ account?: {
4
+ business_name?: string | null;
5
+ location_id?: string | null;
6
+ id?: number | null;
7
+ };
8
+ service_area?: {
9
+ business_type_label?: string;
10
+ region_code?: string | null;
11
+ place_limit?: number;
12
+ places?: Array<{
13
+ place_id?: string;
14
+ place_name?: string;
15
+ }>;
16
+ } | null;
17
+ message?: string;
18
+ };
19
+ export declare function formatGoogleBusinessServiceArea(data: ServiceAreaPayload): string;
20
+ export declare function formatGoogleBusinessServiceAreaPlaces(data: {
21
+ query?: string;
22
+ places?: Array<{
23
+ place_id?: string;
24
+ place_name?: string;
25
+ }>;
26
+ }): string;
27
+ export {};
@@ -0,0 +1,41 @@
1
+ /** Plain-text service areas. Keep in step with lib/google-business/service-area-text.ts. */
2
+ export function formatGoogleBusinessServiceArea(data) {
3
+ const account = data.account || {};
4
+ const area = data.service_area;
5
+ const name = account.business_name || 'This location';
6
+ const lines = [`Google Business service areas: ${name}`];
7
+ if (account.location_id)
8
+ lines.push(`Location: ${account.location_id}`);
9
+ if (!area) {
10
+ lines.push('No service area was returned.');
11
+ return lines.join('\n');
12
+ }
13
+ lines.push(area.business_type_label || 'No service area is set.');
14
+ if (area.region_code)
15
+ lines.push(`Country: ${area.region_code}`);
16
+ const places = Array.isArray(area.places) ? area.places : [];
17
+ if (places.length === 0) {
18
+ lines.push('No towns or postcodes are listed.');
19
+ }
20
+ else {
21
+ lines.push(`Areas (${places.length} of ${area.place_limit || 20}):`);
22
+ for (const place of places) {
23
+ lines.push(`- ${place.place_name} :: ${place.place_id}`);
24
+ }
25
+ }
26
+ if (data.message)
27
+ lines.push('', data.message);
28
+ return lines.join('\n');
29
+ }
30
+ export function formatGoogleBusinessServiceAreaPlaces(data) {
31
+ const places = Array.isArray(data.places) ? data.places : [];
32
+ if (places.length === 0) {
33
+ return `No matching towns or postcodes for "${data.query || ''}".`;
34
+ }
35
+ const lines = [`Matching service areas for "${data.query || ''}":`];
36
+ for (const place of places) {
37
+ lines.push(`- ${place.place_name} :: ${place.place_id}`);
38
+ }
39
+ lines.push('', 'Use place_id and place_name together when you update service areas. Place IDs are regions, not the review-link Place ID.');
40
+ return lines.join('\n');
41
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The closing note after saving a suggestion as a draft. Shared by the hosted
3
+ * and npm MCP servers.
4
+ *
5
+ * A suggestion that was already turned into a post (for example scheduled
6
+ * from the composer) is not saved again: the API returns that post's real
7
+ * status, which may be scheduled or published, so the note must not call it
8
+ * an unpublished draft.
9
+ */
10
+ export declare function suggestionAcceptNote(alreadySaved: boolean, status: string | null | undefined): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The closing note after saving a suggestion as a draft. Shared by the hosted
3
+ * and npm MCP servers.
4
+ *
5
+ * A suggestion that was already turned into a post (for example scheduled
6
+ * from the composer) is not saved again: the API returns that post's real
7
+ * status, which may be scheduled or published, so the note must not call it
8
+ * an unpublished draft.
9
+ */
10
+ export function suggestionAcceptNote(alreadySaved, status) {
11
+ if (!alreadySaved || status === 'draft') {
12
+ return 'This is an unpublished draft. Nothing was scheduled and nothing was published.';
13
+ }
14
+ return status
15
+ ? `This suggestion was already turned into a post with status ${status}. Nothing was changed.`
16
+ : 'This suggestion was already turned into a post that no longer exists. Nothing was changed.';
17
+ }
@@ -37,6 +37,18 @@ export function translateArgs(alias, args) {
37
37
  return out;
38
38
  }
39
39
  const MODE_COMMON_PARAMS = new Set(['confirm', 'preview_id']);
40
+ // Same rules as mcp-server/src/lib/id-text.ts. Inlined because this file is
41
+ // compiled by Next, which does not resolve a relative .js import to .ts.
42
+ const GROUPED_INTEGER = /^[+-]?\d{1,3}(?:,\d{3})+$/;
43
+ function isIdParamName(name) {
44
+ return /(?:^|_)ids?$/.test(name);
45
+ }
46
+ function stripGroupedInteger(value) {
47
+ const trimmed = value.trim();
48
+ if (!GROUPED_INTEGER.test(trimmed))
49
+ return value;
50
+ return trimmed.replace(/,/g, '');
51
+ }
40
52
  function modeEntries(tool) {
41
53
  return tool.views ?? tool.actions ?? null;
42
54
  }
@@ -45,8 +57,11 @@ function normalizeParam(name, value, spec, where) {
45
57
  case 'integer':
46
58
  case 'number': {
47
59
  let n = value;
48
- if (typeof value === 'string' && value.trim() !== '' && /^-?\d+(\.\d+)?$/.test(value.trim()))
49
- n = Number(value.trim());
60
+ if (typeof value === 'string') {
61
+ const stripped = stripGroupedInteger(value).trim();
62
+ if (stripped !== '' && /^-?\d+(\.\d+)?$/.test(stripped))
63
+ n = Number(stripped);
64
+ }
50
65
  if (typeof n !== 'number' || !Number.isFinite(n))
51
66
  return { ok: false, error: `${name} must be a number${where}.` };
52
67
  if (spec.type === 'integer' && !Number.isInteger(n))
@@ -62,6 +77,8 @@ function normalizeParam(name, value, spec, where) {
62
77
  case 'string': {
63
78
  if (typeof value === 'number' && Number.isFinite(value))
64
79
  value = String(value);
80
+ else if (typeof value === 'string' && isIdParamName(name))
81
+ value = stripGroupedInteger(value);
65
82
  if (typeof value !== 'string')
66
83
  return { ok: false, error: `${name} must be a string${where}.` };
67
84
  if (spec.enum && !spec.enum.includes(value))
@@ -1 +1 @@
1
- export declare const POSTERLY_MCP_VERSION = "0.54.6";
1
+ export declare const POSTERLY_MCP_VERSION = "0.55.1";
@@ -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.54.6';
8
+ export const POSTERLY_MCP_VERSION = '0.55.1';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- const AUDIT_SECTION_ORDER = ['basicInfo', 'hours', 'categories', 'description', 'media', 'attributes', 'reviews'];
2
+ const AUDIT_SECTION_ORDER = ['basicInfo', 'hours', 'categories', 'description', 'media', 'attributes', 'reviews', 'serviceAreas'];
3
3
  export function formatGoogleBusinessAuditText(result) {
4
4
  const audit = result.audit || {};
5
5
  const recommendations = Array.isArray(audit.recommendations) ? audit.recommendations : [];
@@ -18,7 +18,11 @@ export function formatGoogleBusinessAuditText(result) {
18
18
  for (const key of keys) {
19
19
  const section = sections[key] || {};
20
20
  const label = section.label || key;
21
- lines.push(`- ${label}: ${section.score ?? 'n/a'}/${section.maxScore ?? 'n/a'}`);
21
+ const scoreText = section.maxScore === 0
22
+ ? 'not used for this listing'
23
+ : `${section.score ?? 'n/a'}/${section.maxScore ?? 'n/a'}`;
24
+ const note = section.maxScore !== 0 && section.note ? ` (${section.note})` : '';
25
+ lines.push(`- ${label}: ${scoreText}${note}`);
22
26
  }
23
27
  }
24
28
  if (recommendations.length > 0) {
@@ -31,7 +35,7 @@ export function formatGoogleBusinessAuditText(result) {
31
35
  }
32
36
  export const auditGoogleBusinessProfileTool = {
33
37
  name: 'audit_google_business_profile',
34
- description: 'Run a live local-profile audit for a connected Google Business Profile location. Returns the 0-100 completeness score, letter grade, a score for each section (profile basics, hours, categories, description, photos, attributes, review health), and recommendations.',
38
+ description: 'Run a live local-profile audit for a connected Google Business Profile location. Returns the 0-100 completeness score, letter grade, a score for each section (profile basics, hours, categories, description, photos, attributes, review health, and service areas when the listing travels to customers), and recommendations. A service listing with no areas, or an area more than 80 miles from the business in a straight line, cannot keep a top score.',
35
39
  inputSchema: z.object({
36
40
  workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
37
41
  account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
@@ -20,7 +20,7 @@ export declare const connectAccountTool: {
20
20
  workspace_id: z.ZodOptional<z.ZodString>;
21
21
  connect_session_id: z.ZodOptional<z.ZodString>;
22
22
  }, "strip", z.ZodTypeAny, {
23
- platform: "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy";
23
+ platform: "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy";
24
24
  workspace_id?: string | undefined;
25
25
  username?: string | undefined;
26
26
  connect_session_id?: string | undefined;
@@ -35,7 +35,7 @@ export declare const connectAccountTool: {
35
35
  instance?: string | undefined;
36
36
  password?: string | undefined;
37
37
  }, {
38
- platform: "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy";
38
+ platform: "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy";
39
39
  workspace_id?: string | undefined;
40
40
  username?: string | undefined;
41
41
  connect_session_id?: string | undefined;
@@ -9,12 +9,12 @@ export declare const createConnectSessionTool: {
9
9
  auto_start: z.ZodOptional<z.ZodBoolean>;
10
10
  debug: z.ZodOptional<z.ZodBoolean>;
11
11
  }, "strip", z.ZodTypeAny, {
12
- platform: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "reddit" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter";
12
+ platform: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "reddit" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter";
13
13
  workspace_id?: string | undefined;
14
14
  auto_start?: boolean | undefined;
15
15
  debug?: boolean | undefined;
16
16
  }, {
17
- platform: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "reddit" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter";
17
+ platform: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "reddit" | "skool" | "whop" | "gmb" | "google-business" | "google_business_profile" | "linkedin_page" | "facebook_instagram" | "facebook_pages" | "linkedin-company" | "linkedin-page" | "linkedin_company" | "linkedin_personal" | "meta_business" | "x_twitter";
18
18
  workspace_id?: string | undefined;
19
19
  auto_start?: boolean | undefined;
20
20
  debug?: boolean | undefined;
@@ -1352,7 +1352,7 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
1352
1352
  }, z.ZodTypeAny, "passthrough">>>;
1353
1353
  workspace_id: z.ZodOptional<z.ZodString>;
1354
1354
  }, "strip", z.ZodTypeAny, {
1355
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1355
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1356
1356
  account_id?: string | undefined;
1357
1357
  workspace_id?: string | undefined;
1358
1358
  username?: string | undefined;
@@ -1563,7 +1563,7 @@ export declare const createPostPayloadInputSchema: z.ZodObject<{
1563
1563
  ai_generated: z.ZodOptional<z.ZodBoolean>;
1564
1564
  }, z.ZodTypeAny, "passthrough"> | undefined;
1565
1565
  }, {
1566
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1566
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1567
1567
  account_id?: string | undefined;
1568
1568
  workspace_id?: string | undefined;
1569
1569
  username?: string | undefined;
@@ -2459,7 +2459,7 @@ export declare const createPostInputSchema: z.ZodObject<{
2459
2459
  confirm: z.ZodLiteral<true>;
2460
2460
  }, "strip", z.ZodTypeAny, {
2461
2461
  confirm: true;
2462
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
2462
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
2463
2463
  account_id?: string | undefined;
2464
2464
  workspace_id?: string | undefined;
2465
2465
  username?: string | undefined;
@@ -2671,7 +2671,7 @@ export declare const createPostInputSchema: z.ZodObject<{
2671
2671
  }, z.ZodTypeAny, "passthrough"> | undefined;
2672
2672
  }, {
2673
2673
  confirm: true;
2674
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
2674
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
2675
2675
  account_id?: string | undefined;
2676
2676
  workspace_id?: string | undefined;
2677
2677
  username?: string | undefined;
@@ -3596,7 +3596,7 @@ export declare const createPostTool: {
3596
3596
  confirm: z.ZodLiteral<true>;
3597
3597
  }, "strip", z.ZodTypeAny, {
3598
3598
  confirm: true;
3599
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
3599
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
3600
3600
  account_id?: string | undefined;
3601
3601
  workspace_id?: string | undefined;
3602
3602
  username?: string | undefined;
@@ -3808,7 +3808,7 @@ export declare const createPostTool: {
3808
3808
  }, z.ZodTypeAny, "passthrough"> | undefined;
3809
3809
  }, {
3810
3810
  confirm: true;
3811
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
3811
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
3812
3812
  account_id?: string | undefined;
3813
3813
  workspace_id?: string | undefined;
3814
3814
  username?: string | undefined;
@@ -687,7 +687,7 @@ export declare const createPostsBatchTool: {
687
687
  }, z.ZodTypeAny, "passthrough">>>;
688
688
  workspace_id: z.ZodOptional<z.ZodString>;
689
689
  }, "strip", z.ZodTypeAny, {
690
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
690
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
691
691
  account_id?: string | undefined;
692
692
  workspace_id?: string | undefined;
693
693
  username?: string | undefined;
@@ -898,7 +898,7 @@ export declare const createPostsBatchTool: {
898
898
  ai_generated: z.ZodOptional<z.ZodBoolean>;
899
899
  }, z.ZodTypeAny, "passthrough"> | undefined;
900
900
  }, {
901
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
901
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
902
902
  account_id?: string | undefined;
903
903
  workspace_id?: string | undefined;
904
904
  username?: string | undefined;
@@ -1113,7 +1113,7 @@ export declare const createPostsBatchTool: {
1113
1113
  }, "strip", z.ZodTypeAny, {
1114
1114
  confirm: true;
1115
1115
  posts: {
1116
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1116
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1117
1117
  account_id?: string | undefined;
1118
1118
  workspace_id?: string | undefined;
1119
1119
  username?: string | undefined;
@@ -1327,7 +1327,7 @@ export declare const createPostsBatchTool: {
1327
1327
  }, {
1328
1328
  confirm: true;
1329
1329
  posts: {
1330
- platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "telegram" | "bluesky" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1330
+ platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "x" | "bluesky" | "telegram" | "discord" | "wordpress" | "devto" | "hashnode" | "lemmy" | "slack" | "mastodon" | "gmb" | "google-business" | "google_business_profile" | undefined;
1331
1331
  account_id?: string | undefined;
1332
1332
  workspace_id?: string | undefined;
1333
1333
  username?: string | undefined;
@@ -5,7 +5,7 @@ export declare const createWebhookTool: {
5
5
  description: string;
6
6
  inputSchema: z.ZodObject<{
7
7
  url: z.ZodString;
8
- events: z.ZodOptional<z.ZodArray<z.ZodEnum<["webhook.test", "post.created", "post.updated", "post.deleted", "post.publishing", "post.published", "post.failed", "account.disconnected", "analytics.synced", "approval.requested", "approval.approved", "approval.changes_requested", "approval.rejected", "approval.commented"]>, "many">>;
8
+ events: z.ZodOptional<z.ZodArray<z.ZodEnum<["webhook.test", "post.created", "post.updated", "post.deleted", "post.publishing", "post.published", "post.failed", "account.disconnected", "account.needs_reconnect", "account.reconnected", "analytics.synced", "approval.requested", "approval.approved", "approval.changes_requested", "approval.rejected", "approval.commented"]>, "many">>;
9
9
  workspace_id: z.ZodOptional<z.ZodString>;
10
10
  description: z.ZodOptional<z.ZodString>;
11
11
  is_active: z.ZodOptional<z.ZodBoolean>;
@@ -16,14 +16,14 @@ export declare const createWebhookTool: {
16
16
  workspace_id?: string | undefined;
17
17
  description?: string | undefined;
18
18
  is_active?: boolean | undefined;
19
- events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced" | "approval.requested" | "approval.approved" | "approval.changes_requested" | "approval.rejected" | "approval.commented")[] | undefined;
19
+ events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "account.needs_reconnect" | "account.reconnected" | "analytics.synced" | "approval.requested" | "approval.approved" | "approval.changes_requested" | "approval.rejected" | "approval.commented")[] | undefined;
20
20
  }, {
21
21
  confirm: true;
22
22
  url: string;
23
23
  workspace_id?: string | undefined;
24
24
  description?: string | undefined;
25
25
  is_active?: boolean | undefined;
26
- events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "analytics.synced" | "approval.requested" | "approval.approved" | "approval.changes_requested" | "approval.rejected" | "approval.commented")[] | undefined;
26
+ events?: ("webhook.test" | "post.created" | "post.updated" | "post.deleted" | "post.publishing" | "post.published" | "post.failed" | "account.disconnected" | "account.needs_reconnect" | "account.reconnected" | "analytics.synced" | "approval.requested" | "approval.approved" | "approval.changes_requested" | "approval.rejected" | "approval.commented")[] | undefined;
27
27
  }>;
28
28
  execute(client: PosterlyClient, input: {
29
29
  url: string;
@@ -20,19 +20,19 @@ export declare const deletePostTool: {
20
20
  confirm: z.ZodOptional<z.ZodBoolean>;
21
21
  preview_id: z.ZodOptional<z.ZodString>;
22
22
  }, "strip", z.ZodTypeAny, {
23
+ group_id?: string | undefined;
23
24
  confirm?: boolean | undefined;
24
25
  preview_id?: string | undefined;
25
26
  post_id?: number | undefined;
26
27
  confirm_published?: boolean | undefined;
27
28
  delete_mode?: "platform" | "posterly" | undefined;
28
- group_id?: string | undefined;
29
29
  }, {
30
+ group_id?: string | undefined;
30
31
  confirm?: boolean | undefined;
31
32
  preview_id?: string | undefined;
32
33
  post_id?: number | undefined;
33
34
  confirm_published?: boolean | undefined;
34
35
  delete_mode?: "platform" | "posterly" | undefined;
35
- group_id?: string | undefined;
36
36
  }>;
37
37
  /** The old tools' exact input schemas, for alias calls (see alias-transport.ts). */
38
38
  legacySchemas: {
@@ -40,11 +40,11 @@ export declare const deletePostTool: {
40
40
  group_id: z.ZodString;
41
41
  confirm: z.ZodLiteral<true>;
42
42
  }, "strip", z.ZodTypeAny, {
43
- confirm: true;
44
43
  group_id: string;
45
- }, {
46
44
  confirm: true;
45
+ }, {
47
46
  group_id: string;
47
+ confirm: true;
48
48
  }>;
49
49
  };
50
50
  execute(client: PosterlyClient, input: DeletePostInput, ctx: ToolContext): Promise<string>;
@@ -5,12 +5,19 @@ export declare const dismissSuggestionTool: {
5
5
  description: string;
6
6
  inputSchema: z.ZodObject<{
7
7
  suggestion_id: z.ZodString;
8
+ save_as_draft: z.ZodOptional<z.ZodBoolean>;
8
9
  }, "strip", z.ZodTypeAny, {
9
10
  suggestion_id: string;
11
+ save_as_draft?: boolean | undefined;
10
12
  }, {
11
13
  suggestion_id: string;
14
+ save_as_draft?: boolean | undefined;
12
15
  }>;
13
16
  execute(client: PosterlyClient, input: {
14
17
  suggestion_id: string;
18
+ save_as_draft?: boolean;
19
+ scheduled_at?: string;
20
+ publish_at?: string;
21
+ publish?: boolean;
15
22
  }): Promise<string>;
16
23
  };
@@ -1,14 +1,33 @@
1
1
  import { z } from 'zod';
2
- import { mdSuccess } from '../lib/format.js';
2
+ import { code, mdSuccess } from '../lib/format.js';
3
+ import { suggestionAcceptNote } from '../lib/suggestion-accept-note.js';
3
4
  export const dismissSuggestionTool = {
4
5
  name: 'dismiss_suggestion',
5
- description: 'Dismiss a proactive post suggestion so it stops appearing. WRITE: confirm the exact suggestion with the user first. Never dismisses a suggestion that was already turned into a scheduled post (that would break adoption tracking).',
6
+ description: 'Dismiss a proactive post suggestion so it stops appearing, or pass save_as_draft true to turn it into an unpublished draft instead. A draft is not scheduled and nothing is published. WRITE: confirm the exact suggestion with the user first. Never dismisses, and does not overwrite, a suggestion that was already turned into a post.',
6
7
  inputSchema: z.object({
7
8
  suggestion_id: z
8
9
  .string()
9
10
  .describe('Suggestion ID from list_post_suggestions.'),
11
+ save_as_draft: z
12
+ .boolean()
13
+ .optional()
14
+ .describe('True saves the suggestion as an unpublished draft and does not dismiss it. Omit to dismiss.'),
10
15
  }),
11
16
  async execute(client, input) {
17
+ if (input.scheduled_at || input.publish_at || input.publish) {
18
+ throw new Error('Saving a suggestion creates an unpublished draft. It does not schedule or publish.');
19
+ }
20
+ if (input.save_as_draft === true) {
21
+ const result = await client.acceptSuggestion(input.suggestion_id);
22
+ const postId = result.post_id != null ? code(String(result.post_id)) : 'unknown';
23
+ return [
24
+ mdSuccess(result.already_saved ? 'Suggestion already saved' : 'Suggestion saved as a draft', [
25
+ ['Post ID', postId],
26
+ ['Status', result.status || 'unknown'],
27
+ ]),
28
+ suggestionAcceptNote(Boolean(result.already_saved), result.status ?? null),
29
+ ].join('\n\n');
30
+ }
12
31
  const result = await client.dismissSuggestion(input.suggestion_id);
13
32
  return mdSuccess('Suggestion dismissed', [
14
33
  ['Suggestion ID', input.suggestion_id],
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { formatDate, mdEmpty, mdTable, mdTitle, starGlyphs } from '../lib/format.js';
2
+ import { formatDate, formatIsoTimestamp, mdEmpty, mdTable, mdTitle, starGlyphs } from '../lib/format.js';
3
3
  const SUGGESTED_BASIS_LABELS = {
4
4
  yours: 'Based on your posts',
5
5
  platform: 'Popular on this platform',
@@ -7,7 +7,7 @@ const SUGGESTED_BASIS_LABELS = {
7
7
  };
8
8
  export const findSlotTool = {
9
9
  name: 'find_available_slot',
10
- description: 'Find available time slots for posting. Respects a 1-hour gap between posts and preferred hours (8am-10pm in the given timezone). Returns up to 10 slots. IMPORTANT: pass a timezone explicitly - default is America/New_York and slots will be off if the user is elsewhere. Pass workspace_id to only avoid collisions with posts in that workspace. strategy "best_engagement" (needs account_ids) ranks the next 7 days by when these accounts get the most engagement, with a 1-5 star rating and a reason per slot.',
10
+ description: 'Find available time slots for posting. Respects a 1-hour gap between posts and preferred hours (8am-10pm in the given timezone). Returns up to 10 slots. IMPORTANT: pass a timezone explicitly - default is America/New_York and slots will be off if the user is elsewhere. Each slot includes the UTC instant to pass as scheduled_at. Pass workspace_id to only avoid collisions with posts in that workspace. strategy "best_engagement" (needs account_ids) ranks the next 7 days by when these accounts get the most engagement, with a 1-5 star rating and a reason per slot.',
11
11
  inputSchema: z.object({
12
12
  account_ids: z
13
13
  .array(z.string())
@@ -54,9 +54,10 @@ export const findSlotTool = {
54
54
  `Basis: ${basis}${result.timezone ? ` (${result.timezone})` : ''}`,
55
55
  // local_time already carries the date in the requested timezone, so
56
56
  // no separate Date column (a machine-local date could disagree).
57
- mdTable(['Option', 'Local time', 'Rating', 'Why'], slots.map((slot, index) => [
57
+ mdTable(['Option', 'Local time', 'UTC', 'Rating', 'Why'], slots.map((slot, index) => [
58
58
  index + 1,
59
59
  slot.local_time,
60
+ slot.time ? formatIsoTimestamp(slot.time) : 'n/a',
60
61
  starGlyphs(slot.stars, slot.basis === 'default'),
61
62
  slot.reason || 'n/a',
62
63
  ])),
@@ -68,11 +69,13 @@ export const findSlotTool = {
68
69
  }
69
70
  return [
70
71
  mdTitle(`Available posting slots (${slots.length})`),
71
- mdTable(['Option', 'Local time', 'Date'], slots.map((slot, index) => [
72
+ mdTable(['Option', 'Local time', 'Date', 'UTC'], slots.map((slot, index) => [
72
73
  index + 1,
73
74
  slot.local_time,
74
75
  formatDate(slot.time),
76
+ formatIsoTimestamp(slot.time),
75
77
  ])),
78
+ 'Pass the UTC value to create_post as scheduled_at. Local time uses the timezone you passed. If you left timezone out, that zone is America/New_York.',
76
79
  ].join('\n\n');
77
80
  },
78
81
  };