posterly-mcp-server 0.54.4 → 0.55.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 +48 -5
- package/dist/generated/platform-manifest.d.ts +4 -4
- package/dist/generated/platform-manifest.js +9 -4
- package/dist/index.js +15 -2
- package/dist/lib/alias-transport.js +4 -0
- package/dist/lib/api-client.d.ts +152 -0
- package/dist/lib/api-client.js +88 -0
- package/dist/lib/claude-directory-profile.js +4 -2
- package/dist/lib/format.d.ts +44 -0
- package/dist/lib/format.js +125 -5
- package/dist/lib/gbp-location-preview.d.ts +21 -0
- package/dist/lib/gbp-location-preview.js +27 -0
- package/dist/lib/google-business-review-name.d.ts +36 -0
- package/dist/lib/google-business-review-name.js +83 -0
- package/dist/lib/id-schema.d.ts +14 -0
- package/dist/lib/id-schema.js +82 -0
- package/dist/lib/id-text.d.ts +26 -0
- package/dist/lib/id-text.js +63 -0
- package/dist/lib/reply-window.d.ts +5 -0
- package/dist/lib/reply-window.js +14 -0
- package/dist/lib/service-area-text.d.ts +27 -0
- package/dist/lib/service-area-text.js +41 -0
- package/dist/lib/suggestion-accept-note.d.ts +10 -0
- package/dist/lib/suggestion-accept-note.js +17 -0
- package/dist/lib/tool-registry.js +19 -2
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/tools/audit-google-business-profile.js +7 -3
- package/dist/tools/connect-account.d.ts +2 -2
- package/dist/tools/create-connect-session.d.ts +2 -2
- package/dist/tools/create-post.d.ts +6 -6
- package/dist/tools/create-posts-batch.d.ts +4 -4
- package/dist/tools/create-webhook.d.ts +3 -3
- package/dist/tools/delete-post.d.ts +4 -4
- package/dist/tools/dismiss-suggestion.d.ts +7 -0
- package/dist/tools/dismiss-suggestion.js +21 -2
- package/dist/tools/find-slot.js +7 -4
- package/dist/tools/get-post.js +56 -5
- package/dist/tools/list-accounts.d.ts +4 -0
- package/dist/tools/list-accounts.js +25 -6
- package/dist/tools/list-analytics.d.ts +4 -0
- package/dist/tools/list-analytics.js +29 -7
- package/dist/tools/list-comments.d.ts +10 -0
- package/dist/tools/list-comments.js +54 -22
- package/dist/tools/list-conversations.d.ts +19 -4
- package/dist/tools/list-conversations.js +55 -15
- package/dist/tools/list-google-business-locations.d.ts +27 -0
- package/dist/tools/list-google-business-locations.js +35 -0
- package/dist/tools/list-google-business-media.d.ts +8 -0
- package/dist/tools/list-google-business-media.js +19 -5
- package/dist/tools/list-google-business-reviews.js +12 -2
- package/dist/tools/list-google-business-service-areas.d.ts +37 -0
- package/dist/tools/list-google-business-service-areas.js +33 -0
- package/dist/tools/list-media.js +3 -2
- package/dist/tools/list-platforms.d.ts +10 -10
- package/dist/tools/list-post-suggestions.js +5 -4
- package/dist/tools/list-posts.d.ts +8 -2
- package/dist/tools/list-posts.js +12 -2
- package/dist/tools/list-webhooks.d.ts +18 -1
- package/dist/tools/list-webhooks.js +22 -3
- package/dist/tools/list-workspace-members.js +3 -1
- package/dist/tools/manage-brands.d.ts +47 -0
- package/dist/tools/manage-brands.js +89 -0
- package/dist/tools/manage-comment.js +5 -1
- package/dist/tools/manage-google-business-location.d.ts +123 -0
- package/dist/tools/manage-google-business-location.js +97 -0
- package/dist/tools/manage-google-business-media.js +2 -0
- package/dist/tools/manage-google-business-review.js +31 -5
- package/dist/tools/manage-google-business-service-area.d.ts +74 -0
- package/dist/tools/manage-google-business-service-area.js +79 -0
- package/dist/tools/manage-webhook.d.ts +6 -6
- package/dist/tools/manage-x-posting-addon.d.ts +47 -0
- package/dist/tools/manage-x-posting-addon.js +92 -0
- package/dist/tools/trigger-platform-helper.d.ts +5 -5
- package/dist/tools/update-post.d.ts +14 -6
- package/dist/tools/update-post.js +23 -2
- package/dist/tools/upload-media.d.ts +12 -0
- package/dist/tools/upload-media.js +39 -3
- package/dist/tools/validate-post.d.ts +4 -4
- package/dist/tools/webhook-events.d.ts +2 -2
- package/dist/tools/webhook-events.js +2 -0
- package/dist/tools/whoami.d.ts +4 -0
- package/dist/tools/whoami.js +14 -6
- package/package.json +1 -1
- package/server.json +2 -2
- package/tool-annotations.json +21 -2
- package/tool-registry.json +251 -8
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { formatLocalDateTime, truncateText } from '../lib/format.js';
|
|
3
|
+
import { replyWindowPhrase } from '../lib/reply-window.js';
|
|
3
4
|
import { validateArgs } from '../lib/tool-runtime.js';
|
|
4
|
-
const INBOX_PLATFORMS = ['instagram', 'facebook'
|
|
5
|
+
const INBOX_PLATFORMS = ['instagram', 'facebook'];
|
|
5
6
|
/**
|
|
6
7
|
* The shared `InboxConversationsResponse`/`InboxCommentsResponse` types
|
|
7
8
|
* don't declare `workspaces_skipped` (a plain pass-through field from the
|
|
@@ -19,18 +20,59 @@ function describeSkippedWorkspaces(result) {
|
|
|
19
20
|
});
|
|
20
21
|
return [`Skipped ${skipped.length} workspace${skipped.length === 1 ? '' : 's'} you belong to:`, ...lines].join('\n');
|
|
21
22
|
}
|
|
23
|
+
/** "on @account (Workspace)" for a list row, or null when the API sent neither. */
|
|
24
|
+
function ownerLabel(row) {
|
|
25
|
+
const account = typeof row.account_username === 'string' && row.account_username ? `@${row.account_username}` : '';
|
|
26
|
+
const workspace = typeof row.workspace_name === 'string' && row.workspace_name ? row.workspace_name : '';
|
|
27
|
+
if (account && workspace)
|
|
28
|
+
return `on ${account} (${workspace})`;
|
|
29
|
+
if (account || workspace)
|
|
30
|
+
return `on ${account || workspace}`;
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One list line for a DM conversation: when, account, participant ("(no
|
|
35
|
+
* handle)" when missing), and a preview that starts with "you: " when the
|
|
36
|
+
* business sent the last message and falls back to [media] / [unsupported]
|
|
37
|
+
* when there is no text.
|
|
38
|
+
*/
|
|
39
|
+
export function formatConversationListLine(conversation) {
|
|
40
|
+
const username = typeof conversation.participant_username === 'string' && conversation.participant_username
|
|
41
|
+
? `@${conversation.participant_username}`
|
|
42
|
+
: '(no handle)';
|
|
43
|
+
const platform = typeof conversation.platform === 'string' ? conversation.platform : 'unknown';
|
|
44
|
+
const unread = conversation.is_read === false ? 'unread' : 'read';
|
|
45
|
+
const last = (conversation.last_message ?? null);
|
|
46
|
+
const rawPreview = typeof conversation.last_message_preview === 'string' ? conversation.last_message_preview.trim() : '';
|
|
47
|
+
let preview = rawPreview
|
|
48
|
+
? truncateText(rawPreview, 80)
|
|
49
|
+
: last?.is_unsupported
|
|
50
|
+
? '[unsupported]'
|
|
51
|
+
: last?.has_media
|
|
52
|
+
? '[media]'
|
|
53
|
+
: truncateText('', 80);
|
|
54
|
+
if (last?.sender_is_business && preview !== '(empty)')
|
|
55
|
+
preview = `you: ${preview}`;
|
|
56
|
+
const when = typeof conversation.last_message_at === 'string' && conversation.last_message_at ? `[${formatLocalDateTime(conversation.last_message_at)}]` : null;
|
|
57
|
+
const owner = ownerLabel(conversation);
|
|
58
|
+
const window = replyWindowPhrase(conversation.window_expires_at);
|
|
59
|
+
const line = `- ${[String(conversation.id), when].filter(Boolean).join(' ')} (${[platform, owner, username, unread].filter(Boolean).join(', ')}): ${preview}`;
|
|
60
|
+
return window ? `${line} (${window})` : line;
|
|
61
|
+
}
|
|
22
62
|
export const listConversationsTool = {
|
|
23
63
|
name: 'list_conversations',
|
|
24
|
-
description: 'Social inbox DM conversations for Instagram and Facebook Page inboxes (Threads has no DMs; Pro plan or higher plus posts:read). Without conversation_id: list conversations filtered by account, platform, unread/starred/archived, or
|
|
64
|
+
description: 'Social inbox DM conversations for Instagram and Facebook Page inboxes (Threads has no DMs; Pro plan or higher plus posts:read). Without conversation_id: list conversations filtered by account, platform, unread/starred/archived, search, or since/until dates, with limit/offset paging. With conversation_id: one conversation and its messages; there limit is the number of messages (default 50, max 100) and only workspace_id may be added. When a sync has stored it, each conversation includes the Meta reply window (open until a UTC time, or closed). A reply does not extend that window, and it is not guessed from the messages loaded in the thread.',
|
|
25
65
|
inputSchema: z.object({
|
|
26
|
-
conversation_id: z.string().min(1).optional().describe('One conversation
|
|
27
|
-
workspace_id: z.string().optional().describe('
|
|
28
|
-
account_id: z.number().int().positive().optional().describe('
|
|
29
|
-
platform: z.enum(INBOX_PLATFORMS).optional().describe('
|
|
30
|
-
filter: z.enum(['all', 'unread', 'starred', 'archived']).optional().describe('
|
|
66
|
+
conversation_id: z.string().min(1).optional().describe('One conversation and its messages.'),
|
|
67
|
+
workspace_id: z.string().optional().describe('Omit to search all your workspaces, or pass an ID from whoami.'),
|
|
68
|
+
account_id: z.number().int().positive().optional().describe('From list_accounts.'),
|
|
69
|
+
platform: z.enum(INBOX_PLATFORMS).optional().describe('Instagram or Facebook. Threads has comments, not DMs.'),
|
|
70
|
+
filter: z.enum(['all', 'unread', 'starred', 'archived']).optional().describe('Default all (excludes archived).'),
|
|
31
71
|
search: z.string().optional().describe('Search participant username or last message preview.'),
|
|
32
|
-
limit: z.number().int().min(1).max(100).optional().describe('
|
|
33
|
-
offset: z.number().int().min(0).optional().describe('
|
|
72
|
+
limit: z.number().int().min(1).max(100).optional().describe('Rows (messages with conversation_id). Default 50.'),
|
|
73
|
+
offset: z.number().int().min(0).optional().describe('Rows to skip.'),
|
|
74
|
+
since: z.string().optional().describe('ISO date/time, inclusive.'),
|
|
75
|
+
until: z.string().optional().describe('ISO date/time, inclusive.'),
|
|
34
76
|
}),
|
|
35
77
|
/** The old tools' exact input schemas, for alias calls (see alias-transport.ts). */
|
|
36
78
|
legacySchemas: {
|
|
@@ -58,11 +100,7 @@ async function conversationList(client, input) {
|
|
|
58
100
|
}
|
|
59
101
|
const lines = [`Inbox conversations (showing ${result.conversations.length} of ${result.total}):`];
|
|
60
102
|
for (const conversation of result.conversations) {
|
|
61
|
-
|
|
62
|
-
const platform = typeof conversation.platform === 'string' ? conversation.platform : 'unknown';
|
|
63
|
-
const unread = conversation.is_read === false ? 'unread' : 'read';
|
|
64
|
-
const preview = truncateText(typeof conversation.last_message_preview === 'string' ? conversation.last_message_preview : '', 80);
|
|
65
|
-
lines.push(`- ${String(conversation.id)} (${platform}, ${username}, ${unread}): ${preview}`);
|
|
103
|
+
lines.push(formatConversationListLine(conversation));
|
|
66
104
|
}
|
|
67
105
|
if (result.hasMore) {
|
|
68
106
|
const nextOffset = (input.offset ?? 0) + result.conversations.length;
|
|
@@ -76,14 +114,16 @@ async function oneConversation(client, input) {
|
|
|
76
114
|
const result = await client.getConversation(input);
|
|
77
115
|
const conversation = result.conversation;
|
|
78
116
|
const username = typeof conversation.participant_username === 'string' ? `@${conversation.participant_username}` : 'unknown';
|
|
117
|
+
const window = replyWindowPhrase(conversation.window_expires_at);
|
|
79
118
|
const lines = [
|
|
80
119
|
`Conversation ${String(conversation.id)}`,
|
|
81
120
|
`• Platform: ${typeof conversation.platform === 'string' ? conversation.platform : 'unknown'}`,
|
|
82
121
|
`• Participant: ${username}`,
|
|
83
122
|
`• Read: ${conversation.is_read === false ? 'no' : 'yes'}`,
|
|
123
|
+
window ? `• Reply window: ${window}` : null,
|
|
84
124
|
`• Messages: ${result.messages.length}`,
|
|
85
125
|
'',
|
|
86
|
-
];
|
|
126
|
+
].filter((line) => line !== null);
|
|
87
127
|
for (const message of result.messages) {
|
|
88
128
|
const who = message.sender_is_business ? 'you' : (typeof message.sender_username === 'string' ? message.sender_username : 'them');
|
|
89
129
|
const when = formatLocalDateTime(typeof message.sent_at === 'string' ? message.sent_at : null);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
import { type ToolContext } from '../lib/tool-runtime.js';
|
|
4
|
+
type ListLocationInput = {
|
|
5
|
+
workspace_id?: string;
|
|
6
|
+
account_id?: number;
|
|
7
|
+
location_id?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const listGoogleBusinessLocationsTool: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: z.ZodObject<{
|
|
13
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
14
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
location_id: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
account_id?: number | undefined;
|
|
18
|
+
workspace_id?: string | undefined;
|
|
19
|
+
location_id?: string | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
account_id?: number | undefined;
|
|
22
|
+
workspace_id?: string | undefined;
|
|
23
|
+
location_id?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
execute(client: PosterlyClient, input: ListLocationInput, ctx: ToolContext): Promise<string>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { code, mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
|
|
3
|
+
import { validateArgs } from '../lib/tool-runtime.js';
|
|
4
|
+
const LOCATION_ID_DESCRIPTION = 'Google Business numeric location id (the location_id/platform_user_id from list_accounts, e.g. "197940849675145390"). NOT the ChIJ... Place ID from list_google_business_reviews view=review_link. Prefer account_id.';
|
|
5
|
+
export const listGoogleBusinessLocationsTool = {
|
|
6
|
+
name: 'list_google_business_locations',
|
|
7
|
+
description: 'Read regular opening hours and attributes for one Google Business location. Stays off until location edits are switched on, and does not call Google while it is off. Pass account_id or location_id. Does not return the business name, address, phone, or website.',
|
|
8
|
+
inputSchema: z.object({
|
|
9
|
+
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
10
|
+
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
|
|
11
|
+
location_id: z.string().optional().describe(LOCATION_ID_DESCRIPTION),
|
|
12
|
+
}),
|
|
13
|
+
async execute(client, input, ctx) {
|
|
14
|
+
const { args } = validateArgs(ctx, 'list_google_business_locations', input);
|
|
15
|
+
const result = await client.listGoogleBusinessLocation(args);
|
|
16
|
+
if (result.enabled !== true) {
|
|
17
|
+
return 'Google Business location edits are switched off. Nothing was read from Google.';
|
|
18
|
+
}
|
|
19
|
+
const periods = Array.isArray(result.regular_hours?.periods) ? result.regular_hours.periods : [];
|
|
20
|
+
const attributes = Array.isArray(result.attributes) ? result.attributes : [];
|
|
21
|
+
return [
|
|
22
|
+
mdTitle('Google Business location'),
|
|
23
|
+
mdSection('Location', mdKeyValue([
|
|
24
|
+
['Account ID', result.account_id != null ? code(result.account_id) : undefined],
|
|
25
|
+
['Location', result.location ? code(String(result.location)) : undefined],
|
|
26
|
+
])),
|
|
27
|
+
mdSection('Regular hours', periods.length
|
|
28
|
+
? periods.map((period) => `- ${period.open_day} ${period.open_time} to ${period.close_day} ${period.close_time}`).join('\n')
|
|
29
|
+
: 'No regular hours saved.'),
|
|
30
|
+
mdSection('Attributes', attributes.length
|
|
31
|
+
? attributes.map((attribute) => `- ${attribute.name} (${attribute.value_type}): ${(attribute.values || []).join(', ')}`).join('\n')
|
|
32
|
+
: 'No attributes saved.'),
|
|
33
|
+
].join('\n\n');
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -7,18 +7,26 @@ export declare const listGoogleBusinessMediaTool: {
|
|
|
7
7
|
workspace_id: z.ZodOptional<z.ZodString>;
|
|
8
8
|
account_id: z.ZodOptional<z.ZodNumber>;
|
|
9
9
|
location_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
10
12
|
}, "strip", z.ZodTypeAny, {
|
|
11
13
|
account_id?: number | undefined;
|
|
12
14
|
workspace_id?: string | undefined;
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
offset?: number | undefined;
|
|
13
17
|
location_id?: string | undefined;
|
|
14
18
|
}, {
|
|
15
19
|
account_id?: number | undefined;
|
|
16
20
|
workspace_id?: string | undefined;
|
|
21
|
+
limit?: number | undefined;
|
|
22
|
+
offset?: number | undefined;
|
|
17
23
|
location_id?: string | undefined;
|
|
18
24
|
}>;
|
|
19
25
|
execute(client: PosterlyClient, input: {
|
|
20
26
|
workspace_id?: string;
|
|
21
27
|
account_id?: number;
|
|
22
28
|
location_id?: string;
|
|
29
|
+
limit?: number;
|
|
30
|
+
offset?: number;
|
|
23
31
|
}): Promise<string>;
|
|
24
32
|
};
|
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const listGoogleBusinessMediaTool = {
|
|
3
3
|
name: 'list_google_business_media',
|
|
4
|
-
description: 'List the photos and videos on a Google Business Profile gallery (the media shown on Maps and Search) for one location/account or every accessible GBP location. This is separate from media attached to a post. Returns each item\'s resource name, category, format, and
|
|
4
|
+
description: 'List the photos and videos on a Google Business Profile gallery (the media shown on Maps and Search) for one location/account or every accessible GBP location. This is separate from media attached to a post. Returns each item\'s resource name, category, format, image URL, and date. Pages the gallery already fetched from Google: limit defaults to 50 (max 200) and offset skips that many items.',
|
|
5
5
|
inputSchema: z.object({
|
|
6
6
|
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
7
7
|
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts.'),
|
|
8
8
|
location_id: z.string().optional().describe('Google Business numeric location id (the location_id/platform_user_id from list_accounts, e.g. "197940849675145390"). NOT the ChIJ... Place ID from list_google_business_reviews view=review_link. Prefer account_id.'),
|
|
9
|
+
limit: z.number().int().min(1).max(200).optional().describe('Items per page. Default 50, max 200. This pages the gallery already fetched; it does not ask Google for a smaller page.'),
|
|
10
|
+
offset: z.number().int().min(0).optional().describe('Items to skip. Use the offset the previous page gives.'),
|
|
9
11
|
}),
|
|
10
12
|
async execute(client, input) {
|
|
11
13
|
const result = await client.listGoogleBusinessMedia(input);
|
|
12
|
-
|
|
14
|
+
const media = result.media || [];
|
|
15
|
+
if (media.length === 0) {
|
|
13
16
|
return 'No photos or videos found on the Google Business profile for your filters.';
|
|
14
17
|
}
|
|
15
|
-
const
|
|
16
|
-
|
|
18
|
+
const offset = Math.max(0, Math.trunc(input.offset ?? 0) || 0);
|
|
19
|
+
const limit = Math.min(200, Math.max(1, Math.trunc(input.limit ?? 50) || 50));
|
|
20
|
+
const slice = media.slice(offset, offset + limit);
|
|
21
|
+
if (slice.length === 0) {
|
|
22
|
+
return `No Google Business media on this page: offset ${offset} is past the last of the ${media.length} items.`;
|
|
23
|
+
}
|
|
24
|
+
const lines = [`Google Business profile media (showing ${slice.length} of ${media.length}):`];
|
|
25
|
+
for (const item of slice) {
|
|
17
26
|
const kind = item.mediaFormat === 'VIDEO' ? 'video' : 'photo';
|
|
18
27
|
const category = item.category || 'uncategorised';
|
|
19
28
|
const attribution = item.attribution?.profileName ? ` by ${item.attribution.profileName}` : '';
|
|
20
|
-
|
|
29
|
+
const image = item.googleUrl || item.thumbnailUrl;
|
|
30
|
+
const when = item.createTime ? ` added ${item.createTime}` : '';
|
|
31
|
+
lines.push(`- [${kind}] ${category}${attribution}${when}${image ? ` ${image}` : ''} :: ${item.name}`);
|
|
32
|
+
}
|
|
33
|
+
if (offset + slice.length < media.length) {
|
|
34
|
+
lines.push('', `More items available. Call again with offset: ${offset + slice.length} to continue.`);
|
|
21
35
|
}
|
|
22
36
|
lines.push('', 'Use the resource name (after ::) as media_name to delete an item.');
|
|
23
37
|
return lines.join('\n');
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { formatDate } from '../lib/format.js';
|
|
3
|
+
import { reviewNameFromListItem, reviewReplyComment } from '../lib/google-business-review-name.js';
|
|
3
4
|
import { validateArgs } from '../lib/tool-runtime.js';
|
|
4
5
|
/** Matches GOOGLE_BUSINESS_REVIEWS_MAX_LIMIT in lib/api-v1-google-business.ts. */
|
|
5
6
|
const MAX_LIMIT = 1000;
|
|
6
7
|
export const listGoogleBusinessReviewsTool = {
|
|
7
8
|
name: 'list_google_business_reviews',
|
|
8
|
-
description: 'Google Business Profile reviews. view=reviews (default): reviews for one location/account or every accessible GBP location, paging through all reviews Google has (not just the first 50) with the full untruncated review text, its date, and each location\'s total review count; filter by rating or unanswered, page with limit/offset. view=review_link (account_id or location_id): the direct public Google review link plus the Google Place ID (ChIJ...); that Place ID is output only and must NOT be passed back as location_id.',
|
|
9
|
+
description: 'Google Business Profile reviews. view=reviews (default): reviews for one location/account or every accessible GBP location, paging through all reviews Google has (not just the first 50) with the full untruncated review text, its date, and each location\'s total review count; filter by rating or unanswered, page with limit/offset. Each review has review_name for manage_google_business_review reply/delete_reply. view=review_link (account_id or location_id): the direct public Google review link plus the Google Place ID (ChIJ...); that Place ID is output only and must NOT be passed back as location_id.',
|
|
9
10
|
inputSchema: z.object({
|
|
10
11
|
view: z.enum(['reviews', 'review_link']).optional().describe('reviews (default) or review_link.'),
|
|
11
12
|
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
@@ -75,8 +76,17 @@ async function reviews(client, input) {
|
|
|
75
76
|
const rating = review.starRating ? `${review.starRating} stars` : 'unrated';
|
|
76
77
|
const location = review.businessName || review.locationName || review.locationId || 'location';
|
|
77
78
|
const date = formatReviewDate(review);
|
|
78
|
-
const
|
|
79
|
+
const replyComment = reviewReplyComment(review);
|
|
80
|
+
const replied = replyComment ? `reply: ${replyComment}` : (review.reviewReply ? 'replied' : 'unanswered');
|
|
79
81
|
lines.push(`- ${name} (${rating}, ${date}, ${location}, ${replied})`);
|
|
82
|
+
const reviewName = reviewNameFromListItem(review);
|
|
83
|
+
if (reviewName)
|
|
84
|
+
lines.push(` review_name: ${reviewName}`);
|
|
85
|
+
if (review.account_id != null && String(review.account_id) !== '') {
|
|
86
|
+
lines.push(` account_id: ${String(review.account_id)}`);
|
|
87
|
+
}
|
|
88
|
+
if (review.locationId)
|
|
89
|
+
lines.push(` location_id: ${review.locationId}`);
|
|
80
90
|
// Full review text, no truncation; collapse whitespace only so the
|
|
81
91
|
// bullet list stays readable for multi-paragraph reviews.
|
|
82
92
|
if (review.comment) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
import { type ToolContext } from '../lib/tool-runtime.js';
|
|
4
|
+
export declare const listGoogleBusinessServiceAreasTool: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: z.ZodObject<{
|
|
8
|
+
view: z.ZodOptional<z.ZodEnum<["areas", "places"]>>;
|
|
9
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
location_id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
q: z.ZodOptional<z.ZodString>;
|
|
13
|
+
region_code: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
account_id?: number | undefined;
|
|
16
|
+
workspace_id?: string | undefined;
|
|
17
|
+
location_id?: string | undefined;
|
|
18
|
+
q?: string | undefined;
|
|
19
|
+
region_code?: string | undefined;
|
|
20
|
+
view?: "areas" | "places" | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
account_id?: number | undefined;
|
|
23
|
+
workspace_id?: string | undefined;
|
|
24
|
+
location_id?: string | undefined;
|
|
25
|
+
q?: string | undefined;
|
|
26
|
+
region_code?: string | undefined;
|
|
27
|
+
view?: "areas" | "places" | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
execute(client: PosterlyClient, input: {
|
|
30
|
+
view?: "areas" | "places";
|
|
31
|
+
workspace_id?: string;
|
|
32
|
+
account_id?: number;
|
|
33
|
+
location_id?: string;
|
|
34
|
+
q?: string;
|
|
35
|
+
region_code?: string;
|
|
36
|
+
}, ctx: ToolContext): Promise<string>;
|
|
37
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { formatGoogleBusinessServiceArea, formatGoogleBusinessServiceAreaPlaces } from '../lib/service-area-text.js';
|
|
3
|
+
import { validateArgs } from '../lib/tool-runtime.js';
|
|
4
|
+
const LOCATION_ID_DESCRIPTION = 'Google Business numeric location id (the location_id/platform_user_id from list_accounts, e.g. "197940849675145390"). NOT the ChIJ... Place ID from list_google_business_reviews view=review_link. Prefer account_id.';
|
|
5
|
+
export const listGoogleBusinessServiceAreasTool = {
|
|
6
|
+
name: 'list_google_business_service_areas',
|
|
7
|
+
description: 'Read Google Business service areas (the towns and postcodes a location covers, up to 20). view=areas (default): the current business type, country, and place list for one location. view=places (q required): search for a town or postcode to add. Place IDs from view=places are regions, not the review-link Place ID. Town search needs a maps key on the server; if it is missing, add a place with its Place ID and name on the update instead.',
|
|
8
|
+
inputSchema: z.object({
|
|
9
|
+
view: z.enum(['areas', 'places']).optional().describe('areas (default) or places (search).'),
|
|
10
|
+
workspace_id: z.string().optional().describe('Filter to a workspace ID from whoami.'),
|
|
11
|
+
account_id: z.number().int().positive().optional().describe('Google Business account ID from list_accounts. Required for view=areas.'),
|
|
12
|
+
location_id: z.string().optional().describe(LOCATION_ID_DESCRIPTION),
|
|
13
|
+
q: z.string().min(2).optional().describe('places: town or postcode to search for.'),
|
|
14
|
+
region_code: z.string().optional().describe('places: optional two-letter country code, for example GB.'),
|
|
15
|
+
}),
|
|
16
|
+
async execute(client, input, ctx) {
|
|
17
|
+
const { mode, args } = validateArgs(ctx, 'list_google_business_service_areas', input);
|
|
18
|
+
if (mode === 'places') {
|
|
19
|
+
const result = await client.searchGoogleBusinessServiceAreaPlaces({
|
|
20
|
+
workspace_id: args.workspace_id,
|
|
21
|
+
q: args.q,
|
|
22
|
+
region_code: args.region_code,
|
|
23
|
+
});
|
|
24
|
+
return formatGoogleBusinessServiceAreaPlaces(result);
|
|
25
|
+
}
|
|
26
|
+
const result = await client.getGoogleBusinessServiceArea({
|
|
27
|
+
workspace_id: args.workspace_id,
|
|
28
|
+
account_id: args.account_id,
|
|
29
|
+
location_id: args.location_id,
|
|
30
|
+
});
|
|
31
|
+
return formatGoogleBusinessServiceArea(result);
|
|
32
|
+
},
|
|
33
|
+
};
|
package/dist/tools/list-media.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { formatPagingNote } from '../lib/format.js';
|
|
3
3
|
export const listMediaTool = {
|
|
4
4
|
name: 'list_media',
|
|
5
|
-
description: 'List the newest media assets for the authenticated user. After create_media_drop, pass drop_session_id to see files the human uploaded on /drop/<token>. Use public_url with validate_post / create_post. A drop listing returns up to 20 files per page by default so a full drop fits one page. The output says whether every matching file is shown; page with offset (offset + limit up to 1000) when it is not.',
|
|
5
|
+
description: 'List the newest media assets for the authenticated user. After create_media_drop, pass drop_session_id to see files the human uploaded on /drop/<token>. Each file includes its filename and the time it was added. Use public_url with validate_post / create_post. A drop listing returns up to 20 files per page by default so a full drop fits one page. The output says whether every matching file is shown; page with offset (offset + limit up to 1000) when it is not.',
|
|
6
6
|
inputSchema: z.object({
|
|
7
7
|
limit: z
|
|
8
8
|
.number()
|
|
@@ -37,7 +37,8 @@ export const listMediaTool = {
|
|
|
37
37
|
const lines = result.media.map((item) => {
|
|
38
38
|
const size = typeof item.bytes === 'number' ? `${item.bytes} bytes` : 'unknown size';
|
|
39
39
|
const drop = item.drop_session_id ? ` drop=${item.drop_session_id}` : '';
|
|
40
|
-
|
|
40
|
+
const added = item.created_at ? `, added ${item.created_at}` : '';
|
|
41
|
+
return `• ${item.filename} (${item.mime || 'unknown'}, ${size}${added})${drop}\n public_url: ${item.public_url}`;
|
|
41
42
|
});
|
|
42
43
|
const offset = result.offset ?? input.offset ?? 0;
|
|
43
44
|
return [
|
|
@@ -22,21 +22,21 @@ export declare const listPlatformsTool: {
|
|
|
22
22
|
include_planned: z.ZodOptional<z.ZodBoolean>;
|
|
23
23
|
debug: z.ZodOptional<z.ZodBoolean>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
25
|
+
platform?: "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" | undefined;
|
|
26
26
|
account_id?: string | undefined;
|
|
27
27
|
workspace_id?: string | undefined;
|
|
28
28
|
include_planned?: boolean | undefined;
|
|
29
|
-
view?: "
|
|
29
|
+
view?: "schema" | "platforms" | "connect_link" | undefined;
|
|
30
30
|
debug?: boolean | undefined;
|
|
31
|
-
target?: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
31
|
+
target?: "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" | undefined;
|
|
32
32
|
}, {
|
|
33
|
-
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
33
|
+
platform?: "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" | undefined;
|
|
34
34
|
account_id?: string | undefined;
|
|
35
35
|
workspace_id?: string | undefined;
|
|
36
36
|
include_planned?: boolean | undefined;
|
|
37
|
-
view?: "
|
|
37
|
+
view?: "schema" | "platforms" | "connect_link" | undefined;
|
|
38
38
|
debug?: boolean | undefined;
|
|
39
|
-
target?: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
39
|
+
target?: "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" | undefined;
|
|
40
40
|
}>;
|
|
41
41
|
/** The old tools' exact input schemas, for alias calls (see alias-transport.ts). */
|
|
42
42
|
legacySchemas: {
|
|
@@ -45,11 +45,11 @@ export declare const listPlatformsTool: {
|
|
|
45
45
|
platform: z.ZodOptional<z.ZodEnum<["bluesky", "devto", "discord", "facebook", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "lemmy", "linkedin", "mastodon", "medium", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "youtube"]>>;
|
|
46
46
|
include_planned: z.ZodOptional<z.ZodBoolean>;
|
|
47
47
|
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
48
|
+
platform?: "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" | undefined;
|
|
49
49
|
account_id?: string | undefined;
|
|
50
50
|
include_planned?: boolean | undefined;
|
|
51
51
|
}, {
|
|
52
|
-
platform?: "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
52
|
+
platform?: "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" | undefined;
|
|
53
53
|
account_id?: string | undefined;
|
|
54
54
|
include_planned?: boolean | undefined;
|
|
55
55
|
}>;
|
|
@@ -59,12 +59,12 @@ export declare const listPlatformsTool: {
|
|
|
59
59
|
include_planned: z.ZodOptional<z.ZodBoolean>;
|
|
60
60
|
debug: z.ZodOptional<z.ZodBoolean>;
|
|
61
61
|
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
platform?: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
62
|
+
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" | undefined;
|
|
63
63
|
workspace_id?: string | undefined;
|
|
64
64
|
include_planned?: boolean | undefined;
|
|
65
65
|
debug?: boolean | undefined;
|
|
66
66
|
}, {
|
|
67
|
-
platform?: "meta" | "instagram_direct" | "instagram" | "instagram-standalone" | "facebook" | "tiktok" | "twitter" | "threads" | "linkedin" | "youtube" | "pinterest" | "google_business" | "medium" | "x" | "
|
|
67
|
+
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" | undefined;
|
|
68
68
|
workspace_id?: string | undefined;
|
|
69
69
|
include_planned?: boolean | undefined;
|
|
70
70
|
debug?: boolean | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { formatPagingNote, mdTitle, mdSection, mdKeyValue, mdEmpty
|
|
2
|
+
import { formatPagingNote, mdTitle, mdSection, mdKeyValue, mdEmpty } from '../lib/format.js';
|
|
3
3
|
export const listPostSuggestionsTool = {
|
|
4
4
|
name: 'list_post_suggestions',
|
|
5
|
-
description: "List proactive post suggestions: evidence-based weekly drafts posterly writes in each account's learned voice, each with a rationale tying it back to what has performed well for that account. Filter by account_id and status (pending, scheduled, dismissed; default pending). The output says whether every matching suggestion is shown; page with offset until it does. Read-only; requires a Pro plan or higher. Use dismiss_suggestion to hide one.",
|
|
5
|
+
description: "List proactive post suggestions: evidence-based weekly drafts posterly writes in each account's learned voice, each with a rationale tying it back to what has performed well for that account. The caption, rationale, and account id are returned in full. Filter by account_id and status (pending, scheduled, dismissed; default pending). The output says whether every matching suggestion is shown; page with offset until it does. Read-only; requires a Pro plan or higher. Use dismiss_suggestion to hide one, or pass save_as_draft true on that tool to keep it as an unpublished draft.",
|
|
6
6
|
inputSchema: z.object({
|
|
7
7
|
account_id: z
|
|
8
8
|
.union([z.string(), z.number()])
|
|
@@ -27,10 +27,11 @@ export const listPostSuggestionsTool = {
|
|
|
27
27
|
: `account ${suggestion.social_account_id}`;
|
|
28
28
|
return mdSection(label, mdKeyValue([
|
|
29
29
|
['Suggestion ID', suggestion.id],
|
|
30
|
+
['Account ID', String(suggestion.social_account_id)],
|
|
30
31
|
['Status', suggestion.status],
|
|
31
32
|
['Period', suggestion.period_key || undefined],
|
|
32
|
-
['Caption',
|
|
33
|
-
['Rationale', suggestion.rationale ?
|
|
33
|
+
['Caption', suggestion.caption.replace(/\s+/g, ' ').trim()],
|
|
34
|
+
['Rationale', suggestion.rationale ? suggestion.rationale.replace(/\s+/g, ' ').trim() : undefined],
|
|
34
35
|
]));
|
|
35
36
|
});
|
|
36
37
|
const note = formatPagingNote({
|
|
@@ -14,6 +14,8 @@ export declare const listPostsTool: {
|
|
|
14
14
|
inputSchema: z.ZodObject<{
|
|
15
15
|
view: z.ZodOptional<z.ZodEnum<["list", "counts"]>>;
|
|
16
16
|
status: z.ZodOptional<z.ZodString>;
|
|
17
|
+
group_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
release_id: z.ZodOptional<z.ZodString>;
|
|
17
19
|
platform: z.ZodOptional<z.ZodEnum<["bluesky", "devto", "discord", "facebook", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "lemmy", "linkedin", "mastodon", "pinterest", "slack", "telegram", "threads", "tiktok", "twitter", "wordpress", "x", "youtube"]>>;
|
|
18
20
|
account_id: z.ZodOptional<z.ZodString>;
|
|
19
21
|
scheduled_from: z.ZodOptional<z.ZodString>;
|
|
@@ -28,7 +30,9 @@ export declare const listPostsTool: {
|
|
|
28
30
|
brand_id: z.ZodOptional<z.ZodString>;
|
|
29
31
|
}, "strip", z.ZodTypeAny, {
|
|
30
32
|
status?: string | undefined;
|
|
31
|
-
|
|
33
|
+
group_id?: string | undefined;
|
|
34
|
+
release_id?: string | undefined;
|
|
35
|
+
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;
|
|
32
36
|
account_id?: string | undefined;
|
|
33
37
|
workspace_id?: string | undefined;
|
|
34
38
|
approval_status?: "none" | "pending_client" | "approved" | "changes_requested" | "rejected" | undefined;
|
|
@@ -43,7 +47,9 @@ export declare const listPostsTool: {
|
|
|
43
47
|
view?: "list" | "counts" | undefined;
|
|
44
48
|
}, {
|
|
45
49
|
status?: string | undefined;
|
|
46
|
-
|
|
50
|
+
group_id?: string | undefined;
|
|
51
|
+
release_id?: string | undefined;
|
|
52
|
+
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;
|
|
47
53
|
account_id?: string | undefined;
|
|
48
54
|
workspace_id?: string | undefined;
|
|
49
55
|
approval_status?: "none" | "pending_client" | "approved" | "changes_requested" | "rejected" | undefined;
|
package/dist/tools/list-posts.js
CHANGED
|
@@ -3,7 +3,7 @@ import { dashboardUrlForPostList, formatPostCounts, formatPostListPage } from '.
|
|
|
3
3
|
import { validateArgs } from '../lib/tool-runtime.js';
|
|
4
4
|
import { SUPPORTED_PLATFORM_INPUTS, SUPPORTED_PLATFORM_IDS } from '../generated/platform-manifest.js';
|
|
5
5
|
export const LIST_POSTS_DESCRIPTION = 'Posts in your workspaces, teammates\' too, per your role there (brand-locked seats only see their assigned brands). If workspace_id is omitted, this searches every workspace you belong to. ' +
|
|
6
|
-
'view=list (default): posts filtered by status (scheduled, published, failed,
|
|
6
|
+
'view=list (default): posts filtered by status (draft, scheduled, publishing, processing, awaiting_tiktok_publish, awaiting_manual, published, failed, paused, paused_due_to_token, paused_due_to_billing, or missed), platform, account_id, workspace_id, brand_id, group_id, release_id, approval_status, approval_waiting_on, and a scheduled date range: scheduled_from (inclusive) and scheduled_to (a plain date includes that whole day), read in timezone (IANA, default UTC; also the zone times are shown in). status=missed is posts that failed, scheduled posts whose scheduled time is already past, and posts a publishing pause held past their time. group_id matches the caller group (including post_group_id). release_id matches that release only. Returns limit posts (default 20, max 200) starting at offset; with a date range the order defaults to oldest first (order=asc|desc). ' +
|
|
7
7
|
'The output always says whether every matching post was shown. If it says more are available, call again with the offset it gives and keep paging until all are shown before drawing any conclusion about totals, gaps, or how busy a client is. ' +
|
|
8
8
|
'view=counts (scheduled_from and scheduled_to required, up to 366 days): exact totals per day, status, account, and brand for the same filters (limit, offset, and order are ignored); use it for "how many" or "is this month full" questions. ' +
|
|
9
9
|
'Each post includes approval.pending_client_approval.';
|
|
@@ -18,7 +18,15 @@ export const listPostsTool = {
|
|
|
18
18
|
status: z
|
|
19
19
|
.string()
|
|
20
20
|
.optional()
|
|
21
|
-
.describe('
|
|
21
|
+
.describe('Stored post status (draft, scheduled, publishing, processing, awaiting_tiktok_publish, awaiting_manual, published, failed, paused, paused_due_to_token, paused_due_to_billing, or missed). paused_due_to_token is a reconnect pause and paused_due_to_billing is a billing pause. missed: failed, still scheduled after the scheduled time, or held by a publishing pause past it.'),
|
|
22
|
+
group_id: z
|
|
23
|
+
.string()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Caller group id. Matches api_group_id, group_id, and post_group_id.'),
|
|
26
|
+
release_id: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Caller release id. Matches release_id only.'),
|
|
22
30
|
platform: z
|
|
23
31
|
.enum(SUPPORTED_PLATFORM_INPUTS)
|
|
24
32
|
.optional()
|
|
@@ -92,6 +100,8 @@ export const listPostsTool = {
|
|
|
92
100
|
function postFilters(input) {
|
|
93
101
|
return {
|
|
94
102
|
status: input.status,
|
|
103
|
+
group_id: input.group_id,
|
|
104
|
+
release_id: input.release_id,
|
|
95
105
|
platform: input.platform,
|
|
96
106
|
account_id: input.account_id,
|
|
97
107
|
workspace_id: input.workspace_id,
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { PosterlyClient } from '../lib/api-client.js';
|
|
3
|
+
import { type ToolContext } from '../lib/tool-runtime.js';
|
|
3
4
|
export declare const listWebhooksTool: {
|
|
4
5
|
name: string;
|
|
5
6
|
description: string;
|
|
6
7
|
inputSchema: z.ZodObject<{
|
|
8
|
+
view: z.ZodOptional<z.ZodEnum<["webhooks", "deliveries"]>>;
|
|
7
9
|
workspace_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
webhook_id: z.ZodOptional<z.ZodString>;
|
|
11
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
8
13
|
}, "strip", z.ZodTypeAny, {
|
|
9
14
|
workspace_id?: string | undefined;
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
offset?: number | undefined;
|
|
17
|
+
view?: "webhooks" | "deliveries" | undefined;
|
|
18
|
+
webhook_id?: string | undefined;
|
|
10
19
|
}, {
|
|
11
20
|
workspace_id?: string | undefined;
|
|
21
|
+
limit?: number | undefined;
|
|
22
|
+
offset?: number | undefined;
|
|
23
|
+
view?: "webhooks" | "deliveries" | undefined;
|
|
24
|
+
webhook_id?: string | undefined;
|
|
12
25
|
}>;
|
|
13
26
|
execute(client: PosterlyClient, input: {
|
|
27
|
+
view?: "webhooks" | "deliveries";
|
|
14
28
|
workspace_id?: string;
|
|
15
|
-
|
|
29
|
+
webhook_id?: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
offset?: number;
|
|
32
|
+
}, ctx: ToolContext): Promise<string>;
|
|
16
33
|
};
|