posterly-mcp-server 0.19.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/platform-manifest.d.ts +3 -3
- package/dist/generated/platform-manifest.js +3 -2
- package/dist/lib/api-client.d.ts +2 -0
- package/dist/tools/get-account-analytics.js +34 -38
- package/dist/tools/get-post-analytics.js +1 -1
- package/package.json +1 -1
- package/src/generated/platform-manifest.ts +3 -2
- package/src/lib/api-client.ts +2 -0
- package/src/tools/get-account-analytics.ts +42 -41
- package/src/tools/get-post-analytics.ts +1 -1
|
@@ -33,7 +33,7 @@ export declare const PLATFORM_MANIFEST: {
|
|
|
33
33
|
readonly youtube: "youtube";
|
|
34
34
|
};
|
|
35
35
|
readonly helperNames: readonly ["linkedin.recent_mentions", "pinterest.boards", "tiktok.creator_info", "x.quota", "youtube.playlists"];
|
|
36
|
-
readonly analyticsPlatformIds: readonly ["instagram", "linkedin", "youtube", "pinterest", "google_business"];
|
|
36
|
+
readonly analyticsPlatformIds: readonly ["instagram", "facebook", "linkedin", "youtube", "pinterest", "google_business"];
|
|
37
37
|
readonly connectTargetIds: readonly ["instagram", "meta", "facebook", "youtube", "tiktok", "linkedin", "linkedin_page", "threads", "google_business", "pinterest", "twitter", "telegram", "bluesky", "reddit", "wordpress", "mastodon", "medium", "devto", "hashnode", "discord", "slack", "skool", "whop"];
|
|
38
38
|
readonly connectInputs: readonly ["bluesky", "devto", "discord", "facebook", "facebook_instagram", "facebook_pages", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "instagram_direct", "linkedin", "linkedin-company", "linkedin-page", "linkedin_company", "linkedin_page", "linkedin_personal", "mastodon", "medium", "meta", "meta_business", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "x_twitter", "youtube"];
|
|
39
39
|
readonly connectAliases: {
|
|
@@ -86,7 +86,7 @@ export declare const PLATFORM_MANIFEST: {
|
|
|
86
86
|
readonly status: "supported";
|
|
87
87
|
readonly aliases: readonly [];
|
|
88
88
|
readonly postTypes: readonly ["text", "image", "video", "carousel", "reel", "story", "cover_photo"];
|
|
89
|
-
readonly analyticsSupported:
|
|
89
|
+
readonly analyticsSupported: true;
|
|
90
90
|
readonly helpers: readonly [];
|
|
91
91
|
}, {
|
|
92
92
|
readonly id: "tiktok";
|
|
@@ -389,4 +389,4 @@ export declare const ALL_PLATFORM_INPUTS: readonly ["bluesky", "devto", "discord
|
|
|
389
389
|
export declare const PLATFORM_HELPER_NAMES: readonly ["linkedin.recent_mentions", "pinterest.boards", "tiktok.creator_info", "x.quota", "youtube.playlists"];
|
|
390
390
|
export declare const CONNECT_TARGET_IDS: readonly ["instagram", "meta", "facebook", "youtube", "tiktok", "linkedin", "linkedin_page", "threads", "google_business", "pinterest", "twitter", "telegram", "bluesky", "reddit", "wordpress", "mastodon", "medium", "devto", "hashnode", "discord", "slack", "skool", "whop"];
|
|
391
391
|
export declare const CONNECT_INPUTS: readonly ["bluesky", "devto", "discord", "facebook", "facebook_instagram", "facebook_pages", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "instagram_direct", "linkedin", "linkedin-company", "linkedin-page", "linkedin_company", "linkedin_page", "linkedin_personal", "mastodon", "medium", "meta", "meta_business", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "x_twitter", "youtube"];
|
|
392
|
-
export declare const ANALYTICS_PLATFORM_IDS: readonly ["instagram", "linkedin", "youtube", "pinterest", "google_business"];
|
|
392
|
+
export declare const ANALYTICS_PLATFORM_IDS: readonly ["instagram", "facebook", "linkedin", "youtube", "pinterest", "google_business"];
|
|
@@ -131,6 +131,7 @@ export const PLATFORM_MANIFEST = {
|
|
|
131
131
|
],
|
|
132
132
|
"analyticsPlatformIds": [
|
|
133
133
|
"instagram",
|
|
134
|
+
"facebook",
|
|
134
135
|
"linkedin",
|
|
135
136
|
"youtube",
|
|
136
137
|
"pinterest",
|
|
@@ -268,7 +269,7 @@ export const PLATFORM_MANIFEST = {
|
|
|
268
269
|
"story",
|
|
269
270
|
"cover_photo"
|
|
270
271
|
],
|
|
271
|
-
"analyticsSupported":
|
|
272
|
+
"analyticsSupported": true,
|
|
272
273
|
"helpers": []
|
|
273
274
|
},
|
|
274
275
|
{
|
|
@@ -692,4 +693,4 @@ export const ALL_PLATFORM_INPUTS = ["bluesky", "devto", "discord", "facebook", "
|
|
|
692
693
|
export const PLATFORM_HELPER_NAMES = ["linkedin.recent_mentions", "pinterest.boards", "tiktok.creator_info", "x.quota", "youtube.playlists"];
|
|
693
694
|
export const CONNECT_TARGET_IDS = ["instagram", "meta", "facebook", "youtube", "tiktok", "linkedin", "linkedin_page", "threads", "google_business", "pinterest", "twitter", "telegram", "bluesky", "reddit", "wordpress", "mastodon", "medium", "devto", "hashnode", "discord", "slack", "skool", "whop"];
|
|
694
695
|
export const CONNECT_INPUTS = ["bluesky", "devto", "discord", "facebook", "facebook_instagram", "facebook_pages", "gmb", "google-business", "google_business", "google_business_profile", "hashnode", "instagram", "instagram-standalone", "instagram_direct", "linkedin", "linkedin-company", "linkedin-page", "linkedin_company", "linkedin_page", "linkedin_personal", "mastodon", "medium", "meta", "meta_business", "pinterest", "reddit", "skool", "slack", "telegram", "threads", "tiktok", "twitter", "whop", "wordpress", "x", "x_twitter", "youtube"];
|
|
695
|
-
export const ANALYTICS_PLATFORM_IDS = ["instagram", "linkedin", "youtube", "pinterest", "google_business"];
|
|
696
|
+
export const ANALYTICS_PLATFORM_IDS = ["instagram", "facebook", "linkedin", "youtube", "pinterest", "google_business"];
|
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ export interface Whoami {
|
|
|
147
147
|
export interface AccountAnalyticsSummary {
|
|
148
148
|
current_followers: number;
|
|
149
149
|
followers_change: number;
|
|
150
|
+
current_media_count?: number;
|
|
150
151
|
total_reach: number | null;
|
|
151
152
|
total_views: number | null;
|
|
152
153
|
total_profile_views?: number | null;
|
|
@@ -162,6 +163,7 @@ export interface AccountAnalyticsSummary {
|
|
|
162
163
|
total_bookings: number | null;
|
|
163
164
|
total_watch_minutes?: number | null;
|
|
164
165
|
total_likes?: number | null;
|
|
166
|
+
platform_metrics?: Record<string, number | null | undefined>;
|
|
165
167
|
}
|
|
166
168
|
export interface AccountAnalyticsSnapshot {
|
|
167
169
|
date: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const getAccountAnalyticsTool = {
|
|
3
3
|
name: 'get_account_analytics',
|
|
4
|
-
description: 'Get daily analytics snapshots and a period summary for a connected social account. Supports Instagram, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns follower growth, reach, views, engagement rate, and platform-specific metrics.',
|
|
4
|
+
description: 'Get daily analytics snapshots and a period summary for a connected social account. Supports Instagram, Facebook, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns follower growth, reach, views, engagement rate, and platform-specific metrics.',
|
|
5
5
|
inputSchema: z.object({
|
|
6
6
|
account_id: z
|
|
7
7
|
.number()
|
|
@@ -23,49 +23,32 @@ export const getAccountAnalyticsTool = {
|
|
|
23
23
|
`Range: ${range.from} → ${range.to} (${snapshots.length} daily snapshots)`,
|
|
24
24
|
'',
|
|
25
25
|
'Summary:',
|
|
26
|
-
`• Followers: ${summary.current_followers.toLocaleString()} (${formatDelta(summary.followers_change)} in range)`,
|
|
27
|
-
`• Follows gained / lost: +${summary.total_follows_gained} / -${summary.total_follows_lost}`,
|
|
28
26
|
];
|
|
29
|
-
if (summary.total_reach !== null)
|
|
30
|
-
lines.push(`• Total reach: ${summary.total_reach.toLocaleString()}`);
|
|
31
|
-
if (summary.total_views !== null)
|
|
32
|
-
lines.push(`• Total views: ${summary.total_views.toLocaleString()}`);
|
|
33
|
-
if (summary.total_profile_views != null) {
|
|
34
|
-
lines.push(`• Profile views: ${summary.total_profile_views.toLocaleString()}`);
|
|
35
|
-
}
|
|
36
|
-
if (summary.total_accounts_engaged !== null) {
|
|
37
|
-
lines.push(`• Total accounts engaged: ${summary.total_accounts_engaged.toLocaleString()}`);
|
|
38
|
-
}
|
|
39
|
-
lines.push(`• Engagement rate (by reach): ${summary.engagement_rate}%`, `• Engagement rate (by followers): ${summary.engagement_rate_by_followers}%`);
|
|
40
27
|
if (account.platform === 'google_business') {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (summary.total_bookings !== null) {
|
|
54
|
-
lines.push(`• Bookings: ${summary.total_bookings.toLocaleString()}`);
|
|
55
|
-
}
|
|
28
|
+
const metrics = summary.platform_metrics || {};
|
|
29
|
+
pushMetric(lines, 'Profile views', metrics.profile_views ?? summary.total_views);
|
|
30
|
+
pushMetric(lines, 'Search views', metrics.search_views ?? summary.total_reach);
|
|
31
|
+
pushMetric(lines, 'Maps views', metrics.maps_views ?? summary.total_profile_views);
|
|
32
|
+
pushMetric(lines, 'Customer actions', metrics.customer_actions ?? summary.total_accounts_engaged);
|
|
33
|
+
pushMetric(lines, 'Posts', metrics.posts ?? summary.current_media_count);
|
|
34
|
+
lines.push(`• Engagement rate (actions / profile views): ${summary.engagement_rate}%`);
|
|
35
|
+
pushMetric(lines, 'Website clicks', metrics.website_clicks ?? summary.total_website_clicks);
|
|
36
|
+
pushMetric(lines, 'Call clicks', metrics.call_clicks ?? summary.total_call_clicks);
|
|
37
|
+
pushMetric(lines, 'Direction requests', metrics.direction_requests ?? summary.total_direction_requests);
|
|
38
|
+
pushMetric(lines, 'Conversations', metrics.conversations ?? summary.total_conversations);
|
|
39
|
+
pushMetric(lines, 'Bookings', metrics.bookings ?? summary.total_bookings);
|
|
56
40
|
}
|
|
57
41
|
else if (account.platform === 'pinterest') {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
42
|
+
pushGenericSummary(lines, summary);
|
|
43
|
+
pushMetric(lines, 'Outbound clicks', summary.total_website_clicks);
|
|
61
44
|
}
|
|
62
45
|
else if (account.platform === 'youtube') {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
pushGenericSummary(lines, summary);
|
|
47
|
+
pushMetric(lines, 'Watch minutes', summary.total_watch_minutes);
|
|
48
|
+
pushMetric(lines, 'Likes', summary.total_likes);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
pushGenericSummary(lines, summary);
|
|
69
52
|
}
|
|
70
53
|
return lines.join('\n');
|
|
71
54
|
},
|
|
@@ -73,3 +56,16 @@ export const getAccountAnalyticsTool = {
|
|
|
73
56
|
function formatDelta(n) {
|
|
74
57
|
return n >= 0 ? `+${n.toLocaleString()}` : n.toLocaleString();
|
|
75
58
|
}
|
|
59
|
+
function pushGenericSummary(lines, summary) {
|
|
60
|
+
lines.push(`• Followers: ${summary.current_followers.toLocaleString()} (${formatDelta(summary.followers_change)} in range)`, `• Follows gained / lost: +${summary.total_follows_gained} / -${summary.total_follows_lost}`);
|
|
61
|
+
pushMetric(lines, 'Total reach', summary.total_reach);
|
|
62
|
+
pushMetric(lines, 'Total views', summary.total_views);
|
|
63
|
+
pushMetric(lines, 'Profile views', summary.total_profile_views);
|
|
64
|
+
pushMetric(lines, 'Total accounts engaged', summary.total_accounts_engaged);
|
|
65
|
+
lines.push(`• Engagement rate (by reach): ${summary.engagement_rate}%`, `• Engagement rate (by followers): ${summary.engagement_rate_by_followers}%`);
|
|
66
|
+
}
|
|
67
|
+
function pushMetric(lines, label, value) {
|
|
68
|
+
if (value != null) {
|
|
69
|
+
lines.push(`• ${label}: ${value.toLocaleString()}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const getPostAnalyticsTool = {
|
|
3
3
|
name: 'get_post_analytics',
|
|
4
|
-
description: 'Get per-post engagement metrics (likes, comments, reach, impressions, saves, shares, plays, clicks, watch time) for a connected social account. Supports Instagram, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns the most recent posts first.',
|
|
4
|
+
description: 'Get per-post engagement metrics (likes, comments, reach, impressions, saves, shares, plays, clicks, watch time) for a connected social account. Supports Instagram, Facebook, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns the most recent posts first.',
|
|
5
5
|
inputSchema: z.object({
|
|
6
6
|
account_id: z
|
|
7
7
|
.number()
|
package/package.json
CHANGED
|
@@ -131,6 +131,7 @@ export const PLATFORM_MANIFEST = {
|
|
|
131
131
|
],
|
|
132
132
|
"analyticsPlatformIds": [
|
|
133
133
|
"instagram",
|
|
134
|
+
"facebook",
|
|
134
135
|
"linkedin",
|
|
135
136
|
"youtube",
|
|
136
137
|
"pinterest",
|
|
@@ -268,7 +269,7 @@ export const PLATFORM_MANIFEST = {
|
|
|
268
269
|
"story",
|
|
269
270
|
"cover_photo"
|
|
270
271
|
],
|
|
271
|
-
"analyticsSupported":
|
|
272
|
+
"analyticsSupported": true,
|
|
272
273
|
"helpers": []
|
|
273
274
|
},
|
|
274
275
|
{
|
|
@@ -692,4 +693,4 @@ export const ALL_PLATFORM_INPUTS = ["bluesky","devto","discord","facebook","gmb"
|
|
|
692
693
|
export const PLATFORM_HELPER_NAMES = ["linkedin.recent_mentions","pinterest.boards","tiktok.creator_info","x.quota","youtube.playlists"] as const;
|
|
693
694
|
export const CONNECT_TARGET_IDS = ["instagram","meta","facebook","youtube","tiktok","linkedin","linkedin_page","threads","google_business","pinterest","twitter","telegram","bluesky","reddit","wordpress","mastodon","medium","devto","hashnode","discord","slack","skool","whop"] as const;
|
|
694
695
|
export const CONNECT_INPUTS = ["bluesky","devto","discord","facebook","facebook_instagram","facebook_pages","gmb","google-business","google_business","google_business_profile","hashnode","instagram","instagram-standalone","instagram_direct","linkedin","linkedin-company","linkedin-page","linkedin_company","linkedin_page","linkedin_personal","mastodon","medium","meta","meta_business","pinterest","reddit","skool","slack","telegram","threads","tiktok","twitter","whop","wordpress","x","x_twitter","youtube"] as const;
|
|
695
|
-
export const ANALYTICS_PLATFORM_IDS = ["instagram","linkedin","youtube","pinterest","google_business"] as const;
|
|
696
|
+
export const ANALYTICS_PLATFORM_IDS = ["instagram","facebook","linkedin","youtube","pinterest","google_business"] as const;
|
package/src/lib/api-client.ts
CHANGED
|
@@ -135,6 +135,7 @@ export interface Whoami {
|
|
|
135
135
|
export interface AccountAnalyticsSummary {
|
|
136
136
|
current_followers: number;
|
|
137
137
|
followers_change: number;
|
|
138
|
+
current_media_count?: number;
|
|
138
139
|
total_reach: number | null;
|
|
139
140
|
total_views: number | null;
|
|
140
141
|
total_profile_views?: number | null;
|
|
@@ -150,6 +151,7 @@ export interface AccountAnalyticsSummary {
|
|
|
150
151
|
total_bookings: number | null;
|
|
151
152
|
total_watch_minutes?: number | null;
|
|
152
153
|
total_likes?: number | null;
|
|
154
|
+
platform_metrics?: Record<string, number | null | undefined>;
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
export interface AccountAnalyticsSnapshot {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { PosterlyClient } from '../lib/api-client.js';
|
|
2
|
+
import type { AccountAnalyticsSummary, PosterlyClient } from '../lib/api-client.js';
|
|
3
3
|
|
|
4
4
|
export const getAccountAnalyticsTool = {
|
|
5
5
|
name: 'get_account_analytics',
|
|
6
6
|
description:
|
|
7
|
-
'Get daily analytics snapshots and a period summary for a connected social account. Supports Instagram, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns follower growth, reach, views, engagement rate, and platform-specific metrics.',
|
|
7
|
+
'Get daily analytics snapshots and a period summary for a connected social account. Supports Instagram, Facebook, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns follower growth, reach, views, engagement rate, and platform-specific metrics.',
|
|
8
8
|
inputSchema: z.object({
|
|
9
9
|
account_id: z
|
|
10
10
|
.number()
|
|
@@ -31,50 +31,30 @@ export const getAccountAnalyticsTool = {
|
|
|
31
31
|
`Range: ${range.from} → ${range.to} (${snapshots.length} daily snapshots)`,
|
|
32
32
|
'',
|
|
33
33
|
'Summary:',
|
|
34
|
-
`• Followers: ${summary.current_followers.toLocaleString()} (${formatDelta(summary.followers_change)} in range)`,
|
|
35
|
-
`• Follows gained / lost: +${summary.total_follows_gained} / -${summary.total_follows_lost}`,
|
|
36
34
|
];
|
|
37
35
|
|
|
38
|
-
if (summary.total_reach !== null) lines.push(`• Total reach: ${summary.total_reach.toLocaleString()}`);
|
|
39
|
-
if (summary.total_views !== null) lines.push(`• Total views: ${summary.total_views.toLocaleString()}`);
|
|
40
|
-
if (summary.total_profile_views != null) {
|
|
41
|
-
lines.push(`• Profile views: ${summary.total_profile_views.toLocaleString()}`);
|
|
42
|
-
}
|
|
43
|
-
if (summary.total_accounts_engaged !== null) {
|
|
44
|
-
lines.push(`• Total accounts engaged: ${summary.total_accounts_engaged.toLocaleString()}`);
|
|
45
|
-
}
|
|
46
|
-
lines.push(
|
|
47
|
-
`• Engagement rate (by reach): ${summary.engagement_rate}%`,
|
|
48
|
-
`• Engagement rate (by followers): ${summary.engagement_rate_by_followers}%`
|
|
49
|
-
);
|
|
50
|
-
|
|
51
36
|
if (account.platform === 'google_business') {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (summary.total_bookings !== null) {
|
|
65
|
-
lines.push(`• Bookings: ${summary.total_bookings.toLocaleString()}`);
|
|
66
|
-
}
|
|
37
|
+
const metrics = summary.platform_metrics || {};
|
|
38
|
+
pushMetric(lines, 'Profile views', metrics.profile_views ?? summary.total_views);
|
|
39
|
+
pushMetric(lines, 'Search views', metrics.search_views ?? summary.total_reach);
|
|
40
|
+
pushMetric(lines, 'Maps views', metrics.maps_views ?? summary.total_profile_views);
|
|
41
|
+
pushMetric(lines, 'Customer actions', metrics.customer_actions ?? summary.total_accounts_engaged);
|
|
42
|
+
pushMetric(lines, 'Posts', metrics.posts ?? summary.current_media_count);
|
|
43
|
+
lines.push(`• Engagement rate (actions / profile views): ${summary.engagement_rate}%`);
|
|
44
|
+
pushMetric(lines, 'Website clicks', metrics.website_clicks ?? summary.total_website_clicks);
|
|
45
|
+
pushMetric(lines, 'Call clicks', metrics.call_clicks ?? summary.total_call_clicks);
|
|
46
|
+
pushMetric(lines, 'Direction requests', metrics.direction_requests ?? summary.total_direction_requests);
|
|
47
|
+
pushMetric(lines, 'Conversations', metrics.conversations ?? summary.total_conversations);
|
|
48
|
+
pushMetric(lines, 'Bookings', metrics.bookings ?? summary.total_bookings);
|
|
67
49
|
} else if (account.platform === 'pinterest') {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
50
|
+
pushGenericSummary(lines, summary);
|
|
51
|
+
pushMetric(lines, 'Outbound clicks', summary.total_website_clicks);
|
|
71
52
|
} else if (account.platform === 'youtube') {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
53
|
+
pushGenericSummary(lines, summary);
|
|
54
|
+
pushMetric(lines, 'Watch minutes', summary.total_watch_minutes);
|
|
55
|
+
pushMetric(lines, 'Likes', summary.total_likes);
|
|
56
|
+
} else {
|
|
57
|
+
pushGenericSummary(lines, summary);
|
|
78
58
|
}
|
|
79
59
|
|
|
80
60
|
return lines.join('\n');
|
|
@@ -84,3 +64,24 @@ export const getAccountAnalyticsTool = {
|
|
|
84
64
|
function formatDelta(n: number): string {
|
|
85
65
|
return n >= 0 ? `+${n.toLocaleString()}` : n.toLocaleString();
|
|
86
66
|
}
|
|
67
|
+
|
|
68
|
+
function pushGenericSummary(lines: string[], summary: AccountAnalyticsSummary) {
|
|
69
|
+
lines.push(
|
|
70
|
+
`• Followers: ${summary.current_followers.toLocaleString()} (${formatDelta(summary.followers_change)} in range)`,
|
|
71
|
+
`• Follows gained / lost: +${summary.total_follows_gained} / -${summary.total_follows_lost}`
|
|
72
|
+
);
|
|
73
|
+
pushMetric(lines, 'Total reach', summary.total_reach);
|
|
74
|
+
pushMetric(lines, 'Total views', summary.total_views);
|
|
75
|
+
pushMetric(lines, 'Profile views', summary.total_profile_views);
|
|
76
|
+
pushMetric(lines, 'Total accounts engaged', summary.total_accounts_engaged);
|
|
77
|
+
lines.push(
|
|
78
|
+
`• Engagement rate (by reach): ${summary.engagement_rate}%`,
|
|
79
|
+
`• Engagement rate (by followers): ${summary.engagement_rate_by_followers}%`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function pushMetric(lines: string[], label: string, value: number | null | undefined) {
|
|
84
|
+
if (value != null) {
|
|
85
|
+
lines.push(`• ${label}: ${value.toLocaleString()}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -4,7 +4,7 @@ import type { PosterlyClient } from '../lib/api-client.js';
|
|
|
4
4
|
export const getPostAnalyticsTool = {
|
|
5
5
|
name: 'get_post_analytics',
|
|
6
6
|
description:
|
|
7
|
-
'Get per-post engagement metrics (likes, comments, reach, impressions, saves, shares, plays, clicks, watch time) for a connected social account. Supports Instagram, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns the most recent posts first.',
|
|
7
|
+
'Get per-post engagement metrics (likes, comments, reach, impressions, saves, shares, plays, clicks, watch time) for a connected social account. Supports Instagram, Facebook, LinkedIn, Google Business Profile, Pinterest, and YouTube. Returns the most recent posts first.',
|
|
8
8
|
inputSchema: z.object({
|
|
9
9
|
account_id: z
|
|
10
10
|
.number()
|