posterly-mcp-server 0.63.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -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.63.0` exposes 75 tools covering 127 actions. The hosted HTTP endpoint exposes the same catalog minus the three signup tools: 72 tools covering 124 actions.
126
+ `posterly-mcp-server@0.64.0` exposes 75 tools covering 127 actions. The hosted HTTP endpoint exposes the same catalog minus the three signup tools: 72 tools covering 124 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
 
@@ -916,6 +916,14 @@ export interface Slot {
916
916
  time: string;
917
917
  local_time: string;
918
918
  }
919
+ /** Where a slot response's timezone came from when the caller passed none. */
920
+ export type SlotTimezoneSource = 'requested' | 'workspace' | 'profile' | 'utc';
921
+ export interface AvailableSlotsResponse {
922
+ slots: Slot[];
923
+ /** The timezone local_time is in. Missing from older API deployments. */
924
+ timezone?: string;
925
+ timezone_source?: SlotTimezoneSource;
926
+ }
919
927
  export type SuggestedSlotBasis = 'yours' | 'platform' | 'default';
920
928
  export interface SuggestedSlot extends Slot {
921
929
  basis: SuggestedSlotBasis;
@@ -933,6 +941,7 @@ export interface SuggestedTimesWeeklyRating {
933
941
  }
934
942
  export interface SuggestedSlotsResponse {
935
943
  timezone: string;
944
+ timezone_source?: SlotTimezoneSource;
936
945
  basis: SuggestedSlotBasis;
937
946
  basis_label: string;
938
947
  slots: SuggestedSlot[];
@@ -1952,7 +1961,7 @@ export declare class PosterlyClient {
1952
1961
  timezone?: string;
1953
1962
  count?: number;
1954
1963
  workspace_id?: string;
1955
- }): Promise<Slot[]>;
1964
+ }): Promise<AvailableSlotsResponse>;
1956
1965
  /** Best times by engagement for the given accounts (GET /slots/suggested). */
1957
1966
  findSuggestedSlots(params: {
1958
1967
  account_ids: string[];
@@ -585,7 +585,7 @@ export class PosterlyClient {
585
585
  searchParams.set('workspace_id', params.workspace_id);
586
586
  const qs = searchParams.toString();
587
587
  const data = await this.request('GET', `/slots/next${qs ? `?${qs}` : ''}`);
588
- return data.slots;
588
+ return { ...data, slots: Array.isArray(data?.slots) ? data.slots : [] };
589
589
  }
590
590
  /** Best times by engagement for the given accounts (GET /slots/suggested). */
591
591
  async findSuggestedSlots(params) {
@@ -61,6 +61,19 @@ export declare function dashboardUrlForPostList(posts: Array<Pick<Post, 'schedul
61
61
  * both surfaces.
62
62
  */
63
63
  export declare function starGlyphs(stars: unknown, estimated?: boolean): string;
64
+ /**
65
+ * One line naming the timezone a slot result is in and where it came from
66
+ * (the API's timezone and timezone_source). When nothing was passed and
67
+ * nothing is saved the API falls back to UTC: that is said outright, with
68
+ * what to do about it, so UTC times are never read as the user's clock.
69
+ * The hosted and npm renderers keep this wording identical.
70
+ */
71
+ export declare function slotTimeZoneNote(data: {
72
+ timezone?: unknown;
73
+ timezone_source?: unknown;
74
+ } | null | undefined): string | null;
75
+ /** The slot's calendar day in the slot timezone, so Date agrees with Local time. */
76
+ export declare function slotLocalDate(value: string | null | undefined, timeZone: unknown): string;
64
77
  export declare function truncateText(value: string | null | undefined, max?: number): string;
65
78
  export declare function formatAccountLabel(account: Account): string;
66
79
  export declare function formatConnectedAccounts(accounts?: Account[]): string;
@@ -148,6 +148,48 @@ export function starGlyphs(stars, estimated = false) {
148
148
  const glyphs = '★'.repeat(n) + '☆'.repeat(5 - n);
149
149
  return estimated ? `${glyphs} (est.)` : glyphs;
150
150
  }
151
+ /**
152
+ * One line naming the timezone a slot result is in and where it came from
153
+ * (the API's timezone and timezone_source). When nothing was passed and
154
+ * nothing is saved the API falls back to UTC: that is said outright, with
155
+ * what to do about it, so UTC times are never read as the user's clock.
156
+ * The hosted and npm renderers keep this wording identical.
157
+ */
158
+ export function slotTimeZoneNote(data) {
159
+ const timezone = typeof data?.timezone === 'string' ? data.timezone.trim() : '';
160
+ if (!timezone)
161
+ return null;
162
+ switch (data?.timezone_source) {
163
+ case 'requested':
164
+ return `Timezone: ${timezone} (the timezone you passed).`;
165
+ case 'workspace':
166
+ return `Timezone: ${timezone} (the workspace timezone; no timezone was passed).`;
167
+ case 'profile':
168
+ return `Timezone: ${timezone} (the user's saved timezone; no timezone was passed).`;
169
+ case 'utc':
170
+ return `Timezone: ${timezone} (FALLBACK: no timezone was passed and none is saved for this user or workspace). These local times are UTC, which is probably not the user's clock. Ask the user for their IANA timezone (for example Europe/London), call find_available_slot again with timezone, and save it with complete_onboarding (timezone only) so later calls use it.`;
171
+ default:
172
+ return `Timezone: ${timezone}.`;
173
+ }
174
+ }
175
+ /** The slot's calendar day in the slot timezone, so Date agrees with Local time. */
176
+ export function slotLocalDate(value, timeZone) {
177
+ if (!value)
178
+ return 'n/a';
179
+ const date = new Date(value);
180
+ if (Number.isNaN(date.getTime()))
181
+ return String(value);
182
+ const options = { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric' };
183
+ if (typeof timeZone === 'string' && timeZone.trim()) {
184
+ try {
185
+ return date.toLocaleDateString('en-US', { ...options, timeZone: timeZone.trim() });
186
+ }
187
+ catch {
188
+ // Unknown zone name: fall back to the default below.
189
+ }
190
+ }
191
+ return date.toLocaleDateString('en-US', options);
192
+ }
151
193
  export function truncateText(value, max = 80) {
152
194
  const text = value?.trim() || '';
153
195
  if (!text)
@@ -244,5 +244,5 @@ export declare function resolveCalledTool(registry: ToolRegistry, calledName: st
244
244
  * all on by default, how to load fewer, and how preview then confirm works.
245
245
  */
246
246
  /** Issue #1683: AI app signups onboard in the chat, and returning users are never asked again. */
247
- export declare const ONBOARDING_INSTRUCTION = "Start each session with whoami. If onboarding.completed is false, run onboarding in this chat: ask what to call the user and their IANA timezone, save them with complete_onboarding, then offer create_connect_session for their first network (its link opens the network sign-in directly). Never send the user to /onboarding-v2, and never ask the onboarding questions again once onboarding.completed is true.";
247
+ export declare const ONBOARDING_INSTRUCTION = "Start each session with whoami. If onboarding.completed is false, run onboarding in this chat before scheduling anything: ask what to call the user and their IANA timezone (only the timezone when onboarding.instruction says so), save them with complete_onboarding, then offer create_connect_session for their first network (its link opens the network sign-in directly). Never send the user to /onboarding-v2, and never ask the onboarding questions again once onboarding.completed is true.";
248
248
  export declare function toolsetInstructions(registry: ToolRegistry, surface: ToolSurface): string;
@@ -396,7 +396,7 @@ export function resolveCalledTool(registry, calledName) {
396
396
  * all on by default, how to load fewer, and how preview then confirm works.
397
397
  */
398
398
  /** Issue #1683: AI app signups onboard in the chat, and returning users are never asked again. */
399
- export const ONBOARDING_INSTRUCTION = 'Start each session with whoami. If onboarding.completed is false, run onboarding in this chat: ask what to call the user and their IANA timezone, save them with complete_onboarding, then offer create_connect_session for their first network (its link opens the network sign-in directly). Never send the user to /onboarding-v2, and never ask the onboarding questions again once onboarding.completed is true.';
399
+ export const ONBOARDING_INSTRUCTION = 'Start each session with whoami. If onboarding.completed is false, run onboarding in this chat before scheduling anything: ask what to call the user and their IANA timezone (only the timezone when onboarding.instruction says so), save them with complete_onboarding, then offer create_connect_session for their first network (its link opens the network sign-in directly). Never send the user to /onboarding-v2, and never ask the onboarding questions again once onboarding.completed is true.';
400
400
  export function toolsetInstructions(registry, surface) {
401
401
  const sets = Object.entries(registry.toolsets)
402
402
  .filter(([, set]) => !set.surfaces || set.surfaces.includes(surface))
@@ -1 +1 @@
1
- export declare const POSTERLY_MCP_VERSION = "0.63.0";
1
+ export declare const POSTERLY_MCP_VERSION = "0.64.0";
@@ -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.63.0';
8
+ export const POSTERLY_MCP_VERSION = '0.64.0';
@@ -1,13 +1,15 @@
1
1
  import { z } from 'zod';
2
- import { formatDate, formatIsoTimestamp, mdEmpty, mdTable, mdTitle, starGlyphs } from '../lib/format.js';
2
+ import { formatIsoTimestamp, mdEmpty, mdTable, mdTitle, slotLocalDate, slotTimeZoneNote, 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',
6
6
  default: 'Good default',
7
7
  };
8
+ const SLOT_SCHEDULE_HINT = 'Pass the UTC value to create_post as scheduled_at.';
9
+ const SLOT_UNKNOWN_TIMEZONE_HINT = 'Local time uses the timezone you passed, or, if you left it out, the saved timezone, then UTC.';
8
10
  export const findSlotTool = {
9
11
  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. 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.',
12
+ 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. Without timezone it uses the saved user timezone (in a shared workspace, the timezone of that workspace first), then UTC; the result names the timezone used and where it came from, and says so when it fell back to UTC. 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
13
  inputSchema: z.object({
12
14
  account_ids: z
13
15
  .array(z.string())
@@ -16,7 +18,7 @@ export const findSlotTool = {
16
18
  timezone: z
17
19
  .string()
18
20
  .optional()
19
- .describe('IANA timezone (e.g. Asia/Dubai, Europe/London). Defaults to America/New_York - pass the user\'s actual timezone or slots will be wrong.'),
21
+ .describe('IANA timezone (e.g. Asia/Dubai, Europe/London). Defaults to the saved user timezone (in a shared workspace, the timezone of that workspace first), then UTC.'),
20
22
  count: z
21
23
  .number()
22
24
  .min(1)
@@ -48,10 +50,12 @@ export const findSlotTool = {
48
50
  if (slots.length === 0) {
49
51
  return mdEmpty('suggested slots', 'No suggested slots are free in the next 7 days.');
50
52
  }
53
+ const timeZoneNote = slotTimeZoneNote(result);
51
54
  const basis = result.basis_label || SUGGESTED_BASIS_LABELS[result.basis] || 'Good default';
52
55
  return [
53
56
  mdTitle(`Best times to post (${slots.length})`),
54
- `Basis: ${basis}${result.timezone ? ` (${result.timezone})` : ''}`,
57
+ `Basis: ${basis}`,
58
+ ...(timeZoneNote ? [timeZoneNote] : []),
55
59
  // local_time already carries the date in the requested timezone, so
56
60
  // no separate Date column (a machine-local date could disagree).
57
61
  mdTable(['Option', 'Local time', 'UTC', 'Rating', 'Why'], slots.map((slot, index) => [
@@ -63,19 +67,22 @@ export const findSlotTool = {
63
67
  ])),
64
68
  ].join('\n\n');
65
69
  }
66
- const slots = await client.findAvailableSlots(input);
70
+ const result = await client.findAvailableSlots(input);
71
+ const slots = result.slots;
67
72
  if (slots.length === 0) {
68
73
  return mdEmpty('available slots', 'No available posting slots were found in the next 14 days.');
69
74
  }
75
+ const timeZoneNote = slotTimeZoneNote(result);
70
76
  return [
71
77
  mdTitle(`Available posting slots (${slots.length})`),
78
+ ...(timeZoneNote ? [timeZoneNote] : []),
72
79
  mdTable(['Option', 'Local time', 'Date', 'UTC'], slots.map((slot, index) => [
73
80
  index + 1,
74
81
  slot.local_time,
75
- formatDate(slot.time),
82
+ slotLocalDate(slot.time, result.timezone),
76
83
  formatIsoTimestamp(slot.time),
77
84
  ])),
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.',
85
+ timeZoneNote ? SLOT_SCHEDULE_HINT : `${SLOT_SCHEDULE_HINT} ${SLOT_UNKNOWN_TIMEZONE_HINT}`,
79
86
  ].join('\n\n');
80
87
  },
81
88
  };
@@ -16,11 +16,11 @@ export declare const listBrandsTool: {
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  workspace_id?: string | undefined;
18
18
  brand_id?: string | undefined;
19
- view?: "brand" | "accounts" | "brands" | "profile" | undefined;
19
+ view?: "brand" | "profile" | "accounts" | "brands" | undefined;
20
20
  }, {
21
21
  workspace_id?: string | undefined;
22
22
  brand_id?: string | undefined;
23
- view?: "brand" | "accounts" | "brands" | "profile" | undefined;
23
+ view?: "brand" | "profile" | "accounts" | "brands" | undefined;
24
24
  }>;
25
25
  /** The old tools' exact input schemas, for alias calls (see alias-transport.ts). */
26
26
  legacySchemas: {
@@ -35,8 +35,8 @@ export declare const listCommentsTool: {
35
35
  workspace_id?: string | undefined;
36
36
  limit?: number | undefined;
37
37
  offset?: number | undefined;
38
- since?: string | undefined;
39
38
  filter?: "all" | "unread" | "flagged" | undefined;
39
+ since?: string | undefined;
40
40
  search?: string | undefined;
41
41
  until?: string | undefined;
42
42
  comment_id?: string | undefined;
@@ -46,8 +46,8 @@ export declare const listCommentsTool: {
46
46
  workspace_id?: string | undefined;
47
47
  limit?: number | undefined;
48
48
  offset?: number | undefined;
49
- since?: string | undefined;
50
49
  filter?: "all" | "unread" | "flagged" | undefined;
50
+ since?: string | undefined;
51
51
  search?: string | undefined;
52
52
  until?: string | undefined;
53
53
  comment_id?: string | undefined;
@@ -40,8 +40,8 @@ export declare const listConversationsTool: {
40
40
  workspace_id?: string | undefined;
41
41
  limit?: number | undefined;
42
42
  offset?: number | undefined;
43
- since?: string | undefined;
44
43
  filter?: "all" | "unread" | "starred" | "archived" | undefined;
44
+ since?: string | undefined;
45
45
  search?: string | undefined;
46
46
  until?: string | undefined;
47
47
  conversation_id?: string | undefined;
@@ -51,8 +51,8 @@ export declare const listConversationsTool: {
51
51
  workspace_id?: string | undefined;
52
52
  limit?: number | undefined;
53
53
  offset?: number | undefined;
54
- since?: string | undefined;
55
54
  filter?: "all" | "unread" | "starred" | "archived" | undefined;
55
+ since?: string | undefined;
56
56
  search?: string | undefined;
57
57
  until?: string | undefined;
58
58
  conversation_id?: string | undefined;
@@ -6,7 +6,7 @@ import { validateArgs } from '../lib/tool-runtime.js';
6
6
  const NPM_LATEST_URL = 'https://registry.npmjs.org/posterly-mcp-server/latest';
7
7
  export const whoamiTool = {
8
8
  name: 'whoami',
9
- description: 'Who you are and how posterly is connected. view=identity (default): the authenticated user, API key scopes, workspaces, and onboarding next step. Pass include=api_keys to also list this account\'s API keys (name, prefix, scopes, created, last used). The secret is never included. Call this first. If onboarding.completed is false, run onboarding IN THIS conversation: ask what to call the user and their IANA timezone, save them with complete_onboarding, then offer create_connect_session; do not send the user to /onboarding-v2. If onboarding.completed is true, never ask the onboarding questions again. view=status: MCP server version, latest npm version, endpoint and API key health, and update guidance; works before POSTERLY_API_KEY is configured.',
9
+ description: 'Who you are and how posterly is connected. view=identity (default): the authenticated user, API key scopes, workspaces, and onboarding next step. Pass include=api_keys to also list this account\'s API keys (name, prefix, scopes, created, last used). The secret is never included. Call this first. If onboarding.completed is false, run onboarding IN THIS conversation before scheduling anything: ask what to call the user and their IANA timezone, save them with complete_onboarding, then offer create_connect_session; do not send the user to /onboarding-v2. If onboarding.completed is true, never ask the onboarding questions again. view=status: MCP server version, latest npm version, endpoint and API key health, and update guidance; works before POSTERLY_API_KEY is configured.',
10
10
  inputSchema: z.object({
11
11
  view: z
12
12
  .enum(['identity', 'status'])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posterly-mcp-server",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
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.63.0",
6
+ "version": "0.64.0",
7
7
  "websiteUrl": "https://www.poster.ly/mcp",
8
8
  "icons": [
9
9
  {
@@ -22,7 +22,7 @@
22
22
  {
23
23
  "registryType": "npm",
24
24
  "identifier": "posterly-mcp-server",
25
- "version": "0.63.0",
25
+ "version": "0.64.0",
26
26
  "transport": {
27
27
  "type": "stdio"
28
28
  },