@wplaunchify/ml-mcp-server 2.0.1 → 2.1.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.
@@ -0,0 +1,926 @@
1
+ // src/tools/fluent-community-core.ts
2
+ // COMM1 - Community Core (55 tools)
3
+ // Use case: "I manage my community - posts, members, engagement"
4
+ import { makeWordPressRequest } from '../wordpress.js';
5
+ import { z } from 'zod';
6
+ // ==================== SCHEMA DEFINITIONS ====================
7
+ // Posts
8
+ const listPostsSchema = z.object({
9
+ space_id: z.number().optional().describe('Filter posts by space ID'),
10
+ user_id: z.number().optional().describe('Filter posts by user ID'),
11
+ status: z.enum(['published', 'draft', 'pending', 'archived']).optional().describe('Filter by status'),
12
+ type: z.string().optional().describe('Filter by post type (text, video, etc.)'),
13
+ limit: z.number().optional().default(20).describe('Number of posts to return'),
14
+ offset: z.number().optional().default(0).describe('Offset for pagination'),
15
+ search: z.string().optional().describe('Search term to filter posts')
16
+ });
17
+ const getPostSchema = z.object({
18
+ post_id: z.number().describe('The ID of the post to retrieve')
19
+ });
20
+ const createPostSchema = z.object({
21
+ space_id: z.number().describe('The space ID where the post will be created'),
22
+ user_id: z.number().describe('The user ID who creates the post'),
23
+ title: z.string().optional().describe('Post title'),
24
+ message: z.string().describe('Post content/message'),
25
+ type: z.string().optional().default('text').describe('Post type (text, video, etc.)'),
26
+ status: z.enum(['published', 'draft', 'pending']).optional().default('published').describe('Post status'),
27
+ privacy: z.enum(['public', 'private', 'friends']).optional().default('public').describe('Post privacy setting'),
28
+ use_html5_bypass: z.boolean().optional().describe('Enable HTML5 bypass mode for full HTML/CSS/iframe support'),
29
+ bypass_sanitization: z.boolean().optional().describe('Alias for use_html5_bypass')
30
+ });
31
+ const updatePostSchema = z.object({
32
+ post_id: z.number().describe('The ID of the post to update'),
33
+ title: z.string().optional().describe('Post title'),
34
+ message: z.string().optional().describe('Post content/message'),
35
+ status: z.enum(['published', 'draft', 'pending', 'archived']).optional().describe('Post status'),
36
+ privacy: z.enum(['public', 'private', 'friends']).optional().describe('Post privacy setting')
37
+ });
38
+ const deletePostSchema = z.object({
39
+ post_id: z.number().describe('The ID of the post to delete')
40
+ });
41
+ // Spaces
42
+ const listSpacesSchema = z.object({
43
+ status: z.enum(['active', 'inactive', 'archived']).optional().describe('Filter by status'),
44
+ privacy: z.enum(['public', 'private']).optional().describe('Filter by privacy setting'),
45
+ limit: z.number().optional().default(20).describe('Number of spaces to return'),
46
+ search: z.string().optional().describe('Search term')
47
+ });
48
+ const getSpaceSchema = z.object({
49
+ space_id: z.number().describe('The ID of the space to retrieve')
50
+ });
51
+ const createSpaceSchema = z.object({
52
+ title: z.string().describe('Space title'),
53
+ slug: z.string().optional().describe('Space slug (URL-friendly name)'),
54
+ description: z.string().optional().describe('Space description'),
55
+ privacy: z.enum(['public', 'private']).optional().default('public').describe('Privacy setting'),
56
+ status: z.enum(['active', 'inactive']).optional().default('active').describe('Space status'),
57
+ logo: z.string().optional().describe('Space logo/thumbnail URL'),
58
+ cover_photo: z.string().optional().describe('Space cover photo URL')
59
+ });
60
+ const updateSpaceSchema = z.object({
61
+ space_id: z.number().describe('The ID of the space to update'),
62
+ title: z.string().optional().describe('Space title'),
63
+ description: z.string().optional().describe('Space description'),
64
+ privacy: z.enum(['public', 'private']).optional().describe('Privacy setting'),
65
+ status: z.enum(['active', 'inactive', 'archived']).optional().describe('Space status'),
66
+ logo: z.string().optional().describe('Space logo/thumbnail URL'),
67
+ cover_photo: z.string().optional().describe('Space cover photo URL')
68
+ });
69
+ // Comments
70
+ const listCommentsSchema = z.object({
71
+ post_id: z.number().optional().describe('Filter comments by post ID'),
72
+ user_id: z.number().optional().describe('Filter comments by user ID'),
73
+ limit: z.number().optional().default(50).describe('Number of comments to return')
74
+ });
75
+ const createCommentSchema = z.object({
76
+ post_id: z.number().describe('The post ID to comment on'),
77
+ user_id: z.number().describe('The user ID who creates the comment'),
78
+ message: z.string().describe('Comment content')
79
+ });
80
+ const updateCommentSchema = z.object({
81
+ comment_id: z.number().describe('The ID of the comment to update'),
82
+ message: z.string().describe('Updated comment message')
83
+ });
84
+ const deleteCommentSchema = z.object({
85
+ comment_id: z.number().describe('The ID of the comment to delete')
86
+ });
87
+ // Space Members
88
+ const listSpaceMembersSchema = z.object({
89
+ space_id: z.number().describe('The space ID to list members from'),
90
+ status: z.enum(['active', 'pending', 'banned']).optional().describe('Filter by member status'),
91
+ limit: z.number().optional().default(50).describe('Number of members to return')
92
+ });
93
+ const addSpaceMemberSchema = z.object({
94
+ space_id: z.number().describe('The space ID'),
95
+ user_id: z.number().describe('The user ID to add'),
96
+ role: z.string().optional().default('member').describe('Member role in the space')
97
+ });
98
+ const removeSpaceMemberSchema = z.object({
99
+ space_id: z.number().describe('The space ID'),
100
+ user_id: z.number().describe('The user ID to remove')
101
+ });
102
+ const registerMemberSchema = z.object({
103
+ user_id: z.number().describe('The WordPress user ID to register in FluentCommunity'),
104
+ status: z.enum(['active', 'inactive']).optional().default('active').describe('Member status'),
105
+ avatar: z.string().optional().describe('Avatar URL'),
106
+ cover_photo: z.string().optional().describe('Cover photo URL')
107
+ });
108
+ // Space Groups
109
+ const listSpaceGroupsSchema = z.object({
110
+ limit: z.number().optional().default(20).describe('Number of groups to return')
111
+ });
112
+ const getSpaceGroupSchema = z.object({
113
+ id: z.number().describe('Space group ID')
114
+ });
115
+ const createSpaceGroupSchema = z.object({
116
+ title: z.string().describe('Group title'),
117
+ description: z.string().optional().describe('Group description'),
118
+ spaces: z.array(z.number()).optional().describe('Array of space IDs to include')
119
+ });
120
+ const updateSpaceGroupSchema = z.object({
121
+ id: z.number().describe('Space group ID'),
122
+ title: z.string().optional().describe('Group title'),
123
+ description: z.string().optional().describe('Group description'),
124
+ spaces: z.array(z.number()).optional().describe('Array of space IDs')
125
+ });
126
+ const deleteSpaceGroupSchema = z.object({
127
+ id: z.number().describe('Space group ID')
128
+ });
129
+ // Managers
130
+ const listManagersSchema = z.object({
131
+ space_id: z.number().optional().describe('Filter by space ID'),
132
+ limit: z.number().optional().default(50).describe('Number of managers to return')
133
+ });
134
+ const addManagerSchema = z.object({
135
+ user_id: z.number().describe('User ID to make manager'),
136
+ space_id: z.number().optional().describe('Space ID (for space-specific manager)'),
137
+ permissions: z.array(z.string()).optional().describe('Manager permissions')
138
+ });
139
+ const removeManagerSchema = z.object({
140
+ id: z.number().describe('Manager ID to remove')
141
+ });
142
+ // Search & Analytics
143
+ const searchContentSchema = z.object({
144
+ query: z.string().describe('Search query'),
145
+ content_type: z.enum(['all', 'posts', 'comments', 'spaces']).optional().default('all').describe('Type of content to search'),
146
+ space_id: z.number().optional().describe('Limit search to specific space'),
147
+ limit: z.number().optional().default(20).describe('Number of results to return')
148
+ });
149
+ const getSpaceAnalyticsSchema = z.object({
150
+ space_id: z.number().describe('The space ID to get analytics for'),
151
+ date_from: z.string().optional().describe('Start date (YYYY-MM-DD)'),
152
+ date_to: z.string().optional().describe('End date (YYYY-MM-DD)')
153
+ });
154
+ // Bulk Operations
155
+ const bulkCreatePostsSchema = z.object({
156
+ posts: z.array(z.object({
157
+ space_id: z.number(),
158
+ user_id: z.number(),
159
+ title: z.string().optional(),
160
+ message: z.string(),
161
+ type: z.string().optional(),
162
+ status: z.string().optional()
163
+ })).describe('Array of post objects to create')
164
+ });
165
+ const bulkUpdatePostsSchema = z.object({
166
+ post_ids: z.array(z.number()).describe('Array of post IDs to update'),
167
+ updates: z.object({
168
+ status: z.string().optional(),
169
+ privacy: z.string().optional()
170
+ }).describe('Fields to update on all posts')
171
+ });
172
+ const bulkDeletePostsSchema = z.object({
173
+ post_ids: z.array(z.number()).describe('Array of post IDs to delete')
174
+ });
175
+ // Profiles
176
+ const listProfilesSchema = z.object({
177
+ search: z.string().optional().describe('Search term'),
178
+ limit: z.number().optional().default(20).describe('Number of profiles to return')
179
+ });
180
+ const getProfileSchema = z.object({
181
+ id: z.number().describe('User/Profile ID')
182
+ });
183
+ const updateProfileSchema = z.object({
184
+ id: z.number().describe('User/Profile ID'),
185
+ display_name: z.string().optional().describe('Display name'),
186
+ bio: z.string().optional().describe('Bio/description'),
187
+ avatar: z.string().optional().describe('Avatar URL'),
188
+ cover_photo: z.string().optional().describe('Cover photo URL'),
189
+ social_links: z.record(z.string()).optional().describe('Social media links')
190
+ });
191
+ // Activities
192
+ const listActivitiesSchema = z.object({
193
+ user_id: z.number().optional().describe('Filter by user ID'),
194
+ limit: z.number().optional().default(50).describe('Number of activities to return')
195
+ });
196
+ // Reactions
197
+ const listReactionsSchema = z.object({
198
+ post_id: z.number().optional().describe('Filter by post ID'),
199
+ limit: z.number().optional().default(50).describe('Number of reactions to return')
200
+ });
201
+ const addReactionSchema = z.object({
202
+ post_id: z.number().describe('Post ID to react to'),
203
+ reaction_type: z.string().describe('Reaction type (like, love, etc.)')
204
+ });
205
+ const removeReactionSchema = z.object({
206
+ id: z.number().describe('Reaction ID to remove')
207
+ });
208
+ // Bookmarks
209
+ const listBookmarksSchema = z.object({
210
+ limit: z.number().optional().default(50).describe('Number of bookmarks to return')
211
+ });
212
+ const addBookmarkSchema = z.object({
213
+ post_id: z.number().describe('Post ID to bookmark')
214
+ });
215
+ const removeBookmarkSchema = z.object({
216
+ id: z.number().describe('Bookmark ID to remove')
217
+ });
218
+ // Notifications
219
+ const listNotificationsSchema = z.object({
220
+ unread_only: z.boolean().optional().describe('Show only unread notifications'),
221
+ limit: z.number().optional().default(50).describe('Number of notifications to return')
222
+ });
223
+ // Followers
224
+ const listFollowersSchema = z.object({
225
+ user_id: z.number().optional().describe('User ID to get followers for'),
226
+ limit: z.number().optional().default(50).describe('Number of followers to return')
227
+ });
228
+ const followUserSchema = z.object({
229
+ user_id: z.number().describe('User ID to follow')
230
+ });
231
+ const unfollowUserSchema = z.object({
232
+ id: z.number().describe('User ID to unfollow')
233
+ });
234
+ // Topics
235
+ const listTopicsSchema = z.object({
236
+ limit: z.number().optional().default(50).describe('Number of topics to return')
237
+ });
238
+ const getTopicSchema = z.object({
239
+ id: z.number().describe('Topic ID')
240
+ });
241
+ const createTopicSchema = z.object({
242
+ name: z.string().describe('Topic name'),
243
+ description: z.string().optional().describe('Topic description'),
244
+ icon: z.string().optional().describe('Topic icon')
245
+ });
246
+ const updateTopicSchema = z.object({
247
+ id: z.number().describe('Topic ID'),
248
+ name: z.string().optional().describe('Topic name'),
249
+ description: z.string().optional().describe('Topic description'),
250
+ icon: z.string().optional().describe('Topic icon')
251
+ });
252
+ const deleteTopicSchema = z.object({
253
+ id: z.number().describe('Topic ID')
254
+ });
255
+ // Reports
256
+ const listReportsSchema = z.object({
257
+ status: z.enum(['pending', 'resolved', 'dismissed']).optional().describe('Filter by status'),
258
+ limit: z.number().optional().default(50).describe('Number of reports to return')
259
+ });
260
+ const createReportSchema = z.object({
261
+ content_id: z.number().describe('Content ID being reported'),
262
+ content_type: z.enum(['post', 'comment', 'user']).describe('Type of content'),
263
+ reason: z.string().describe('Reason for report')
264
+ });
265
+ // Scheduled Posts
266
+ const listScheduledPostsSchema = z.object({
267
+ limit: z.number().optional().default(50).describe('Number of scheduled posts to return')
268
+ });
269
+ // ==================== TOOL DEFINITIONS (55 tools) ====================
270
+ export const fluentCommunityCoreTools = [
271
+ // Posts (5)
272
+ { name: 'fc_list_posts', description: 'List all posts from FluentCommunity with optional filtering', inputSchema: { type: 'object', properties: listPostsSchema.shape } },
273
+ { name: 'fc_get_post', description: 'Get a specific FluentCommunity post by ID', inputSchema: { type: 'object', properties: getPostSchema.shape } },
274
+ { name: 'fc_create_post', description: 'Create a new post in FluentCommunity', inputSchema: { type: 'object', properties: createPostSchema.shape } },
275
+ { name: 'fc_update_post', description: 'Update an existing FluentCommunity post', inputSchema: { type: 'object', properties: updatePostSchema.shape } },
276
+ { name: 'fc_delete_post', description: 'Delete a FluentCommunity post', inputSchema: { type: 'object', properties: deletePostSchema.shape } },
277
+ // Spaces (4)
278
+ { name: 'fc_list_spaces', description: 'List all spaces in FluentCommunity', inputSchema: { type: 'object', properties: listSpacesSchema.shape } },
279
+ { name: 'fc_get_space', description: 'Get detailed information about a specific space', inputSchema: { type: 'object', properties: getSpaceSchema.shape } },
280
+ { name: 'fc_create_space', description: 'Create a new space in FluentCommunity', inputSchema: { type: 'object', properties: createSpaceSchema.shape } },
281
+ { name: 'fc_update_space', description: 'Update an existing space', inputSchema: { type: 'object', properties: updateSpaceSchema.shape } },
282
+ // Comments (4)
283
+ { name: 'fc_list_comments', description: 'List FluentCommunity comments', inputSchema: { type: 'object', properties: listCommentsSchema.shape } },
284
+ { name: 'fc_create_comment', description: 'Create a new comment on a post', inputSchema: { type: 'object', properties: createCommentSchema.shape } },
285
+ { name: 'fc_update_comment', description: 'Update an existing comment', inputSchema: { type: 'object', properties: updateCommentSchema.shape } },
286
+ { name: 'fc_delete_comment', description: 'Delete a comment', inputSchema: { type: 'object', properties: deleteCommentSchema.shape } },
287
+ // Space Members (4)
288
+ { name: 'fc_list_space_members', description: 'List members of a specific space', inputSchema: { type: 'object', properties: listSpaceMembersSchema.shape } },
289
+ { name: 'fc_add_space_member', description: 'Add a user to a space', inputSchema: { type: 'object', properties: addSpaceMemberSchema.shape } },
290
+ { name: 'fc_remove_space_member', description: 'Remove a user from a space', inputSchema: { type: 'object', properties: removeSpaceMemberSchema.shape } },
291
+ { name: 'fc_register_member', description: 'Register a WordPress user in FluentCommunity', inputSchema: { type: 'object', properties: registerMemberSchema.shape } },
292
+ // Space Groups (5)
293
+ { name: 'fc_list_space_groups', description: 'List all space groups', inputSchema: { type: 'object', properties: listSpaceGroupsSchema.shape } },
294
+ { name: 'fc_get_space_group', description: 'Get a specific space group', inputSchema: { type: 'object', properties: getSpaceGroupSchema.shape } },
295
+ { name: 'fc_create_space_group', description: 'Create a new space group', inputSchema: { type: 'object', properties: createSpaceGroupSchema.shape } },
296
+ { name: 'fc_update_space_group', description: 'Update a space group', inputSchema: { type: 'object', properties: updateSpaceGroupSchema.shape } },
297
+ { name: 'fc_delete_space_group', description: 'Delete a space group', inputSchema: { type: 'object', properties: deleteSpaceGroupSchema.shape } },
298
+ // Managers (3)
299
+ { name: 'fc_list_managers', description: 'List community managers', inputSchema: { type: 'object', properties: listManagersSchema.shape } },
300
+ { name: 'fc_add_manager', description: 'Add a community manager', inputSchema: { type: 'object', properties: addManagerSchema.shape } },
301
+ { name: 'fc_remove_manager', description: 'Remove a community manager', inputSchema: { type: 'object', properties: removeManagerSchema.shape } },
302
+ // Search & Analytics (2)
303
+ { name: 'fc_search_content', description: 'Search across all FluentCommunity content', inputSchema: { type: 'object', properties: searchContentSchema.shape } },
304
+ { name: 'fc_get_space_analytics', description: 'Get analytics for a space', inputSchema: { type: 'object', properties: getSpaceAnalyticsSchema.shape } },
305
+ // Bulk Operations (3)
306
+ { name: 'fc_bulk_create_posts', description: 'Create multiple posts at once', inputSchema: { type: 'object', properties: bulkCreatePostsSchema.shape } },
307
+ { name: 'fc_bulk_update_posts', description: 'Update multiple posts at once', inputSchema: { type: 'object', properties: bulkUpdatePostsSchema.shape } },
308
+ { name: 'fc_bulk_delete_posts', description: 'Delete multiple posts at once', inputSchema: { type: 'object', properties: bulkDeletePostsSchema.shape } },
309
+ // Profiles (3)
310
+ { name: 'fc_list_profiles', description: 'List user profiles', inputSchema: { type: 'object', properties: listProfilesSchema.shape } },
311
+ { name: 'fc_get_profile', description: 'Get a specific user profile', inputSchema: { type: 'object', properties: getProfileSchema.shape } },
312
+ { name: 'fc_update_profile', description: 'Update a user profile', inputSchema: { type: 'object', properties: updateProfileSchema.shape } },
313
+ // Activities (1)
314
+ { name: 'fc_list_activities', description: 'List user activities', inputSchema: { type: 'object', properties: listActivitiesSchema.shape } },
315
+ // Reactions (3)
316
+ { name: 'fc_list_reactions', description: 'List reactions on posts', inputSchema: { type: 'object', properties: listReactionsSchema.shape } },
317
+ { name: 'fc_add_reaction', description: 'Add a reaction to a post', inputSchema: { type: 'object', properties: addReactionSchema.shape } },
318
+ { name: 'fc_remove_reaction', description: 'Remove a reaction', inputSchema: { type: 'object', properties: removeReactionSchema.shape } },
319
+ // Bookmarks (3)
320
+ { name: 'fc_list_bookmarks', description: 'List user bookmarks', inputSchema: { type: 'object', properties: listBookmarksSchema.shape } },
321
+ { name: 'fc_add_bookmark', description: 'Add a bookmark', inputSchema: { type: 'object', properties: addBookmarkSchema.shape } },
322
+ { name: 'fc_remove_bookmark', description: 'Remove a bookmark', inputSchema: { type: 'object', properties: removeBookmarkSchema.shape } },
323
+ // Notifications (2)
324
+ { name: 'fc_list_notifications', description: 'List user notifications', inputSchema: { type: 'object', properties: listNotificationsSchema.shape } },
325
+ { name: 'fc_mark_notifications_read', description: 'Mark notifications as read', inputSchema: { type: 'object', properties: z.object({}).shape } },
326
+ // Followers (3)
327
+ { name: 'fc_list_followers', description: 'List followers for a user', inputSchema: { type: 'object', properties: listFollowersSchema.shape } },
328
+ { name: 'fc_follow_user', description: 'Follow a user', inputSchema: { type: 'object', properties: followUserSchema.shape } },
329
+ { name: 'fc_unfollow_user', description: 'Unfollow a user', inputSchema: { type: 'object', properties: unfollowUserSchema.shape } },
330
+ // Topics (5)
331
+ { name: 'fc_list_topics', description: 'List all topics', inputSchema: { type: 'object', properties: listTopicsSchema.shape } },
332
+ { name: 'fc_get_topic', description: 'Get a specific topic', inputSchema: { type: 'object', properties: getTopicSchema.shape } },
333
+ { name: 'fc_create_topic', description: 'Create a new topic', inputSchema: { type: 'object', properties: createTopicSchema.shape } },
334
+ { name: 'fc_update_topic', description: 'Update a topic', inputSchema: { type: 'object', properties: updateTopicSchema.shape } },
335
+ { name: 'fc_delete_topic', description: 'Delete a topic', inputSchema: { type: 'object', properties: deleteTopicSchema.shape } },
336
+ // Reports (2)
337
+ { name: 'fc_list_reports', description: 'List moderation reports', inputSchema: { type: 'object', properties: listReportsSchema.shape } },
338
+ { name: 'fc_create_report', description: 'Create a moderation report', inputSchema: { type: 'object', properties: createReportSchema.shape } },
339
+ // Scheduled Posts (1)
340
+ { name: 'fc_list_scheduled_posts', description: 'List scheduled posts', inputSchema: { type: 'object', properties: listScheduledPostsSchema.shape } },
341
+ ];
342
+ // ==================== HANDLERS ====================
343
+ export const fluentCommunityCoreHandlers = {
344
+ // Posts
345
+ fc_list_posts: async (args) => {
346
+ try {
347
+ const params = { per_page: args.limit || 20, offset: args.offset || 0 };
348
+ if (args.space_id)
349
+ params.space_id = args.space_id;
350
+ if (args.user_id)
351
+ params.user_id = args.user_id;
352
+ if (args.status)
353
+ params.status = args.status;
354
+ if (args.type)
355
+ params.type = args.type;
356
+ if (args.search)
357
+ params.search = args.search;
358
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/posts', params);
359
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
360
+ }
361
+ catch (error) {
362
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
363
+ }
364
+ },
365
+ fc_get_post: async (args) => {
366
+ try {
367
+ const response = await makeWordPressRequest('GET', `fc-manager/v1/posts/${args.post_id}`);
368
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
369
+ }
370
+ catch (error) {
371
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
372
+ }
373
+ },
374
+ fc_create_post: async (args) => {
375
+ try {
376
+ const postData = {
377
+ space_id: args.space_id, user_id: args.user_id, message: args.message,
378
+ type: args.type || 'text', status: args.status || 'published', privacy: args.privacy || 'public'
379
+ };
380
+ if (args.title)
381
+ postData.title = args.title;
382
+ if (args.use_html5_bypass)
383
+ postData.use_html5_bypass = args.use_html5_bypass;
384
+ if (args.bypass_sanitization)
385
+ postData.bypass_sanitization = args.bypass_sanitization;
386
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/posts', postData);
387
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
388
+ }
389
+ catch (error) {
390
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
391
+ }
392
+ },
393
+ fc_update_post: async (args) => {
394
+ try {
395
+ const { post_id, ...updateData } = args;
396
+ const response = await makeWordPressRequest('PUT', `fc-manager/v1/posts/${post_id}`, updateData);
397
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
398
+ }
399
+ catch (error) {
400
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
401
+ }
402
+ },
403
+ fc_delete_post: async (args) => {
404
+ try {
405
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/posts/${args.post_id}`);
406
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
407
+ }
408
+ catch (error) {
409
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
410
+ }
411
+ },
412
+ // Spaces
413
+ fc_list_spaces: async (args) => {
414
+ try {
415
+ const params = { per_page: args.limit || 20 };
416
+ if (args.status)
417
+ params.status = args.status;
418
+ if (args.privacy)
419
+ params.privacy = args.privacy;
420
+ if (args.search)
421
+ params.search = args.search;
422
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/spaces', params);
423
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
424
+ }
425
+ catch (error) {
426
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
427
+ }
428
+ },
429
+ fc_get_space: async (args) => {
430
+ try {
431
+ const response = await makeWordPressRequest('GET', `fc-manager/v1/spaces/${args.space_id}`);
432
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
433
+ }
434
+ catch (error) {
435
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
436
+ }
437
+ },
438
+ fc_create_space: async (args) => {
439
+ try {
440
+ const spaceData = {
441
+ title: args.title, slug: args.slug || args.title.toLowerCase().replace(/\s+/g, '-'),
442
+ privacy: args.privacy || 'public', status: args.status || 'active'
443
+ };
444
+ if (args.description)
445
+ spaceData.description = args.description;
446
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/spaces', spaceData);
447
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
448
+ }
449
+ catch (error) {
450
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
451
+ }
452
+ },
453
+ fc_update_space: async (args) => {
454
+ try {
455
+ const { space_id, ...updateData } = args;
456
+ const response = await makeWordPressRequest('PUT', `fc-manager/v1/spaces/${space_id}`, updateData);
457
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
458
+ }
459
+ catch (error) {
460
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
461
+ }
462
+ },
463
+ // Comments
464
+ fc_list_comments: async (args) => {
465
+ try {
466
+ const params = { per_page: args.limit || 50 };
467
+ if (args.post_id)
468
+ params.post_id = args.post_id;
469
+ if (args.user_id)
470
+ params.user_id = args.user_id;
471
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/comments', params);
472
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
473
+ }
474
+ catch (error) {
475
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
476
+ }
477
+ },
478
+ fc_create_comment: async (args) => {
479
+ try {
480
+ const commentData = { post_id: args.post_id, user_id: args.user_id, message: args.message };
481
+ if (args.parent_id)
482
+ commentData.parent_id = args.parent_id;
483
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/comments', commentData);
484
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
485
+ }
486
+ catch (error) {
487
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
488
+ }
489
+ },
490
+ fc_update_comment: async (args) => {
491
+ try {
492
+ const { comment_id, ...updateData } = args;
493
+ const response = await makeWordPressRequest('PUT', `fc-manager/v1/comments/${comment_id}`, updateData);
494
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
495
+ }
496
+ catch (error) {
497
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
498
+ }
499
+ },
500
+ fc_delete_comment: async (args) => {
501
+ try {
502
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/comments/${args.comment_id}`);
503
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
504
+ }
505
+ catch (error) {
506
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
507
+ }
508
+ },
509
+ // Space Members
510
+ fc_list_space_members: async (args) => {
511
+ try {
512
+ const params = { per_page: args.limit || 50 };
513
+ if (args.status)
514
+ params.status = args.status;
515
+ const response = await makeWordPressRequest('GET', `fc-manager/v1/spaces/${args.space_id}/members`, params);
516
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
517
+ }
518
+ catch (error) {
519
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
520
+ }
521
+ },
522
+ fc_add_space_member: async (args) => {
523
+ try {
524
+ const queryParams = new URLSearchParams({ user_id: args.user_id.toString(), role: args.role || 'member' });
525
+ const response = await makeWordPressRequest('POST', `fc-manager/v1/spaces/${args.space_id}/members?${queryParams.toString()}`);
526
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
527
+ }
528
+ catch (error) {
529
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
530
+ }
531
+ },
532
+ fc_remove_space_member: async (args) => {
533
+ try {
534
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/spaces/${args.space_id}/members/${args.user_id}`);
535
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
536
+ }
537
+ catch (error) {
538
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
539
+ }
540
+ },
541
+ fc_register_member: async (args) => {
542
+ try {
543
+ const memberData = { user_id: args.user_id };
544
+ if (args.status)
545
+ memberData.status = args.status;
546
+ if (args.avatar)
547
+ memberData.avatar = args.avatar;
548
+ if (args.cover_photo)
549
+ memberData.cover_photo = args.cover_photo;
550
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/members/register', memberData);
551
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
552
+ }
553
+ catch (error) {
554
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
555
+ }
556
+ },
557
+ // Space Groups
558
+ fc_list_space_groups: async (args) => {
559
+ try {
560
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/space-groups', { per_page: args.limit || 20 });
561
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
562
+ }
563
+ catch (error) {
564
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
565
+ }
566
+ },
567
+ fc_get_space_group: async (args) => {
568
+ try {
569
+ const response = await makeWordPressRequest('GET', `fc-manager/v1/space-groups/${args.id}`);
570
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
571
+ }
572
+ catch (error) {
573
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
574
+ }
575
+ },
576
+ fc_create_space_group: async (args) => {
577
+ try {
578
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/space-groups', args);
579
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
580
+ }
581
+ catch (error) {
582
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
583
+ }
584
+ },
585
+ fc_update_space_group: async (args) => {
586
+ try {
587
+ const { id, ...updateData } = args;
588
+ const response = await makeWordPressRequest('PUT', `fc-manager/v1/space-groups/${id}`, updateData);
589
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
590
+ }
591
+ catch (error) {
592
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
593
+ }
594
+ },
595
+ fc_delete_space_group: async (args) => {
596
+ try {
597
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/space-groups/${args.id}`);
598
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
599
+ }
600
+ catch (error) {
601
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
602
+ }
603
+ },
604
+ // Managers
605
+ fc_list_managers: async (args) => {
606
+ try {
607
+ const params = { per_page: args.limit || 50 };
608
+ if (args.space_id)
609
+ params.space_id = args.space_id;
610
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/managers', params);
611
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
612
+ }
613
+ catch (error) {
614
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
615
+ }
616
+ },
617
+ fc_add_manager: async (args) => {
618
+ try {
619
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/managers', args);
620
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
621
+ }
622
+ catch (error) {
623
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
624
+ }
625
+ },
626
+ fc_remove_manager: async (args) => {
627
+ try {
628
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/managers/${args.id}`);
629
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
630
+ }
631
+ catch (error) {
632
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
633
+ }
634
+ },
635
+ // Search & Analytics
636
+ fc_search_content: async (args) => {
637
+ try {
638
+ const params = { query: args.query, content_type: args.content_type || 'all', per_page: args.limit || 20 };
639
+ if (args.space_id)
640
+ params.space_id = args.space_id;
641
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/search', params);
642
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
643
+ }
644
+ catch (error) {
645
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
646
+ }
647
+ },
648
+ fc_get_space_analytics: async (args) => {
649
+ try {
650
+ const params = { space_id: args.space_id };
651
+ if (args.date_from)
652
+ params.date_from = args.date_from;
653
+ if (args.date_to)
654
+ params.date_to = args.date_to;
655
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/analytics/space', params);
656
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
657
+ }
658
+ catch (error) {
659
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
660
+ }
661
+ },
662
+ // Bulk Operations
663
+ fc_bulk_create_posts: async (args) => {
664
+ try {
665
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/posts/bulk', { posts: args.posts });
666
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
667
+ }
668
+ catch (error) {
669
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
670
+ }
671
+ },
672
+ fc_bulk_update_posts: async (args) => {
673
+ try {
674
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/posts/bulk-update', { post_ids: args.post_ids, updates: args.updates });
675
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
676
+ }
677
+ catch (error) {
678
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
679
+ }
680
+ },
681
+ fc_bulk_delete_posts: async (args) => {
682
+ try {
683
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/posts/bulk-delete', { post_ids: args.post_ids });
684
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
685
+ }
686
+ catch (error) {
687
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
688
+ }
689
+ },
690
+ // Profiles
691
+ fc_list_profiles: async (args) => {
692
+ try {
693
+ const params = { per_page: args.limit || 20 };
694
+ if (args.search)
695
+ params.search = args.search;
696
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/profiles', params);
697
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
698
+ }
699
+ catch (error) {
700
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
701
+ }
702
+ },
703
+ fc_get_profile: async (args) => {
704
+ try {
705
+ const response = await makeWordPressRequest('GET', `fc-manager/v1/profiles/${args.id}`);
706
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
707
+ }
708
+ catch (error) {
709
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
710
+ }
711
+ },
712
+ fc_update_profile: async (args) => {
713
+ try {
714
+ const { id, ...updateData } = args;
715
+ const response = await makeWordPressRequest('PUT', `fc-manager/v1/profiles/${id}`, updateData);
716
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
717
+ }
718
+ catch (error) {
719
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
720
+ }
721
+ },
722
+ // Activities
723
+ fc_list_activities: async (args) => {
724
+ try {
725
+ const params = { per_page: args.limit || 50 };
726
+ if (args.user_id)
727
+ params.user_id = args.user_id;
728
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/activities', params);
729
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
730
+ }
731
+ catch (error) {
732
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
733
+ }
734
+ },
735
+ // Reactions
736
+ fc_list_reactions: async (args) => {
737
+ try {
738
+ const params = { per_page: args.limit || 50 };
739
+ if (args.post_id)
740
+ params.post_id = args.post_id;
741
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/reactions', params);
742
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
743
+ }
744
+ catch (error) {
745
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
746
+ }
747
+ },
748
+ fc_add_reaction: async (args) => {
749
+ try {
750
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/reactions', args);
751
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
752
+ }
753
+ catch (error) {
754
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
755
+ }
756
+ },
757
+ fc_remove_reaction: async (args) => {
758
+ try {
759
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/reactions/${args.id}`);
760
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
761
+ }
762
+ catch (error) {
763
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
764
+ }
765
+ },
766
+ // Bookmarks
767
+ fc_list_bookmarks: async (args) => {
768
+ try {
769
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/bookmarks', { per_page: args.limit || 50 });
770
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
771
+ }
772
+ catch (error) {
773
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
774
+ }
775
+ },
776
+ fc_add_bookmark: async (args) => {
777
+ try {
778
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/bookmarks', args);
779
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
780
+ }
781
+ catch (error) {
782
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
783
+ }
784
+ },
785
+ fc_remove_bookmark: async (args) => {
786
+ try {
787
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/bookmarks/${args.id}`);
788
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
789
+ }
790
+ catch (error) {
791
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
792
+ }
793
+ },
794
+ // Notifications
795
+ fc_list_notifications: async (args) => {
796
+ try {
797
+ const params = { per_page: args.limit || 50 };
798
+ if (args.unread_only)
799
+ params.unread_only = args.unread_only;
800
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/notifications', params);
801
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
802
+ }
803
+ catch (error) {
804
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
805
+ }
806
+ },
807
+ fc_mark_notifications_read: async (args) => {
808
+ try {
809
+ const response = await makeWordPressRequest('PUT', 'fc-manager/v1/notifications', args);
810
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
811
+ }
812
+ catch (error) {
813
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
814
+ }
815
+ },
816
+ // Followers
817
+ fc_list_followers: async (args) => {
818
+ try {
819
+ const params = { per_page: args.limit || 50 };
820
+ if (args.user_id)
821
+ params.user_id = args.user_id;
822
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/followers', params);
823
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
824
+ }
825
+ catch (error) {
826
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
827
+ }
828
+ },
829
+ fc_follow_user: async (args) => {
830
+ try {
831
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/followers', args);
832
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
833
+ }
834
+ catch (error) {
835
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
836
+ }
837
+ },
838
+ fc_unfollow_user: async (args) => {
839
+ try {
840
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/followers/${args.id}`);
841
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
842
+ }
843
+ catch (error) {
844
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
845
+ }
846
+ },
847
+ // Topics
848
+ fc_list_topics: async (args) => {
849
+ try {
850
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/topics', { per_page: args.limit || 50 });
851
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
852
+ }
853
+ catch (error) {
854
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
855
+ }
856
+ },
857
+ fc_get_topic: async (args) => {
858
+ try {
859
+ const response = await makeWordPressRequest('GET', `fc-manager/v1/topics/${args.id}`);
860
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
861
+ }
862
+ catch (error) {
863
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
864
+ }
865
+ },
866
+ fc_create_topic: async (args) => {
867
+ try {
868
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/topics', args);
869
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
870
+ }
871
+ catch (error) {
872
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
873
+ }
874
+ },
875
+ fc_update_topic: async (args) => {
876
+ try {
877
+ const { id, ...updateData } = args;
878
+ const response = await makeWordPressRequest('PUT', `fc-manager/v1/topics/${id}`, updateData);
879
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
880
+ }
881
+ catch (error) {
882
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
883
+ }
884
+ },
885
+ fc_delete_topic: async (args) => {
886
+ try {
887
+ const response = await makeWordPressRequest('DELETE', `fc-manager/v1/topics/${args.id}`);
888
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
889
+ }
890
+ catch (error) {
891
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
892
+ }
893
+ },
894
+ // Reports
895
+ fc_list_reports: async (args) => {
896
+ try {
897
+ const params = { per_page: args.limit || 50 };
898
+ if (args.status)
899
+ params.status = args.status;
900
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/moderation/reports', params);
901
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
902
+ }
903
+ catch (error) {
904
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
905
+ }
906
+ },
907
+ fc_create_report: async (args) => {
908
+ try {
909
+ const response = await makeWordPressRequest('POST', 'fc-manager/v1/moderation/reports', args);
910
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
911
+ }
912
+ catch (error) {
913
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
914
+ }
915
+ },
916
+ // Scheduled Posts
917
+ fc_list_scheduled_posts: async (args) => {
918
+ try {
919
+ const response = await makeWordPressRequest('GET', 'fc-manager/v1/scheduled-posts', { per_page: args.limit || 50 });
920
+ return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
921
+ }
922
+ catch (error) {
923
+ return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
924
+ }
925
+ },
926
+ };