@wplaunchify/ml-mcp-server 2.4.11 → 2.5.2
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/build/tools/fluent-crm.js +24 -48
- package/build/tools/fluent-mcp-pro.d.ts +854 -0
- package/build/tools/fluent-mcp-pro.js +1663 -0
- package/build/tools/index.js +17 -0
- package/package.json +4 -2
|
@@ -0,0 +1,1663 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// FluentMCP Pro Tools - Advanced WordPress Management for Power Users
|
|
4
|
+
// Requires: fluent-mcp-pro.php WordPress plugin
|
|
5
|
+
// 63 tools across 10 categories
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// SCHEMA DEFINITIONS (Define schemas FIRST, then use .shape)
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// File System Schemas
|
|
10
|
+
const fsReadSchema = z.object({
|
|
11
|
+
path: z.string().describe('File path relative to WordPress root or absolute path within allowed directories'),
|
|
12
|
+
encoding: z.enum(['utf8', 'base64']).optional().describe('File encoding (default: utf8)'),
|
|
13
|
+
});
|
|
14
|
+
const fsWriteSchema = z.object({
|
|
15
|
+
path: z.string().describe('File path relative to WordPress root or absolute path within allowed directories'),
|
|
16
|
+
content: z.string().describe('File content to write'),
|
|
17
|
+
encoding: z.enum(['utf8', 'base64']).optional().describe('File encoding (default: utf8)'),
|
|
18
|
+
});
|
|
19
|
+
const fsListSchema = z.object({
|
|
20
|
+
path: z.string().describe('Directory path relative to WordPress root or absolute path within allowed directories'),
|
|
21
|
+
recursive: z.boolean().optional().describe('List subdirectories recursively (default: false)'),
|
|
22
|
+
});
|
|
23
|
+
const fsDeleteSchema = z.object({
|
|
24
|
+
path: z.string().describe('File path relative to WordPress root or absolute path within allowed directories'),
|
|
25
|
+
});
|
|
26
|
+
const fsMkdirSchema = z.object({
|
|
27
|
+
path: z.string().describe('Directory path relative to WordPress root or absolute path within allowed directories'),
|
|
28
|
+
recursive: z.boolean().optional().describe('Create parent directories if needed (default: true)'),
|
|
29
|
+
});
|
|
30
|
+
const fsMoveSchema = z.object({
|
|
31
|
+
source: z.string().describe('Source file path'),
|
|
32
|
+
destination: z.string().describe('Destination file path'),
|
|
33
|
+
});
|
|
34
|
+
const fsInfoSchema = z.object({
|
|
35
|
+
path: z.string().describe('File path relative to WordPress root or absolute path within allowed directories'),
|
|
36
|
+
});
|
|
37
|
+
// Database Schemas
|
|
38
|
+
const dbQuerySchema = z.object({
|
|
39
|
+
query: z.string().describe('SQL query to execute'),
|
|
40
|
+
type: z.enum(['SELECT', 'INSERT', 'UPDATE', 'DELETE']).optional().describe('Query type (default: SELECT)'),
|
|
41
|
+
});
|
|
42
|
+
const dbBackupSchema = z.object({
|
|
43
|
+
tables: z.array(z.string()).optional().describe('Specific tables to backup (default: all tables)'),
|
|
44
|
+
});
|
|
45
|
+
const dbRestoreSchema = z.object({
|
|
46
|
+
file: z.string().describe('Path to SQL backup file to restore'),
|
|
47
|
+
});
|
|
48
|
+
const dbTableListSchema = z.object({
|
|
49
|
+
prefix: z.string().optional().describe('Filter tables by prefix (default: wp_)'),
|
|
50
|
+
});
|
|
51
|
+
const dbTableInfoSchema = z.object({
|
|
52
|
+
table: z.string().describe('Table name to get information about'),
|
|
53
|
+
});
|
|
54
|
+
const dbOptimizeSchema = z.object({
|
|
55
|
+
tables: z.array(z.string()).optional().describe('Specific tables to optimize (default: all tables)'),
|
|
56
|
+
});
|
|
57
|
+
const dbRepairSchema = z.object({
|
|
58
|
+
tables: z.array(z.string()).optional().describe('Specific tables to repair (default: all tables)'),
|
|
59
|
+
});
|
|
60
|
+
const dbExportSchema = z.object({
|
|
61
|
+
table: z.string().describe('Table name to export'),
|
|
62
|
+
format: z.enum(['csv', 'json']).optional().describe('Export format (default: csv)'),
|
|
63
|
+
});
|
|
64
|
+
// WordPress Settings Schemas
|
|
65
|
+
const wpGetOptionSchema = z.object({
|
|
66
|
+
option: z.string().describe('Option name to retrieve'),
|
|
67
|
+
});
|
|
68
|
+
const wpSetOptionSchema = z.object({
|
|
69
|
+
option: z.string().describe('Option name to set'),
|
|
70
|
+
value: z.any().describe('Option value to set'),
|
|
71
|
+
});
|
|
72
|
+
const wpDeleteOptionSchema = z.object({
|
|
73
|
+
option: z.string().describe('Option name to delete'),
|
|
74
|
+
});
|
|
75
|
+
const wpListOptionsSchema = z.object({
|
|
76
|
+
search: z.string().optional().describe('Search term to filter options'),
|
|
77
|
+
limit: z.number().optional().describe('Number of options to return (default: 100)'),
|
|
78
|
+
});
|
|
79
|
+
const wpGetConstantsSchema = z.object({
|
|
80
|
+
search: z.string().optional().describe('Search term to filter constants'),
|
|
81
|
+
});
|
|
82
|
+
const wpGetEnvSchema = z.object({
|
|
83
|
+
key: z.string().optional().describe('Specific environment variable to get (default: all)'),
|
|
84
|
+
});
|
|
85
|
+
const wpSiteInfoSchema = z.object({
|
|
86
|
+
include_server: z.boolean().optional().describe('Include server information (default: false)'),
|
|
87
|
+
});
|
|
88
|
+
const wpGetPermalinksSchema = z.object({});
|
|
89
|
+
const wpSetPermalinksSchema = z.object({
|
|
90
|
+
structure: z.string().describe('Permalink structure (e.g., /%postname%/)'),
|
|
91
|
+
});
|
|
92
|
+
const wpGetTimezoneSchema = z.object({});
|
|
93
|
+
const wpSetTimezoneSchema = z.object({
|
|
94
|
+
timezone: z.string().describe('Timezone string (e.g., America/New_York)'),
|
|
95
|
+
});
|
|
96
|
+
const wpFlushCacheSchema = z.object({
|
|
97
|
+
type: z.enum(['all', 'object', 'transient']).optional().describe('Cache type to flush (default: all)'),
|
|
98
|
+
});
|
|
99
|
+
// Theme Management Schemas
|
|
100
|
+
const themeListSchema = z.object({});
|
|
101
|
+
const themeActivateSchema = z.object({
|
|
102
|
+
theme: z.string().describe('Theme slug to activate'),
|
|
103
|
+
});
|
|
104
|
+
const themeDeleteSchema = z.object({
|
|
105
|
+
theme: z.string().describe('Theme slug to delete'),
|
|
106
|
+
});
|
|
107
|
+
// System Utilities Schemas
|
|
108
|
+
const systemInfoSchema = z.object({});
|
|
109
|
+
const systemHealthSchema = z.object({});
|
|
110
|
+
const systemLogsSchema = z.object({
|
|
111
|
+
lines: z.number().optional().describe('Number of log lines to return (default: 100)'),
|
|
112
|
+
type: z.enum(['error', 'debug', 'all']).optional().describe('Log type to retrieve (default: error)'),
|
|
113
|
+
});
|
|
114
|
+
const systemCronSchema = z.object({});
|
|
115
|
+
const systemCronRunSchema = z.object({
|
|
116
|
+
hook: z.string().describe('Cron hook name to execute'),
|
|
117
|
+
});
|
|
118
|
+
// WooCommerce Schemas
|
|
119
|
+
const wcProductListSchema = z.object({
|
|
120
|
+
per_page: z.number().optional().describe('Products per page (default: 10)'),
|
|
121
|
+
page: z.number().optional().describe('Page number (default: 1)'),
|
|
122
|
+
search: z.string().optional().describe('Search term'),
|
|
123
|
+
status: z.enum(['publish', 'draft', 'pending']).optional().describe('Product status'),
|
|
124
|
+
});
|
|
125
|
+
const wcProductGetSchema = z.object({
|
|
126
|
+
id: z.number().describe('Product ID'),
|
|
127
|
+
});
|
|
128
|
+
const wcProductCreateSchema = z.object({
|
|
129
|
+
name: z.string().describe('Product name'),
|
|
130
|
+
type: z.enum(['simple', 'variable', 'grouped', 'external']).optional().describe('Product type (default: simple)'),
|
|
131
|
+
regular_price: z.string().optional().describe('Regular price'),
|
|
132
|
+
description: z.string().optional().describe('Product description'),
|
|
133
|
+
short_description: z.string().optional().describe('Short description'),
|
|
134
|
+
categories: z.array(z.object({ id: z.number() })).optional().describe('Product categories'),
|
|
135
|
+
images: z.array(z.object({ src: z.string() })).optional().describe('Product images'),
|
|
136
|
+
});
|
|
137
|
+
const wcProductUpdateSchema = z.object({
|
|
138
|
+
id: z.number().describe('Product ID'),
|
|
139
|
+
name: z.string().optional().describe('Product name'),
|
|
140
|
+
regular_price: z.string().optional().describe('Regular price'),
|
|
141
|
+
description: z.string().optional().describe('Product description'),
|
|
142
|
+
short_description: z.string().optional().describe('Short description'),
|
|
143
|
+
stock_quantity: z.number().optional().describe('Stock quantity'),
|
|
144
|
+
});
|
|
145
|
+
const wcProductDeleteSchema = z.object({
|
|
146
|
+
id: z.number().describe('Product ID'),
|
|
147
|
+
force: z.boolean().optional().describe('Force delete (default: false)'),
|
|
148
|
+
});
|
|
149
|
+
const wcOrderListSchema = z.object({
|
|
150
|
+
per_page: z.number().optional().describe('Orders per page (default: 10)'),
|
|
151
|
+
page: z.number().optional().describe('Page number (default: 1)'),
|
|
152
|
+
status: z.string().optional().describe('Order status'),
|
|
153
|
+
});
|
|
154
|
+
const wcOrderGetSchema = z.object({
|
|
155
|
+
id: z.number().describe('Order ID'),
|
|
156
|
+
});
|
|
157
|
+
const wcOrderUpdateSchema = z.object({
|
|
158
|
+
id: z.number().describe('Order ID'),
|
|
159
|
+
status: z.string().optional().describe('Order status'),
|
|
160
|
+
customer_note: z.string().optional().describe('Customer note'),
|
|
161
|
+
});
|
|
162
|
+
const wcCustomerListSchema = z.object({
|
|
163
|
+
per_page: z.number().optional().describe('Customers per page (default: 10)'),
|
|
164
|
+
page: z.number().optional().describe('Page number (default: 1)'),
|
|
165
|
+
search: z.string().optional().describe('Search term'),
|
|
166
|
+
});
|
|
167
|
+
const wcCustomerGetSchema = z.object({
|
|
168
|
+
id: z.number().describe('Customer ID'),
|
|
169
|
+
});
|
|
170
|
+
const wcReportsSchema = z.object({
|
|
171
|
+
period: z.enum(['week', 'month', 'year']).optional().describe('Report period (default: week)'),
|
|
172
|
+
});
|
|
173
|
+
const wcCouponListSchema = z.object({
|
|
174
|
+
per_page: z.number().optional().describe('Coupons per page (default: 10)'),
|
|
175
|
+
page: z.number().optional().describe('Page number (default: 1)'),
|
|
176
|
+
});
|
|
177
|
+
const wcCouponCreateSchema = z.object({
|
|
178
|
+
code: z.string().describe('Coupon code'),
|
|
179
|
+
discount_type: z.enum(['percent', 'fixed_cart', 'fixed_product']).describe('Discount type'),
|
|
180
|
+
amount: z.string().describe('Discount amount'),
|
|
181
|
+
description: z.string().optional().describe('Coupon description'),
|
|
182
|
+
expiry_date: z.string().optional().describe('Expiry date (YYYY-MM-DD)'),
|
|
183
|
+
});
|
|
184
|
+
// WP-CLI Schemas
|
|
185
|
+
const wpCliExecuteSchema = z.object({
|
|
186
|
+
command: z.string().describe('WP-CLI command to execute (without "wp" prefix)'),
|
|
187
|
+
args: z.array(z.string()).optional().describe('Command arguments'),
|
|
188
|
+
});
|
|
189
|
+
const wpCliAvailableSchema = z.object({});
|
|
190
|
+
// ============================================================================
|
|
191
|
+
// TOOL DEFINITIONS (Use .shape from schemas defined above)
|
|
192
|
+
// ============================================================================
|
|
193
|
+
export const fluentMcpProTools = [
|
|
194
|
+
// File System Tools
|
|
195
|
+
{
|
|
196
|
+
name: 'pro_fs_read',
|
|
197
|
+
description: 'Read file contents from WordPress file system (restricted to WordPress root and uploads directory, 2MB limit)',
|
|
198
|
+
inputSchema: { type: 'object', properties: fsReadSchema.shape }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'pro_fs_write',
|
|
202
|
+
description: 'Write or create file in WordPress file system (restricted to WordPress root and uploads directory)',
|
|
203
|
+
inputSchema: { type: 'object', properties: fsWriteSchema.shape }
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'pro_fs_list',
|
|
207
|
+
description: 'List directory contents in WordPress file system (restricted to WordPress root and uploads directory)',
|
|
208
|
+
inputSchema: { type: 'object', properties: fsListSchema.shape }
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: 'pro_fs_delete',
|
|
212
|
+
description: 'Delete file from WordPress file system (restricted to WordPress root and uploads directory)',
|
|
213
|
+
inputSchema: { type: 'object', properties: fsDeleteSchema.shape }
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: 'pro_fs_mkdir',
|
|
217
|
+
description: 'Create directory in WordPress file system (restricted to WordPress root and uploads directory)',
|
|
218
|
+
inputSchema: { type: 'object', properties: fsMkdirSchema.shape }
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'pro_fs_move',
|
|
222
|
+
description: 'Move or rename file in WordPress file system (restricted to WordPress root and uploads directory)',
|
|
223
|
+
inputSchema: { type: 'object', properties: fsMoveSchema.shape }
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'pro_fs_info',
|
|
227
|
+
description: 'Get file information (size, modified date, permissions)',
|
|
228
|
+
inputSchema: { type: 'object', properties: fsInfoSchema.shape }
|
|
229
|
+
},
|
|
230
|
+
// Database Tools
|
|
231
|
+
{
|
|
232
|
+
name: 'pro_db_query',
|
|
233
|
+
description: 'Execute direct SQL query on WordPress database (use with caution, requires manage_options capability)',
|
|
234
|
+
inputSchema: { type: 'object', properties: dbQuerySchema.shape }
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'pro_db_backup',
|
|
238
|
+
description: 'Create database backup (exports to SQL file in uploads directory)',
|
|
239
|
+
inputSchema: { type: 'object', properties: dbBackupSchema.shape }
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: 'pro_db_restore',
|
|
243
|
+
description: 'Restore database from backup file',
|
|
244
|
+
inputSchema: { type: 'object', properties: dbRestoreSchema.shape }
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: 'pro_db_table_list',
|
|
248
|
+
description: 'List all database tables',
|
|
249
|
+
inputSchema: { type: 'object', properties: dbTableListSchema.shape }
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: 'pro_db_table_info',
|
|
253
|
+
description: 'Get information about a specific database table',
|
|
254
|
+
inputSchema: { type: 'object', properties: dbTableInfoSchema.shape }
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: 'pro_db_optimize',
|
|
258
|
+
description: 'Optimize database tables',
|
|
259
|
+
inputSchema: { type: 'object', properties: dbOptimizeSchema.shape }
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'pro_db_repair',
|
|
263
|
+
description: 'Repair database tables',
|
|
264
|
+
inputSchema: { type: 'object', properties: dbRepairSchema.shape }
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: 'pro_db_export',
|
|
268
|
+
description: 'Export database table to CSV or JSON',
|
|
269
|
+
inputSchema: { type: 'object', properties: dbExportSchema.shape }
|
|
270
|
+
},
|
|
271
|
+
// WordPress Settings Tools
|
|
272
|
+
{
|
|
273
|
+
name: 'pro_wp_get_option',
|
|
274
|
+
description: 'Get WordPress option value',
|
|
275
|
+
inputSchema: { type: 'object', properties: wpGetOptionSchema.shape }
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: 'pro_wp_set_option',
|
|
279
|
+
description: 'Set WordPress option value',
|
|
280
|
+
inputSchema: { type: 'object', properties: wpSetOptionSchema.shape }
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: 'pro_wp_delete_option',
|
|
284
|
+
description: 'Delete WordPress option',
|
|
285
|
+
inputSchema: { type: 'object', properties: wpDeleteOptionSchema.shape }
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: 'pro_wp_list_options',
|
|
289
|
+
description: 'List WordPress options',
|
|
290
|
+
inputSchema: { type: 'object', properties: wpListOptionsSchema.shape }
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: 'pro_wp_get_constants',
|
|
294
|
+
description: 'Get WordPress constants',
|
|
295
|
+
inputSchema: { type: 'object', properties: wpGetConstantsSchema.shape }
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: 'pro_wp_get_env',
|
|
299
|
+
description: 'Get environment variables',
|
|
300
|
+
inputSchema: { type: 'object', properties: wpGetEnvSchema.shape }
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: 'pro_wp_site_info',
|
|
304
|
+
description: 'Get comprehensive WordPress site information',
|
|
305
|
+
inputSchema: { type: 'object', properties: wpSiteInfoSchema.shape }
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: 'pro_wp_get_permalinks',
|
|
309
|
+
description: 'Get permalink structure',
|
|
310
|
+
inputSchema: { type: 'object', properties: wpGetPermalinksSchema.shape }
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'pro_wp_set_permalinks',
|
|
314
|
+
description: 'Set permalink structure',
|
|
315
|
+
inputSchema: { type: 'object', properties: wpSetPermalinksSchema.shape }
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: 'pro_wp_get_timezone',
|
|
319
|
+
description: 'Get WordPress timezone',
|
|
320
|
+
inputSchema: { type: 'object', properties: wpGetTimezoneSchema.shape }
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: 'pro_wp_set_timezone',
|
|
324
|
+
description: 'Set WordPress timezone',
|
|
325
|
+
inputSchema: { type: 'object', properties: wpSetTimezoneSchema.shape }
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: 'pro_wp_flush_cache',
|
|
329
|
+
description: 'Flush WordPress cache',
|
|
330
|
+
inputSchema: { type: 'object', properties: wpFlushCacheSchema.shape }
|
|
331
|
+
},
|
|
332
|
+
// Theme Management Tools
|
|
333
|
+
{
|
|
334
|
+
name: 'pro_theme_list',
|
|
335
|
+
description: 'List all installed themes',
|
|
336
|
+
inputSchema: { type: 'object', properties: themeListSchema.shape }
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: 'pro_theme_activate',
|
|
340
|
+
description: 'Activate a theme',
|
|
341
|
+
inputSchema: { type: 'object', properties: themeActivateSchema.shape }
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'pro_theme_delete',
|
|
345
|
+
description: 'Delete a theme',
|
|
346
|
+
inputSchema: { type: 'object', properties: themeDeleteSchema.shape }
|
|
347
|
+
},
|
|
348
|
+
// System Utilities Tools
|
|
349
|
+
{
|
|
350
|
+
name: 'pro_system_info',
|
|
351
|
+
description: 'Get system information (PHP, MySQL, server details)',
|
|
352
|
+
inputSchema: { type: 'object', properties: systemInfoSchema.shape }
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: 'pro_system_health',
|
|
356
|
+
description: 'Get WordPress site health status',
|
|
357
|
+
inputSchema: { type: 'object', properties: systemHealthSchema.shape }
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: 'pro_system_logs',
|
|
361
|
+
description: 'Get WordPress error logs',
|
|
362
|
+
inputSchema: { type: 'object', properties: systemLogsSchema.shape }
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: 'pro_system_cron',
|
|
366
|
+
description: 'List scheduled cron jobs',
|
|
367
|
+
inputSchema: { type: 'object', properties: systemCronSchema.shape }
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: 'pro_system_cron_run',
|
|
371
|
+
description: 'Execute a cron job immediately',
|
|
372
|
+
inputSchema: { type: 'object', properties: systemCronRunSchema.shape }
|
|
373
|
+
},
|
|
374
|
+
// WooCommerce Tools
|
|
375
|
+
{
|
|
376
|
+
name: 'pro_wc_product_list',
|
|
377
|
+
description: 'List WooCommerce products',
|
|
378
|
+
inputSchema: { type: 'object', properties: wcProductListSchema.shape }
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: 'pro_wc_product_get',
|
|
382
|
+
description: 'Get WooCommerce product by ID',
|
|
383
|
+
inputSchema: { type: 'object', properties: wcProductGetSchema.shape }
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: 'pro_wc_product_create',
|
|
387
|
+
description: 'Create WooCommerce product',
|
|
388
|
+
inputSchema: { type: 'object', properties: wcProductCreateSchema.shape }
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'pro_wc_product_update',
|
|
392
|
+
description: 'Update WooCommerce product',
|
|
393
|
+
inputSchema: { type: 'object', properties: wcProductUpdateSchema.shape }
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: 'pro_wc_product_delete',
|
|
397
|
+
description: 'Delete WooCommerce product',
|
|
398
|
+
inputSchema: { type: 'object', properties: wcProductDeleteSchema.shape }
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: 'pro_wc_order_list',
|
|
402
|
+
description: 'List WooCommerce orders',
|
|
403
|
+
inputSchema: { type: 'object', properties: wcOrderListSchema.shape }
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: 'pro_wc_order_get',
|
|
407
|
+
description: 'Get WooCommerce order by ID',
|
|
408
|
+
inputSchema: { type: 'object', properties: wcOrderGetSchema.shape }
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: 'pro_wc_order_update',
|
|
412
|
+
description: 'Update WooCommerce order',
|
|
413
|
+
inputSchema: { type: 'object', properties: wcOrderUpdateSchema.shape }
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: 'pro_wc_customer_list',
|
|
417
|
+
description: 'List WooCommerce customers',
|
|
418
|
+
inputSchema: { type: 'object', properties: wcCustomerListSchema.shape }
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
name: 'pro_wc_customer_get',
|
|
422
|
+
description: 'Get WooCommerce customer by ID',
|
|
423
|
+
inputSchema: { type: 'object', properties: wcCustomerGetSchema.shape }
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: 'pro_wc_reports',
|
|
427
|
+
description: 'Get WooCommerce sales reports',
|
|
428
|
+
inputSchema: { type: 'object', properties: wcReportsSchema.shape }
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: 'pro_wc_coupon_list',
|
|
432
|
+
description: 'List WooCommerce coupons',
|
|
433
|
+
inputSchema: { type: 'object', properties: wcCouponListSchema.shape }
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: 'pro_wc_coupon_create',
|
|
437
|
+
description: 'Create WooCommerce coupon',
|
|
438
|
+
inputSchema: { type: 'object', properties: wcCouponCreateSchema.shape }
|
|
439
|
+
},
|
|
440
|
+
// WP-CLI Tools
|
|
441
|
+
{
|
|
442
|
+
name: 'pro_wp_cli_execute',
|
|
443
|
+
description: 'Execute WP-CLI command',
|
|
444
|
+
inputSchema: { type: 'object', properties: wpCliExecuteSchema.shape }
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: 'pro_wp_cli_available',
|
|
448
|
+
description: 'Check if WP-CLI is available',
|
|
449
|
+
inputSchema: { type: 'object', properties: wpCliAvailableSchema.shape }
|
|
450
|
+
},
|
|
451
|
+
];
|
|
452
|
+
// ============================================================================
|
|
453
|
+
// HANDLERS
|
|
454
|
+
// ============================================================================
|
|
455
|
+
export const fluentMcpProHandlers = {
|
|
456
|
+
// File System Handlers
|
|
457
|
+
pro_fs_read: async (args) => {
|
|
458
|
+
try {
|
|
459
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/fs/read', args);
|
|
460
|
+
return {
|
|
461
|
+
toolResult: {
|
|
462
|
+
content: [{
|
|
463
|
+
type: 'text',
|
|
464
|
+
text: JSON.stringify(response, null, 2)
|
|
465
|
+
}]
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
catch (error) {
|
|
470
|
+
return {
|
|
471
|
+
toolResult: {
|
|
472
|
+
isError: true,
|
|
473
|
+
content: [{
|
|
474
|
+
type: 'text',
|
|
475
|
+
text: `Error reading file: ${error.message}`
|
|
476
|
+
}]
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
pro_fs_write: async (args) => {
|
|
482
|
+
try {
|
|
483
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/fs/write', args);
|
|
484
|
+
return {
|
|
485
|
+
toolResult: {
|
|
486
|
+
content: [{
|
|
487
|
+
type: 'text',
|
|
488
|
+
text: JSON.stringify(response, null, 2)
|
|
489
|
+
}]
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
catch (error) {
|
|
494
|
+
return {
|
|
495
|
+
toolResult: {
|
|
496
|
+
isError: true,
|
|
497
|
+
content: [{
|
|
498
|
+
type: 'text',
|
|
499
|
+
text: `Error writing file: ${error.message}`
|
|
500
|
+
}]
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
pro_fs_list: async (args) => {
|
|
506
|
+
try {
|
|
507
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/fs/list', args);
|
|
508
|
+
return {
|
|
509
|
+
toolResult: {
|
|
510
|
+
content: [{
|
|
511
|
+
type: 'text',
|
|
512
|
+
text: JSON.stringify(response, null, 2)
|
|
513
|
+
}]
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
catch (error) {
|
|
518
|
+
return {
|
|
519
|
+
toolResult: {
|
|
520
|
+
isError: true,
|
|
521
|
+
content: [{
|
|
522
|
+
type: 'text',
|
|
523
|
+
text: `Error listing directory: ${error.message}`
|
|
524
|
+
}]
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
pro_fs_delete: async (args) => {
|
|
530
|
+
try {
|
|
531
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/fs/delete', args);
|
|
532
|
+
return {
|
|
533
|
+
toolResult: {
|
|
534
|
+
content: [{
|
|
535
|
+
type: 'text',
|
|
536
|
+
text: JSON.stringify(response, null, 2)
|
|
537
|
+
}]
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
catch (error) {
|
|
542
|
+
return {
|
|
543
|
+
toolResult: {
|
|
544
|
+
isError: true,
|
|
545
|
+
content: [{
|
|
546
|
+
type: 'text',
|
|
547
|
+
text: `Error deleting file: ${error.message}`
|
|
548
|
+
}]
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
pro_fs_mkdir: async (args) => {
|
|
554
|
+
try {
|
|
555
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/fs/mkdir', args);
|
|
556
|
+
return {
|
|
557
|
+
toolResult: {
|
|
558
|
+
content: [{
|
|
559
|
+
type: 'text',
|
|
560
|
+
text: JSON.stringify(response, null, 2)
|
|
561
|
+
}]
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
catch (error) {
|
|
566
|
+
return {
|
|
567
|
+
toolResult: {
|
|
568
|
+
isError: true,
|
|
569
|
+
content: [{
|
|
570
|
+
type: 'text',
|
|
571
|
+
text: `Error creating directory: ${error.message}`
|
|
572
|
+
}]
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
pro_fs_move: async (args) => {
|
|
578
|
+
try {
|
|
579
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/fs/move', args);
|
|
580
|
+
return {
|
|
581
|
+
toolResult: {
|
|
582
|
+
content: [{
|
|
583
|
+
type: 'text',
|
|
584
|
+
text: JSON.stringify(response, null, 2)
|
|
585
|
+
}]
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
catch (error) {
|
|
590
|
+
return {
|
|
591
|
+
toolResult: {
|
|
592
|
+
isError: true,
|
|
593
|
+
content: [{
|
|
594
|
+
type: 'text',
|
|
595
|
+
text: `Error moving file: ${error.message}`
|
|
596
|
+
}]
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
pro_fs_info: async (args) => {
|
|
602
|
+
try {
|
|
603
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/fs/info', args);
|
|
604
|
+
return {
|
|
605
|
+
toolResult: {
|
|
606
|
+
content: [{
|
|
607
|
+
type: 'text',
|
|
608
|
+
text: JSON.stringify(response, null, 2)
|
|
609
|
+
}]
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
catch (error) {
|
|
614
|
+
return {
|
|
615
|
+
toolResult: {
|
|
616
|
+
isError: true,
|
|
617
|
+
content: [{
|
|
618
|
+
type: 'text',
|
|
619
|
+
text: `Error getting file info: ${error.message}`
|
|
620
|
+
}]
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
// Database Handlers
|
|
626
|
+
pro_db_query: async (args) => {
|
|
627
|
+
try {
|
|
628
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/db/query', args);
|
|
629
|
+
return {
|
|
630
|
+
toolResult: {
|
|
631
|
+
content: [{
|
|
632
|
+
type: 'text',
|
|
633
|
+
text: JSON.stringify(response, null, 2)
|
|
634
|
+
}]
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
catch (error) {
|
|
639
|
+
return {
|
|
640
|
+
toolResult: {
|
|
641
|
+
isError: true,
|
|
642
|
+
content: [{
|
|
643
|
+
type: 'text',
|
|
644
|
+
text: `Error executing query: ${error.message}`
|
|
645
|
+
}]
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
pro_db_backup: async (args) => {
|
|
651
|
+
try {
|
|
652
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/db/backup', args);
|
|
653
|
+
return {
|
|
654
|
+
toolResult: {
|
|
655
|
+
content: [{
|
|
656
|
+
type: 'text',
|
|
657
|
+
text: JSON.stringify(response, null, 2)
|
|
658
|
+
}]
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
catch (error) {
|
|
663
|
+
return {
|
|
664
|
+
toolResult: {
|
|
665
|
+
isError: true,
|
|
666
|
+
content: [{
|
|
667
|
+
type: 'text',
|
|
668
|
+
text: `Error creating backup: ${error.message}`
|
|
669
|
+
}]
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
pro_db_restore: async (args) => {
|
|
675
|
+
try {
|
|
676
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/db/restore', args);
|
|
677
|
+
return {
|
|
678
|
+
toolResult: {
|
|
679
|
+
content: [{
|
|
680
|
+
type: 'text',
|
|
681
|
+
text: JSON.stringify(response, null, 2)
|
|
682
|
+
}]
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
catch (error) {
|
|
687
|
+
return {
|
|
688
|
+
toolResult: {
|
|
689
|
+
isError: true,
|
|
690
|
+
content: [{
|
|
691
|
+
type: 'text',
|
|
692
|
+
text: `Error restoring backup: ${error.message}`
|
|
693
|
+
}]
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
pro_db_table_list: async (args) => {
|
|
699
|
+
try {
|
|
700
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/db/tables', args);
|
|
701
|
+
return {
|
|
702
|
+
toolResult: {
|
|
703
|
+
content: [{
|
|
704
|
+
type: 'text',
|
|
705
|
+
text: JSON.stringify(response, null, 2)
|
|
706
|
+
}]
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
catch (error) {
|
|
711
|
+
return {
|
|
712
|
+
toolResult: {
|
|
713
|
+
isError: true,
|
|
714
|
+
content: [{
|
|
715
|
+
type: 'text',
|
|
716
|
+
text: `Error listing tables: ${error.message}`
|
|
717
|
+
}]
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
pro_db_table_info: async (args) => {
|
|
723
|
+
try {
|
|
724
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/power/db/tables/${args.table}`, args);
|
|
725
|
+
return {
|
|
726
|
+
toolResult: {
|
|
727
|
+
content: [{
|
|
728
|
+
type: 'text',
|
|
729
|
+
text: JSON.stringify(response, null, 2)
|
|
730
|
+
}]
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
catch (error) {
|
|
735
|
+
return {
|
|
736
|
+
toolResult: {
|
|
737
|
+
isError: true,
|
|
738
|
+
content: [{
|
|
739
|
+
type: 'text',
|
|
740
|
+
text: `Error getting table info: ${error.message}`
|
|
741
|
+
}]
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
pro_db_optimize: async (args) => {
|
|
747
|
+
try {
|
|
748
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/db/optimize', args);
|
|
749
|
+
return {
|
|
750
|
+
toolResult: {
|
|
751
|
+
content: [{
|
|
752
|
+
type: 'text',
|
|
753
|
+
text: JSON.stringify(response, null, 2)
|
|
754
|
+
}]
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
catch (error) {
|
|
759
|
+
return {
|
|
760
|
+
toolResult: {
|
|
761
|
+
isError: true,
|
|
762
|
+
content: [{
|
|
763
|
+
type: 'text',
|
|
764
|
+
text: `Error optimizing tables: ${error.message}`
|
|
765
|
+
}]
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
pro_db_repair: async (args) => {
|
|
771
|
+
try {
|
|
772
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/db/repair', args);
|
|
773
|
+
return {
|
|
774
|
+
toolResult: {
|
|
775
|
+
content: [{
|
|
776
|
+
type: 'text',
|
|
777
|
+
text: JSON.stringify(response, null, 2)
|
|
778
|
+
}]
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
catch (error) {
|
|
783
|
+
return {
|
|
784
|
+
toolResult: {
|
|
785
|
+
isError: true,
|
|
786
|
+
content: [{
|
|
787
|
+
type: 'text',
|
|
788
|
+
text: `Error repairing tables: ${error.message}`
|
|
789
|
+
}]
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
pro_db_export: async (args) => {
|
|
795
|
+
try {
|
|
796
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/db/export', args);
|
|
797
|
+
return {
|
|
798
|
+
toolResult: {
|
|
799
|
+
content: [{
|
|
800
|
+
type: 'text',
|
|
801
|
+
text: JSON.stringify(response, null, 2)
|
|
802
|
+
}]
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
catch (error) {
|
|
807
|
+
return {
|
|
808
|
+
toolResult: {
|
|
809
|
+
isError: true,
|
|
810
|
+
content: [{
|
|
811
|
+
type: 'text',
|
|
812
|
+
text: `Error exporting table: ${error.message}`
|
|
813
|
+
}]
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
// WordPress Settings Handlers
|
|
819
|
+
pro_wp_get_option: async (args) => {
|
|
820
|
+
try {
|
|
821
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/power/wp/options/${args.option}`);
|
|
822
|
+
return {
|
|
823
|
+
toolResult: {
|
|
824
|
+
content: [{
|
|
825
|
+
type: 'text',
|
|
826
|
+
text: JSON.stringify(response, null, 2)
|
|
827
|
+
}]
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
catch (error) {
|
|
832
|
+
return {
|
|
833
|
+
toolResult: {
|
|
834
|
+
isError: true,
|
|
835
|
+
content: [{
|
|
836
|
+
type: 'text',
|
|
837
|
+
text: `Error getting option: ${error.message}`
|
|
838
|
+
}]
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
pro_wp_set_option: async (args) => {
|
|
844
|
+
try {
|
|
845
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/wp/options', args);
|
|
846
|
+
return {
|
|
847
|
+
toolResult: {
|
|
848
|
+
content: [{
|
|
849
|
+
type: 'text',
|
|
850
|
+
text: JSON.stringify(response, null, 2)
|
|
851
|
+
}]
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
catch (error) {
|
|
856
|
+
return {
|
|
857
|
+
toolResult: {
|
|
858
|
+
isError: true,
|
|
859
|
+
content: [{
|
|
860
|
+
type: 'text',
|
|
861
|
+
text: `Error setting option: ${error.message}`
|
|
862
|
+
}]
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
pro_wp_delete_option: async (args) => {
|
|
868
|
+
try {
|
|
869
|
+
const response = await makeWordPressRequest('DELETE', `fc-manager/v1/power/wp/options/${args.option}`);
|
|
870
|
+
return {
|
|
871
|
+
toolResult: {
|
|
872
|
+
content: [{
|
|
873
|
+
type: 'text',
|
|
874
|
+
text: JSON.stringify(response, null, 2)
|
|
875
|
+
}]
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
catch (error) {
|
|
880
|
+
return {
|
|
881
|
+
toolResult: {
|
|
882
|
+
isError: true,
|
|
883
|
+
content: [{
|
|
884
|
+
type: 'text',
|
|
885
|
+
text: `Error deleting option: ${error.message}`
|
|
886
|
+
}]
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
pro_wp_list_options: async (args) => {
|
|
892
|
+
try {
|
|
893
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wp/options', args);
|
|
894
|
+
return {
|
|
895
|
+
toolResult: {
|
|
896
|
+
content: [{
|
|
897
|
+
type: 'text',
|
|
898
|
+
text: JSON.stringify(response, null, 2)
|
|
899
|
+
}]
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
catch (error) {
|
|
904
|
+
return {
|
|
905
|
+
toolResult: {
|
|
906
|
+
isError: true,
|
|
907
|
+
content: [{
|
|
908
|
+
type: 'text',
|
|
909
|
+
text: `Error listing options: ${error.message}`
|
|
910
|
+
}]
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
pro_wp_get_constants: async (args) => {
|
|
916
|
+
try {
|
|
917
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wp/constants', args);
|
|
918
|
+
return {
|
|
919
|
+
toolResult: {
|
|
920
|
+
content: [{
|
|
921
|
+
type: 'text',
|
|
922
|
+
text: JSON.stringify(response, null, 2)
|
|
923
|
+
}]
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
catch (error) {
|
|
928
|
+
return {
|
|
929
|
+
toolResult: {
|
|
930
|
+
isError: true,
|
|
931
|
+
content: [{
|
|
932
|
+
type: 'text',
|
|
933
|
+
text: `Error getting constants: ${error.message}`
|
|
934
|
+
}]
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
pro_wp_get_env: async (args) => {
|
|
940
|
+
try {
|
|
941
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wp/env', args);
|
|
942
|
+
return {
|
|
943
|
+
toolResult: {
|
|
944
|
+
content: [{
|
|
945
|
+
type: 'text',
|
|
946
|
+
text: JSON.stringify(response, null, 2)
|
|
947
|
+
}]
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
catch (error) {
|
|
952
|
+
return {
|
|
953
|
+
toolResult: {
|
|
954
|
+
isError: true,
|
|
955
|
+
content: [{
|
|
956
|
+
type: 'text',
|
|
957
|
+
text: `Error getting environment: ${error.message}`
|
|
958
|
+
}]
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
},
|
|
963
|
+
pro_wp_site_info: async (args) => {
|
|
964
|
+
try {
|
|
965
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wp/site-info', args);
|
|
966
|
+
return {
|
|
967
|
+
toolResult: {
|
|
968
|
+
content: [{
|
|
969
|
+
type: 'text',
|
|
970
|
+
text: JSON.stringify(response, null, 2)
|
|
971
|
+
}]
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
catch (error) {
|
|
976
|
+
return {
|
|
977
|
+
toolResult: {
|
|
978
|
+
isError: true,
|
|
979
|
+
content: [{
|
|
980
|
+
type: 'text',
|
|
981
|
+
text: `Error getting site info: ${error.message}`
|
|
982
|
+
}]
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
pro_wp_get_permalinks: async (args) => {
|
|
988
|
+
try {
|
|
989
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wp/permalinks');
|
|
990
|
+
return {
|
|
991
|
+
toolResult: {
|
|
992
|
+
content: [{
|
|
993
|
+
type: 'text',
|
|
994
|
+
text: JSON.stringify(response, null, 2)
|
|
995
|
+
}]
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
catch (error) {
|
|
1000
|
+
return {
|
|
1001
|
+
toolResult: {
|
|
1002
|
+
isError: true,
|
|
1003
|
+
content: [{
|
|
1004
|
+
type: 'text',
|
|
1005
|
+
text: `Error getting permalinks: ${error.message}`
|
|
1006
|
+
}]
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
pro_wp_set_permalinks: async (args) => {
|
|
1012
|
+
try {
|
|
1013
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/wp/permalinks', args);
|
|
1014
|
+
return {
|
|
1015
|
+
toolResult: {
|
|
1016
|
+
content: [{
|
|
1017
|
+
type: 'text',
|
|
1018
|
+
text: JSON.stringify(response, null, 2)
|
|
1019
|
+
}]
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
catch (error) {
|
|
1024
|
+
return {
|
|
1025
|
+
toolResult: {
|
|
1026
|
+
isError: true,
|
|
1027
|
+
content: [{
|
|
1028
|
+
type: 'text',
|
|
1029
|
+
text: `Error setting permalinks: ${error.message}`
|
|
1030
|
+
}]
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
pro_wp_get_timezone: async (args) => {
|
|
1036
|
+
try {
|
|
1037
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wp/timezone');
|
|
1038
|
+
return {
|
|
1039
|
+
toolResult: {
|
|
1040
|
+
content: [{
|
|
1041
|
+
type: 'text',
|
|
1042
|
+
text: JSON.stringify(response, null, 2)
|
|
1043
|
+
}]
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
catch (error) {
|
|
1048
|
+
return {
|
|
1049
|
+
toolResult: {
|
|
1050
|
+
isError: true,
|
|
1051
|
+
content: [{
|
|
1052
|
+
type: 'text',
|
|
1053
|
+
text: `Error getting timezone: ${error.message}`
|
|
1054
|
+
}]
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
pro_wp_set_timezone: async (args) => {
|
|
1060
|
+
try {
|
|
1061
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/wp/timezone', args);
|
|
1062
|
+
return {
|
|
1063
|
+
toolResult: {
|
|
1064
|
+
content: [{
|
|
1065
|
+
type: 'text',
|
|
1066
|
+
text: JSON.stringify(response, null, 2)
|
|
1067
|
+
}]
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
catch (error) {
|
|
1072
|
+
return {
|
|
1073
|
+
toolResult: {
|
|
1074
|
+
isError: true,
|
|
1075
|
+
content: [{
|
|
1076
|
+
type: 'text',
|
|
1077
|
+
text: `Error setting timezone: ${error.message}`
|
|
1078
|
+
}]
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
pro_wp_flush_cache: async (args) => {
|
|
1084
|
+
try {
|
|
1085
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/wp/flush-cache', args);
|
|
1086
|
+
return {
|
|
1087
|
+
toolResult: {
|
|
1088
|
+
content: [{
|
|
1089
|
+
type: 'text',
|
|
1090
|
+
text: JSON.stringify(response, null, 2)
|
|
1091
|
+
}]
|
|
1092
|
+
}
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
catch (error) {
|
|
1096
|
+
return {
|
|
1097
|
+
toolResult: {
|
|
1098
|
+
isError: true,
|
|
1099
|
+
content: [{
|
|
1100
|
+
type: 'text',
|
|
1101
|
+
text: `Error flushing cache: ${error.message}`
|
|
1102
|
+
}]
|
|
1103
|
+
}
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
// Theme Management Handlers
|
|
1108
|
+
pro_theme_list: async (args) => {
|
|
1109
|
+
try {
|
|
1110
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/themes');
|
|
1111
|
+
return {
|
|
1112
|
+
toolResult: {
|
|
1113
|
+
content: [{
|
|
1114
|
+
type: 'text',
|
|
1115
|
+
text: JSON.stringify(response, null, 2)
|
|
1116
|
+
}]
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
catch (error) {
|
|
1121
|
+
return {
|
|
1122
|
+
toolResult: {
|
|
1123
|
+
isError: true,
|
|
1124
|
+
content: [{
|
|
1125
|
+
type: 'text',
|
|
1126
|
+
text: `Error listing themes: ${error.message}`
|
|
1127
|
+
}]
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
pro_theme_activate: async (args) => {
|
|
1133
|
+
try {
|
|
1134
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/themes/activate', args);
|
|
1135
|
+
return {
|
|
1136
|
+
toolResult: {
|
|
1137
|
+
content: [{
|
|
1138
|
+
type: 'text',
|
|
1139
|
+
text: JSON.stringify(response, null, 2)
|
|
1140
|
+
}]
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
catch (error) {
|
|
1145
|
+
return {
|
|
1146
|
+
toolResult: {
|
|
1147
|
+
isError: true,
|
|
1148
|
+
content: [{
|
|
1149
|
+
type: 'text',
|
|
1150
|
+
text: `Error activating theme: ${error.message}`
|
|
1151
|
+
}]
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
pro_theme_delete: async (args) => {
|
|
1157
|
+
try {
|
|
1158
|
+
const response = await makeWordPressRequest('DELETE', `fc-manager/v1/power/themes/${args.theme}`);
|
|
1159
|
+
return {
|
|
1160
|
+
toolResult: {
|
|
1161
|
+
content: [{
|
|
1162
|
+
type: 'text',
|
|
1163
|
+
text: JSON.stringify(response, null, 2)
|
|
1164
|
+
}]
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
catch (error) {
|
|
1169
|
+
return {
|
|
1170
|
+
toolResult: {
|
|
1171
|
+
isError: true,
|
|
1172
|
+
content: [{
|
|
1173
|
+
type: 'text',
|
|
1174
|
+
text: `Error deleting theme: ${error.message}`
|
|
1175
|
+
}]
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
// System Utilities Handlers
|
|
1181
|
+
pro_system_info: async (args) => {
|
|
1182
|
+
try {
|
|
1183
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/system/info');
|
|
1184
|
+
return {
|
|
1185
|
+
toolResult: {
|
|
1186
|
+
content: [{
|
|
1187
|
+
type: 'text',
|
|
1188
|
+
text: JSON.stringify(response, null, 2)
|
|
1189
|
+
}]
|
|
1190
|
+
}
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
catch (error) {
|
|
1194
|
+
return {
|
|
1195
|
+
toolResult: {
|
|
1196
|
+
isError: true,
|
|
1197
|
+
content: [{
|
|
1198
|
+
type: 'text',
|
|
1199
|
+
text: `Error getting system info: ${error.message}`
|
|
1200
|
+
}]
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
pro_system_health: async (args) => {
|
|
1206
|
+
try {
|
|
1207
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/system/health');
|
|
1208
|
+
return {
|
|
1209
|
+
toolResult: {
|
|
1210
|
+
content: [{
|
|
1211
|
+
type: 'text',
|
|
1212
|
+
text: JSON.stringify(response, null, 2)
|
|
1213
|
+
}]
|
|
1214
|
+
}
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
catch (error) {
|
|
1218
|
+
return {
|
|
1219
|
+
toolResult: {
|
|
1220
|
+
isError: true,
|
|
1221
|
+
content: [{
|
|
1222
|
+
type: 'text',
|
|
1223
|
+
text: `Error getting system health: ${error.message}`
|
|
1224
|
+
}]
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
pro_system_logs: async (args) => {
|
|
1230
|
+
try {
|
|
1231
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/system/logs', args);
|
|
1232
|
+
return {
|
|
1233
|
+
toolResult: {
|
|
1234
|
+
content: [{
|
|
1235
|
+
type: 'text',
|
|
1236
|
+
text: JSON.stringify(response, null, 2)
|
|
1237
|
+
}]
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
}
|
|
1241
|
+
catch (error) {
|
|
1242
|
+
return {
|
|
1243
|
+
toolResult: {
|
|
1244
|
+
isError: true,
|
|
1245
|
+
content: [{
|
|
1246
|
+
type: 'text',
|
|
1247
|
+
text: `Error getting logs: ${error.message}`
|
|
1248
|
+
}]
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
pro_system_cron: async (args) => {
|
|
1254
|
+
try {
|
|
1255
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/system/cron');
|
|
1256
|
+
return {
|
|
1257
|
+
toolResult: {
|
|
1258
|
+
content: [{
|
|
1259
|
+
type: 'text',
|
|
1260
|
+
text: JSON.stringify(response, null, 2)
|
|
1261
|
+
}]
|
|
1262
|
+
}
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
catch (error) {
|
|
1266
|
+
return {
|
|
1267
|
+
toolResult: {
|
|
1268
|
+
isError: true,
|
|
1269
|
+
content: [{
|
|
1270
|
+
type: 'text',
|
|
1271
|
+
text: `Error getting cron jobs: ${error.message}`
|
|
1272
|
+
}]
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
},
|
|
1277
|
+
pro_system_cron_run: async (args) => {
|
|
1278
|
+
try {
|
|
1279
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/system/cron/run', args);
|
|
1280
|
+
return {
|
|
1281
|
+
toolResult: {
|
|
1282
|
+
content: [{
|
|
1283
|
+
type: 'text',
|
|
1284
|
+
text: JSON.stringify(response, null, 2)
|
|
1285
|
+
}]
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
catch (error) {
|
|
1290
|
+
return {
|
|
1291
|
+
toolResult: {
|
|
1292
|
+
isError: true,
|
|
1293
|
+
content: [{
|
|
1294
|
+
type: 'text',
|
|
1295
|
+
text: `Error running cron job: ${error.message}`
|
|
1296
|
+
}]
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
},
|
|
1301
|
+
// WooCommerce Handlers
|
|
1302
|
+
pro_wc_product_list: async (args) => {
|
|
1303
|
+
try {
|
|
1304
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wc/products', args);
|
|
1305
|
+
return {
|
|
1306
|
+
toolResult: {
|
|
1307
|
+
content: [{
|
|
1308
|
+
type: 'text',
|
|
1309
|
+
text: JSON.stringify(response, null, 2)
|
|
1310
|
+
}]
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
catch (error) {
|
|
1315
|
+
return {
|
|
1316
|
+
toolResult: {
|
|
1317
|
+
isError: true,
|
|
1318
|
+
content: [{
|
|
1319
|
+
type: 'text',
|
|
1320
|
+
text: `Error listing products: ${error.message}`
|
|
1321
|
+
}]
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
pro_wc_product_get: async (args) => {
|
|
1327
|
+
try {
|
|
1328
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/power/wc/products/${args.id}`);
|
|
1329
|
+
return {
|
|
1330
|
+
toolResult: {
|
|
1331
|
+
content: [{
|
|
1332
|
+
type: 'text',
|
|
1333
|
+
text: JSON.stringify(response, null, 2)
|
|
1334
|
+
}]
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
catch (error) {
|
|
1339
|
+
return {
|
|
1340
|
+
toolResult: {
|
|
1341
|
+
isError: true,
|
|
1342
|
+
content: [{
|
|
1343
|
+
type: 'text',
|
|
1344
|
+
text: `Error getting product: ${error.message}`
|
|
1345
|
+
}]
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
pro_wc_product_create: async (args) => {
|
|
1351
|
+
try {
|
|
1352
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/wc/products', args);
|
|
1353
|
+
return {
|
|
1354
|
+
toolResult: {
|
|
1355
|
+
content: [{
|
|
1356
|
+
type: 'text',
|
|
1357
|
+
text: JSON.stringify(response, null, 2)
|
|
1358
|
+
}]
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
catch (error) {
|
|
1363
|
+
return {
|
|
1364
|
+
toolResult: {
|
|
1365
|
+
isError: true,
|
|
1366
|
+
content: [{
|
|
1367
|
+
type: 'text',
|
|
1368
|
+
text: `Error creating product: ${error.message}`
|
|
1369
|
+
}]
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
},
|
|
1374
|
+
pro_wc_product_update: async (args) => {
|
|
1375
|
+
try {
|
|
1376
|
+
const response = await makeWordPressRequest('PUT', `fc-manager/v1/power/wc/products/${args.id}`, args);
|
|
1377
|
+
return {
|
|
1378
|
+
toolResult: {
|
|
1379
|
+
content: [{
|
|
1380
|
+
type: 'text',
|
|
1381
|
+
text: JSON.stringify(response, null, 2)
|
|
1382
|
+
}]
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
catch (error) {
|
|
1387
|
+
return {
|
|
1388
|
+
toolResult: {
|
|
1389
|
+
isError: true,
|
|
1390
|
+
content: [{
|
|
1391
|
+
type: 'text',
|
|
1392
|
+
text: `Error updating product: ${error.message}`
|
|
1393
|
+
}]
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
},
|
|
1398
|
+
pro_wc_product_delete: async (args) => {
|
|
1399
|
+
try {
|
|
1400
|
+
const response = await makeWordPressRequest('DELETE', `fc-manager/v1/power/wc/products/${args.id}`, args);
|
|
1401
|
+
return {
|
|
1402
|
+
toolResult: {
|
|
1403
|
+
content: [{
|
|
1404
|
+
type: 'text',
|
|
1405
|
+
text: JSON.stringify(response, null, 2)
|
|
1406
|
+
}]
|
|
1407
|
+
}
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
catch (error) {
|
|
1411
|
+
return {
|
|
1412
|
+
toolResult: {
|
|
1413
|
+
isError: true,
|
|
1414
|
+
content: [{
|
|
1415
|
+
type: 'text',
|
|
1416
|
+
text: `Error deleting product: ${error.message}`
|
|
1417
|
+
}]
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
},
|
|
1422
|
+
pro_wc_order_list: async (args) => {
|
|
1423
|
+
try {
|
|
1424
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wc/orders', args);
|
|
1425
|
+
return {
|
|
1426
|
+
toolResult: {
|
|
1427
|
+
content: [{
|
|
1428
|
+
type: 'text',
|
|
1429
|
+
text: JSON.stringify(response, null, 2)
|
|
1430
|
+
}]
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
catch (error) {
|
|
1435
|
+
return {
|
|
1436
|
+
toolResult: {
|
|
1437
|
+
isError: true,
|
|
1438
|
+
content: [{
|
|
1439
|
+
type: 'text',
|
|
1440
|
+
text: `Error listing orders: ${error.message}`
|
|
1441
|
+
}]
|
|
1442
|
+
}
|
|
1443
|
+
};
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
pro_wc_order_get: async (args) => {
|
|
1447
|
+
try {
|
|
1448
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/power/wc/orders/${args.id}`);
|
|
1449
|
+
return {
|
|
1450
|
+
toolResult: {
|
|
1451
|
+
content: [{
|
|
1452
|
+
type: 'text',
|
|
1453
|
+
text: JSON.stringify(response, null, 2)
|
|
1454
|
+
}]
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
catch (error) {
|
|
1459
|
+
return {
|
|
1460
|
+
toolResult: {
|
|
1461
|
+
isError: true,
|
|
1462
|
+
content: [{
|
|
1463
|
+
type: 'text',
|
|
1464
|
+
text: `Error getting order: ${error.message}`
|
|
1465
|
+
}]
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
pro_wc_order_update: async (args) => {
|
|
1471
|
+
try {
|
|
1472
|
+
const response = await makeWordPressRequest('PUT', `fc-manager/v1/power/wc/orders/${args.id}`, args);
|
|
1473
|
+
return {
|
|
1474
|
+
toolResult: {
|
|
1475
|
+
content: [{
|
|
1476
|
+
type: 'text',
|
|
1477
|
+
text: JSON.stringify(response, null, 2)
|
|
1478
|
+
}]
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1482
|
+
catch (error) {
|
|
1483
|
+
return {
|
|
1484
|
+
toolResult: {
|
|
1485
|
+
isError: true,
|
|
1486
|
+
content: [{
|
|
1487
|
+
type: 'text',
|
|
1488
|
+
text: `Error updating order: ${error.message}`
|
|
1489
|
+
}]
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
pro_wc_customer_list: async (args) => {
|
|
1495
|
+
try {
|
|
1496
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wc/customers', args);
|
|
1497
|
+
return {
|
|
1498
|
+
toolResult: {
|
|
1499
|
+
content: [{
|
|
1500
|
+
type: 'text',
|
|
1501
|
+
text: JSON.stringify(response, null, 2)
|
|
1502
|
+
}]
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
catch (error) {
|
|
1507
|
+
return {
|
|
1508
|
+
toolResult: {
|
|
1509
|
+
isError: true,
|
|
1510
|
+
content: [{
|
|
1511
|
+
type: 'text',
|
|
1512
|
+
text: `Error listing customers: ${error.message}`
|
|
1513
|
+
}]
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
pro_wc_customer_get: async (args) => {
|
|
1519
|
+
try {
|
|
1520
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/power/wc/customers/${args.id}`);
|
|
1521
|
+
return {
|
|
1522
|
+
toolResult: {
|
|
1523
|
+
content: [{
|
|
1524
|
+
type: 'text',
|
|
1525
|
+
text: JSON.stringify(response, null, 2)
|
|
1526
|
+
}]
|
|
1527
|
+
}
|
|
1528
|
+
};
|
|
1529
|
+
}
|
|
1530
|
+
catch (error) {
|
|
1531
|
+
return {
|
|
1532
|
+
toolResult: {
|
|
1533
|
+
isError: true,
|
|
1534
|
+
content: [{
|
|
1535
|
+
type: 'text',
|
|
1536
|
+
text: `Error getting customer: ${error.message}`
|
|
1537
|
+
}]
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
},
|
|
1542
|
+
pro_wc_reports: async (args) => {
|
|
1543
|
+
try {
|
|
1544
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wc/reports', args);
|
|
1545
|
+
return {
|
|
1546
|
+
toolResult: {
|
|
1547
|
+
content: [{
|
|
1548
|
+
type: 'text',
|
|
1549
|
+
text: JSON.stringify(response, null, 2)
|
|
1550
|
+
}]
|
|
1551
|
+
}
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
catch (error) {
|
|
1555
|
+
return {
|
|
1556
|
+
toolResult: {
|
|
1557
|
+
isError: true,
|
|
1558
|
+
content: [{
|
|
1559
|
+
type: 'text',
|
|
1560
|
+
text: `Error getting reports: ${error.message}`
|
|
1561
|
+
}]
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
},
|
|
1566
|
+
pro_wc_coupon_list: async (args) => {
|
|
1567
|
+
try {
|
|
1568
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wc/coupons', args);
|
|
1569
|
+
return {
|
|
1570
|
+
toolResult: {
|
|
1571
|
+
content: [{
|
|
1572
|
+
type: 'text',
|
|
1573
|
+
text: JSON.stringify(response, null, 2)
|
|
1574
|
+
}]
|
|
1575
|
+
}
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
catch (error) {
|
|
1579
|
+
return {
|
|
1580
|
+
toolResult: {
|
|
1581
|
+
isError: true,
|
|
1582
|
+
content: [{
|
|
1583
|
+
type: 'text',
|
|
1584
|
+
text: `Error listing coupons: ${error.message}`
|
|
1585
|
+
}]
|
|
1586
|
+
}
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
pro_wc_coupon_create: async (args) => {
|
|
1591
|
+
try {
|
|
1592
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/wc/coupons', args);
|
|
1593
|
+
return {
|
|
1594
|
+
toolResult: {
|
|
1595
|
+
content: [{
|
|
1596
|
+
type: 'text',
|
|
1597
|
+
text: JSON.stringify(response, null, 2)
|
|
1598
|
+
}]
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
catch (error) {
|
|
1603
|
+
return {
|
|
1604
|
+
toolResult: {
|
|
1605
|
+
isError: true,
|
|
1606
|
+
content: [{
|
|
1607
|
+
type: 'text',
|
|
1608
|
+
text: `Error creating coupon: ${error.message}`
|
|
1609
|
+
}]
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
}
|
|
1613
|
+
},
|
|
1614
|
+
// WP-CLI Handlers
|
|
1615
|
+
pro_wp_cli_execute: async (args) => {
|
|
1616
|
+
try {
|
|
1617
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/power/wp-cli/execute', args);
|
|
1618
|
+
return {
|
|
1619
|
+
toolResult: {
|
|
1620
|
+
content: [{
|
|
1621
|
+
type: 'text',
|
|
1622
|
+
text: JSON.stringify(response, null, 2)
|
|
1623
|
+
}]
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
catch (error) {
|
|
1628
|
+
return {
|
|
1629
|
+
toolResult: {
|
|
1630
|
+
isError: true,
|
|
1631
|
+
content: [{
|
|
1632
|
+
type: 'text',
|
|
1633
|
+
text: `Error executing WP-CLI command: ${error.message}`
|
|
1634
|
+
}]
|
|
1635
|
+
}
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
pro_wp_cli_available: async (args) => {
|
|
1640
|
+
try {
|
|
1641
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/power/wp-cli/available');
|
|
1642
|
+
return {
|
|
1643
|
+
toolResult: {
|
|
1644
|
+
content: [{
|
|
1645
|
+
type: 'text',
|
|
1646
|
+
text: JSON.stringify(response, null, 2)
|
|
1647
|
+
}]
|
|
1648
|
+
}
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
catch (error) {
|
|
1652
|
+
return {
|
|
1653
|
+
toolResult: {
|
|
1654
|
+
isError: true,
|
|
1655
|
+
content: [{
|
|
1656
|
+
type: 'text',
|
|
1657
|
+
text: `Error checking WP-CLI availability: ${error.message}`
|
|
1658
|
+
}]
|
|
1659
|
+
}
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
},
|
|
1663
|
+
};
|