@wplaunchify/ml-mcp-server 2.7.5 → 2.7.7
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-mcp-pro.d.ts +1 -852
- package/build/tools/fluent-mcp-pro.js +213 -1650
- package/build/tools/index.js +3 -5
- package/package.json +1 -1
|
@@ -1,1663 +1,226 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
-
// FluentMCP Pro
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
const
|
|
24
|
-
|
|
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
|
|
3
|
+
// FluentMCP Pro - 64 tools across 8 categories
|
|
4
|
+
// All names+endpoints verified against fluent-mcp-pro.php register_rest_routes()
|
|
5
|
+
// ====== SCHEMAS ======
|
|
6
|
+
const fsReadSchema = z.object({ path: z.string().describe('File path'), encoding: z.enum(['utf8', 'base64']).optional() });
|
|
7
|
+
const fsWriteSchema = z.object({ path: z.string().describe('File path'), content: z.string().describe('Content'), encoding: z.enum(['utf8', 'base64']).optional() });
|
|
8
|
+
const fsListSchema = z.object({ path: z.string().describe('Directory path'), recursive: z.boolean().optional() });
|
|
9
|
+
const fsDeleteSchema = z.object({ path: z.string().describe('File path') });
|
|
10
|
+
const fsMoveSchema = z.object({ source: z.string().describe('Source'), destination: z.string().describe('Destination') });
|
|
11
|
+
const fsCopySchema = z.object({ source: z.string().describe('Source'), destination: z.string().describe('Destination') });
|
|
12
|
+
const fsMkdirSchema = z.object({ path: z.string().describe('Directory path'), recursive: z.boolean().optional() });
|
|
13
|
+
const dbQuerySchema = z.object({ query: z.string().describe('SQL query'), type: z.enum(['SELECT', 'INSERT', 'UPDATE', 'DELETE']).optional() });
|
|
14
|
+
const dbBackupSchema = z.object({ tables: z.array(z.string()).optional() });
|
|
15
|
+
const dbOptimizeSchema = z.object({ tables: z.array(z.string()).optional() });
|
|
16
|
+
const dbTablesSchema = z.object({ prefix: z.string().optional() });
|
|
17
|
+
const dbTableStructureSchema = z.object({ table: z.string().describe('Table name') });
|
|
18
|
+
const dbTableInfoSchema = z.object({ table: z.string().describe('Table name') });
|
|
19
|
+
const dbExportSqlSchema = z.object({ tables: z.array(z.string()).optional() });
|
|
20
|
+
const dbImportSqlSchema = z.object({ sql: z.string().describe('SQL statements') });
|
|
21
|
+
const settingsGetOptionSchema = z.object({ option: z.string().describe('Option name') });
|
|
22
|
+
const settingsUpdateOptionSchema = z.object({ option: z.string().describe('Option name'), value: z.any().describe('Value') });
|
|
23
|
+
const settingsListOptionsSchema = z.object({ search: z.string().optional(), limit: z.number().optional() });
|
|
24
|
+
const settingsEmptySchema = z.object({});
|
|
100
25
|
const themeListSchema = z.object({});
|
|
101
|
-
const themeActivateSchema = z.object({
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
});
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
});
|
|
26
|
+
const themeActivateSchema = z.object({ theme: z.string().describe('Theme slug') });
|
|
27
|
+
const themeInstallSchema = z.object({ slug: z.string().describe('Theme slug from WordPress.org') });
|
|
28
|
+
const themeDeleteSchema = z.object({ theme: z.string().describe('Theme slug to delete') });
|
|
29
|
+
const themeSearchSchema = z.object({ search: z.string().optional(), tag: z.string().optional(), page: z.number().optional(), per_page: z.number().optional() });
|
|
30
|
+
const themeUpdateSchema = z.object({ theme: z.string().describe('Theme slug to update') });
|
|
31
|
+
const sysCronJobsSchema = z.object({});
|
|
32
|
+
const sysRunCronSchema = z.object({ hook: z.string().describe('Cron hook name') });
|
|
33
|
+
const sysTransientsSchema = z.object({});
|
|
34
|
+
const sysSecurityScanSchema = z.object({});
|
|
35
|
+
const sysPerformanceSchema = z.object({});
|
|
36
|
+
const configWpConfigSchema = z.object({});
|
|
37
|
+
const configHtaccessSchema = z.object({ content: z.string().optional().describe('New content or omit to read') });
|
|
38
|
+
const wooProductListSchema = z.object({ per_page: z.number().optional(), page: z.number().optional(), search: z.string().optional(), status: z.enum(['publish', 'draft', 'pending']).optional() });
|
|
39
|
+
const wooProductCreateSchema = z.object({ name: z.string(), type: z.enum(['simple', 'variable', 'grouped', 'external']).optional(), regular_price: z.string().optional(), description: z.string().optional() });
|
|
40
|
+
const wooProductGetSchema = z.object({ id: z.number().describe('Product ID') });
|
|
41
|
+
const wooProductUpdateSchema = z.object({ id: z.number(), name: z.string().optional(), regular_price: z.string().optional(), description: z.string().optional(), stock_quantity: z.number().optional() });
|
|
42
|
+
const wooProductDeleteSchema = z.object({ id: z.number(), force: z.boolean().optional() });
|
|
43
|
+
const wooOrderListSchema = z.object({ per_page: z.number().optional(), page: z.number().optional(), status: z.string().optional() });
|
|
44
|
+
const wooOrderCreateSchema = z.object({ status: z.string().optional(), customer_id: z.number().optional() });
|
|
45
|
+
const wooOrderGetSchema = z.object({ id: z.number().describe('Order ID') });
|
|
46
|
+
const wooOrderUpdateSchema = z.object({ id: z.number(), status: z.string().optional(), customer_note: z.string().optional() });
|
|
47
|
+
const wooOrderDeleteSchema = z.object({ id: z.number(), force: z.boolean().optional() });
|
|
48
|
+
const wooOrderStatusSchema = z.object({ id: z.number(), status: z.string().describe('New status') });
|
|
49
|
+
const wooCustomerListSchema = z.object({ per_page: z.number().optional(), page: z.number().optional(), search: z.string().optional() });
|
|
50
|
+
const wooCustomerCreateSchema = z.object({ email: z.string(), first_name: z.string().optional(), last_name: z.string().optional() });
|
|
51
|
+
const wooCustomerGetSchema = z.object({ id: z.number().describe('Customer ID') });
|
|
52
|
+
const wooCustomerUpdateSchema = z.object({ id: z.number(), email: z.string().optional(), first_name: z.string().optional(), last_name: z.string().optional() });
|
|
53
|
+
const wooCustomerDeleteSchema = z.object({ id: z.number(), force: z.boolean().optional() });
|
|
54
|
+
const wooInventoryStockSchema = z.object({ product_id: z.number(), stock_quantity: z.number() });
|
|
55
|
+
const wooLowStockSchema = z.object({ threshold: z.number().optional() });
|
|
56
|
+
const wooCategoriesSchema = z.object({});
|
|
57
|
+
const wooReportsSchema = z.object({ period: z.enum(['week', 'month', 'year']).optional() });
|
|
58
|
+
const wpCliExecuteSchema = z.object({ command: z.string().describe('WP-CLI command without wp prefix'), args: z.array(z.string()).optional() });
|
|
189
59
|
const wpCliAvailableSchema = z.object({});
|
|
190
|
-
//
|
|
191
|
-
// TOOL DEFINITIONS (Use .shape from schemas defined above)
|
|
192
|
-
// ============================================================================
|
|
60
|
+
// ====== TOOL DEFINITIONS ======
|
|
193
61
|
export const fluentMcpProTools = [
|
|
194
|
-
|
|
195
|
-
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
{
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
|
|
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
|
-
},
|
|
62
|
+
{ name: 'pro_fs_read', description: 'Read file contents from WordPress file system (2MB limit)', inputSchema: { type: 'object', properties: fsReadSchema.shape } },
|
|
63
|
+
{ name: 'pro_fs_write', description: 'Write or create file in WordPress file system', inputSchema: { type: 'object', properties: fsWriteSchema.shape } },
|
|
64
|
+
{ name: 'pro_fs_list', description: 'List directory contents in WordPress file system', inputSchema: { type: 'object', properties: fsListSchema.shape } },
|
|
65
|
+
{ name: 'pro_fs_delete', description: 'Delete file from WordPress file system', inputSchema: { type: 'object', properties: fsDeleteSchema.shape } },
|
|
66
|
+
{ name: 'pro_fs_move', description: 'Move or rename file', inputSchema: { type: 'object', properties: fsMoveSchema.shape } },
|
|
67
|
+
{ name: 'pro_fs_copy', description: 'Copy a file', inputSchema: { type: 'object', properties: fsCopySchema.shape } },
|
|
68
|
+
{ name: 'pro_fs_mkdir', description: 'Create directory', inputSchema: { type: 'object', properties: fsMkdirSchema.shape } },
|
|
69
|
+
{ name: 'pro_db_query', description: 'Execute SQL query on WordPress database', inputSchema: { type: 'object', properties: dbQuerySchema.shape } },
|
|
70
|
+
{ name: 'pro_db_backup', description: 'Create database backup', inputSchema: { type: 'object', properties: dbBackupSchema.shape } },
|
|
71
|
+
{ name: 'pro_db_optimize', description: 'Optimize database tables', inputSchema: { type: 'object', properties: dbOptimizeSchema.shape } },
|
|
72
|
+
{ name: 'pro_db_tables', description: 'List all database tables', inputSchema: { type: 'object', properties: dbTablesSchema.shape } },
|
|
73
|
+
{ name: 'pro_db_table_structure', description: 'Get table column structure', inputSchema: { type: 'object', properties: dbTableStructureSchema.shape } },
|
|
74
|
+
{ name: 'pro_db_table_info', description: 'Get table row count and size', inputSchema: { type: 'object', properties: dbTableInfoSchema.shape } },
|
|
75
|
+
{ name: 'pro_db_export_sql', description: 'Export tables as SQL', inputSchema: { type: 'object', properties: dbExportSqlSchema.shape } },
|
|
76
|
+
{ name: 'pro_db_import_sql', description: 'Import and execute SQL', inputSchema: { type: 'object', properties: dbImportSqlSchema.shape } },
|
|
77
|
+
{ name: 'pro_settings_get_option', description: 'Get a WordPress option value', inputSchema: { type: 'object', properties: settingsGetOptionSchema.shape } },
|
|
78
|
+
{ name: 'pro_settings_update_option', description: 'Update a WordPress option', inputSchema: { type: 'object', properties: settingsUpdateOptionSchema.shape } },
|
|
79
|
+
{ name: 'pro_settings_list_options', description: 'List WordPress options', inputSchema: { type: 'object', properties: settingsListOptionsSchema.shape } },
|
|
80
|
+
{ name: 'pro_settings_general', description: 'Get or update general WordPress settings', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
81
|
+
{ name: 'pro_settings_reading', description: 'Get or update reading settings', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
82
|
+
{ name: 'pro_settings_writing', description: 'Get or update writing settings', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
83
|
+
{ name: 'pro_settings_permalinks', description: 'Get or update permalink settings', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
84
|
+
{ name: 'pro_settings_flush_permalinks', description: 'Flush and regenerate permalink rules', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
85
|
+
{ name: 'pro_settings_clear_cache', description: 'Clear WordPress object and page cache', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
86
|
+
{ name: 'pro_settings_customizer', description: 'Get or update theme customizer settings', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
87
|
+
{ name: 'pro_settings_menus', description: 'List WordPress navigation menus', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
88
|
+
{ name: 'pro_settings_widgets', description: 'List WordPress widget areas and widgets', inputSchema: { type: 'object', properties: settingsEmptySchema.shape } },
|
|
89
|
+
{ name: 'pro_theme_list', description: 'List all installed WordPress themes', inputSchema: { type: 'object', properties: themeListSchema.shape } },
|
|
90
|
+
{ name: 'pro_theme_activate', description: 'Activate an installed WordPress theme', inputSchema: { type: 'object', properties: themeActivateSchema.shape } },
|
|
91
|
+
{ name: 'pro_theme_install', description: 'Install a theme from WordPress.org repository', inputSchema: { type: 'object', properties: themeInstallSchema.shape } },
|
|
92
|
+
{ name: 'pro_theme_delete', description: 'Delete an installed WordPress theme', inputSchema: { type: 'object', properties: themeDeleteSchema.shape } },
|
|
93
|
+
{ name: 'pro_theme_search', description: 'Search the WordPress.org theme directory', inputSchema: { type: 'object', properties: themeSearchSchema.shape } },
|
|
94
|
+
{ name: 'pro_theme_update', description: 'Update a theme to its latest version', inputSchema: { type: 'object', properties: themeUpdateSchema.shape } },
|
|
95
|
+
{ name: 'pro_system_cron_jobs', description: 'List WordPress scheduled cron jobs', inputSchema: { type: 'object', properties: sysCronJobsSchema.shape } },
|
|
96
|
+
{ name: 'pro_system_run_cron', description: 'Manually trigger a cron hook', inputSchema: { type: 'object', properties: sysRunCronSchema.shape } },
|
|
97
|
+
{ name: 'pro_system_transients', description: 'List WordPress transients', inputSchema: { type: 'object', properties: sysTransientsSchema.shape } },
|
|
98
|
+
{ name: 'pro_system_security_scan', description: 'Run a WordPress security scan', inputSchema: { type: 'object', properties: sysSecurityScanSchema.shape } },
|
|
99
|
+
{ name: 'pro_system_performance', description: 'Get server and WordPress performance metrics', inputSchema: { type: 'object', properties: sysPerformanceSchema.shape } },
|
|
100
|
+
{ name: 'pro_config_wp_config', description: 'Read wp-config.php (sensitive values redacted)', inputSchema: { type: 'object', properties: configWpConfigSchema.shape } },
|
|
101
|
+
{ name: 'pro_config_htaccess', description: 'Read or update .htaccess file', inputSchema: { type: 'object', properties: configHtaccessSchema.shape } },
|
|
102
|
+
{ name: 'pro_woo_list_products', description: 'List WooCommerce products', inputSchema: { type: 'object', properties: wooProductListSchema.shape } },
|
|
103
|
+
{ name: 'pro_woo_create_product', description: 'Create a WooCommerce product', inputSchema: { type: 'object', properties: wooProductCreateSchema.shape } },
|
|
104
|
+
{ name: 'pro_woo_get_product', description: 'Get a WooCommerce product by ID', inputSchema: { type: 'object', properties: wooProductGetSchema.shape } },
|
|
105
|
+
{ name: 'pro_woo_update_product', description: 'Update a WooCommerce product', inputSchema: { type: 'object', properties: wooProductUpdateSchema.shape } },
|
|
106
|
+
{ name: 'pro_woo_delete_product', description: 'Delete a WooCommerce product', inputSchema: { type: 'object', properties: wooProductDeleteSchema.shape } },
|
|
107
|
+
{ name: 'pro_woo_list_orders', description: 'List WooCommerce orders', inputSchema: { type: 'object', properties: wooOrderListSchema.shape } },
|
|
108
|
+
{ name: 'pro_woo_create_order', description: 'Create a WooCommerce order', inputSchema: { type: 'object', properties: wooOrderCreateSchema.shape } },
|
|
109
|
+
{ name: 'pro_woo_get_order', description: 'Get a WooCommerce order by ID', inputSchema: { type: 'object', properties: wooOrderGetSchema.shape } },
|
|
110
|
+
{ name: 'pro_woo_update_order', description: 'Update a WooCommerce order', inputSchema: { type: 'object', properties: wooOrderUpdateSchema.shape } },
|
|
111
|
+
{ name: 'pro_woo_delete_order', description: 'Delete a WooCommerce order', inputSchema: { type: 'object', properties: wooOrderDeleteSchema.shape } },
|
|
112
|
+
{ name: 'pro_woo_update_order_status', description: 'Update order status', inputSchema: { type: 'object', properties: wooOrderStatusSchema.shape } },
|
|
113
|
+
{ name: 'pro_woo_list_customers', description: 'List WooCommerce customers', inputSchema: { type: 'object', properties: wooCustomerListSchema.shape } },
|
|
114
|
+
{ name: 'pro_woo_create_customer', description: 'Create a WooCommerce customer', inputSchema: { type: 'object', properties: wooCustomerCreateSchema.shape } },
|
|
115
|
+
{ name: 'pro_woo_get_customer', description: 'Get a WooCommerce customer by ID', inputSchema: { type: 'object', properties: wooCustomerGetSchema.shape } },
|
|
116
|
+
{ name: 'pro_woo_update_customer', description: 'Update a WooCommerce customer', inputSchema: { type: 'object', properties: wooCustomerUpdateSchema.shape } },
|
|
117
|
+
{ name: 'pro_woo_delete_customer', description: 'Delete a WooCommerce customer', inputSchema: { type: 'object', properties: wooCustomerDeleteSchema.shape } },
|
|
118
|
+
{ name: 'pro_woo_inventory_stock', description: 'Update product stock quantity', inputSchema: { type: 'object', properties: wooInventoryStockSchema.shape } },
|
|
119
|
+
{ name: 'pro_woo_low_stock', description: 'Get low stock products', inputSchema: { type: 'object', properties: wooLowStockSchema.shape } },
|
|
120
|
+
{ name: 'pro_woo_categories', description: 'List product categories', inputSchema: { type: 'object', properties: wooCategoriesSchema.shape } },
|
|
121
|
+
{ name: 'pro_woo_reports_sales', description: 'Get WooCommerce sales reports', inputSchema: { type: 'object', properties: wooReportsSchema.shape } },
|
|
122
|
+
{ name: 'pro_woo_reports_top_products', description: 'Get top selling products', inputSchema: { type: 'object', properties: wooReportsSchema.shape } },
|
|
123
|
+
{ name: 'pro_woo_reports_customers', description: 'Get customer reports', inputSchema: { type: 'object', properties: wooReportsSchema.shape } },
|
|
124
|
+
{ name: 'pro_wpcli_execute', description: 'Execute a WP-CLI command', inputSchema: { type: 'object', properties: wpCliExecuteSchema.shape } },
|
|
125
|
+
{ name: 'pro_wpcli_available', description: 'Check if WP-CLI is available', inputSchema: { type: 'object', properties: wpCliAvailableSchema.shape } },
|
|
451
126
|
];
|
|
452
|
-
//
|
|
453
|
-
//
|
|
454
|
-
|
|
455
|
-
|
|
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) => {
|
|
127
|
+
// Total: 64 tools
|
|
128
|
+
// ====== HANDLER HELPERS ======
|
|
129
|
+
function h(method, endpoint, errMsg) {
|
|
130
|
+
return async (args) => {
|
|
892
131
|
try {
|
|
893
|
-
const
|
|
894
|
-
return {
|
|
895
|
-
toolResult: {
|
|
896
|
-
content: [{
|
|
897
|
-
type: 'text',
|
|
898
|
-
text: JSON.stringify(response, null, 2)
|
|
899
|
-
}]
|
|
900
|
-
}
|
|
901
|
-
};
|
|
132
|
+
const r = await makeWordPressRequest(method, endpoint, args);
|
|
133
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(r, null, 2) }] } };
|
|
902
134
|
}
|
|
903
|
-
catch (
|
|
904
|
-
return {
|
|
905
|
-
toolResult: {
|
|
906
|
-
isError: true,
|
|
907
|
-
content: [{
|
|
908
|
-
type: 'text',
|
|
909
|
-
text: `Error listing options: ${error.message}`
|
|
910
|
-
}]
|
|
911
|
-
}
|
|
912
|
-
};
|
|
135
|
+
catch (e) {
|
|
136
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: errMsg + ': ' + e.message }] } };
|
|
913
137
|
}
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
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) => {
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function hId(method, base, idField, errMsg) {
|
|
141
|
+
return async (args) => {
|
|
1182
142
|
try {
|
|
1183
|
-
const
|
|
1184
|
-
return {
|
|
1185
|
-
toolResult: {
|
|
1186
|
-
content: [{
|
|
1187
|
-
type: 'text',
|
|
1188
|
-
text: JSON.stringify(response, null, 2)
|
|
1189
|
-
}]
|
|
1190
|
-
}
|
|
1191
|
-
};
|
|
143
|
+
const r = await makeWordPressRequest(method, base + '/' + args[idField], args);
|
|
144
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(r, null, 2) }] } };
|
|
1192
145
|
}
|
|
1193
|
-
catch (
|
|
1194
|
-
return {
|
|
1195
|
-
toolResult: {
|
|
1196
|
-
isError: true,
|
|
1197
|
-
content: [{
|
|
1198
|
-
type: 'text',
|
|
1199
|
-
text: `Error getting system info: ${error.message}`
|
|
1200
|
-
}]
|
|
1201
|
-
}
|
|
1202
|
-
};
|
|
146
|
+
catch (e) {
|
|
147
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: errMsg + ': ' + e.message }] } };
|
|
1203
148
|
}
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
};
|
|
1275
|
-
}
|
|
1276
|
-
},
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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/woo/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
|
-
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
// ====== HANDLERS - Endpoints match PHP register_rest_route() exactly ======
|
|
152
|
+
export const fluentMcpProHandlers = {
|
|
153
|
+
pro_fs_read: h('POST', 'fc-manager/v1/power/fs/read', 'Error reading file'),
|
|
154
|
+
pro_fs_write: h('POST', 'fc-manager/v1/power/fs/write', 'Error writing file'),
|
|
155
|
+
pro_fs_list: h('POST', 'fc-manager/v1/power/fs/list', 'Error listing directory'),
|
|
156
|
+
pro_fs_delete: h('POST', 'fc-manager/v1/power/fs/delete', 'Error deleting file'),
|
|
157
|
+
pro_fs_move: h('POST', 'fc-manager/v1/power/fs/move', 'Error moving file'),
|
|
158
|
+
pro_fs_copy: h('POST', 'fc-manager/v1/power/fs/copy', 'Error copying file'),
|
|
159
|
+
pro_fs_mkdir: h('POST', 'fc-manager/v1/power/fs/mkdir', 'Error creating directory'),
|
|
160
|
+
pro_db_query: h('POST', 'fc-manager/v1/power/db/query', 'Error executing query'),
|
|
161
|
+
pro_db_backup: h('POST', 'fc-manager/v1/power/db/backup', 'Error creating backup'),
|
|
162
|
+
pro_db_optimize: h('POST', 'fc-manager/v1/power/db/optimize', 'Error optimizing tables'),
|
|
163
|
+
pro_db_tables: h('GET', 'fc-manager/v1/power/db/tables', 'Error listing tables'),
|
|
164
|
+
pro_db_table_structure: h('POST', 'fc-manager/v1/power/db/table-structure', 'Error getting structure'),
|
|
165
|
+
pro_db_table_info: h('POST', 'fc-manager/v1/power/db/table-info', 'Error getting table info'),
|
|
166
|
+
pro_db_export_sql: h('POST', 'fc-manager/v1/power/db/export-sql', 'Error exporting SQL'),
|
|
167
|
+
pro_db_import_sql: h('POST', 'fc-manager/v1/power/db/import-sql', 'Error importing SQL'),
|
|
168
|
+
pro_settings_get_option: h('POST', 'fc-manager/v1/power/settings/get-option', 'Error getting option'),
|
|
169
|
+
pro_settings_update_option: h('POST', 'fc-manager/v1/power/settings/update-option', 'Error updating option'),
|
|
170
|
+
pro_settings_list_options: h('GET', 'fc-manager/v1/power/settings/list-options', 'Error listing options'),
|
|
171
|
+
pro_settings_general: h('GET', 'fc-manager/v1/power/settings/general', 'Error with general settings'),
|
|
172
|
+
pro_settings_reading: h('GET', 'fc-manager/v1/power/settings/reading', 'Error with reading settings'),
|
|
173
|
+
pro_settings_writing: h('GET', 'fc-manager/v1/power/settings/writing', 'Error with writing settings'),
|
|
174
|
+
pro_settings_permalinks: h('GET', 'fc-manager/v1/power/settings/permalinks', 'Error with permalinks'),
|
|
175
|
+
pro_settings_flush_permalinks: h('POST', 'fc-manager/v1/power/settings/flush-permalinks', 'Error flushing permalinks'),
|
|
176
|
+
pro_settings_clear_cache: h('POST', 'fc-manager/v1/power/settings/clear-cache', 'Error clearing cache'),
|
|
177
|
+
pro_settings_customizer: h('GET', 'fc-manager/v1/power/settings/customizer', 'Error with customizer'),
|
|
178
|
+
pro_settings_menus: h('GET', 'fc-manager/v1/power/settings/menus', 'Error listing menus'),
|
|
179
|
+
pro_settings_widgets: h('GET', 'fc-manager/v1/power/settings/widgets', 'Error listing widgets'),
|
|
180
|
+
pro_theme_list: h('GET', 'fc-manager/v1/power/themes/list', 'Error listing themes'),
|
|
181
|
+
pro_theme_activate: h('POST', 'fc-manager/v1/power/themes/activate', 'Error activating theme'),
|
|
182
|
+
pro_theme_install: h('POST', 'fc-manager/v1/power/themes/install', 'Error installing theme'),
|
|
183
|
+
pro_theme_delete: h('POST', 'fc-manager/v1/power/themes/delete', 'Error deleting theme'),
|
|
184
|
+
pro_theme_search: h('GET', 'fc-manager/v1/power/themes/search', 'Error searching themes'),
|
|
185
|
+
pro_theme_update: h('POST', 'fc-manager/v1/power/themes/update', 'Error updating theme'),
|
|
186
|
+
pro_system_cron_jobs: h('GET', 'fc-manager/v1/power/system/cron-jobs', 'Error listing cron jobs'),
|
|
187
|
+
pro_system_run_cron: h('POST', 'fc-manager/v1/power/system/run-cron', 'Error running cron'),
|
|
188
|
+
pro_system_transients: h('GET', 'fc-manager/v1/power/system/transients', 'Error listing transients'),
|
|
189
|
+
pro_system_security_scan: h('POST', 'fc-manager/v1/power/system/security-scan', 'Error running scan'),
|
|
190
|
+
pro_system_performance: h('GET', 'fc-manager/v1/power/system/performance', 'Error getting performance'),
|
|
191
|
+
pro_config_wp_config: h('GET', 'fc-manager/v1/power/config/wp-config', 'Error reading wp-config'),
|
|
192
|
+
pro_config_htaccess: h('GET', 'fc-manager/v1/power/config/htaccess', 'Error with htaccess'),
|
|
193
|
+
pro_woo_list_products: h('GET', 'fc-manager/v1/power/woo/products', 'Error listing products'),
|
|
194
|
+
pro_woo_create_product: h('POST', 'fc-manager/v1/power/woo/products', 'Error creating product'),
|
|
195
|
+
pro_woo_list_orders: h('GET', 'fc-manager/v1/power/woo/orders', 'Error listing orders'),
|
|
196
|
+
pro_woo_create_order: h('POST', 'fc-manager/v1/power/woo/orders', 'Error creating order'),
|
|
197
|
+
pro_woo_list_customers: h('GET', 'fc-manager/v1/power/woo/customers', 'Error listing customers'),
|
|
198
|
+
pro_woo_create_customer: h('POST', 'fc-manager/v1/power/woo/customers', 'Error creating customer'),
|
|
199
|
+
pro_woo_inventory_stock: h('POST', 'fc-manager/v1/power/woo/inventory/stock', 'Error updating stock'),
|
|
200
|
+
pro_woo_low_stock: h('GET', 'fc-manager/v1/power/woo/inventory/low-stock', 'Error getting low stock'),
|
|
201
|
+
pro_woo_categories: h('GET', 'fc-manager/v1/power/woo/categories', 'Error listing categories'),
|
|
202
|
+
pro_woo_reports_sales: h('GET', 'fc-manager/v1/power/woo/reports/sales', 'Error getting sales'),
|
|
203
|
+
pro_woo_reports_top_products: h('GET', 'fc-manager/v1/power/woo/reports/top-products', 'Error getting top products'),
|
|
204
|
+
pro_woo_reports_customers: h('GET', 'fc-manager/v1/power/woo/reports/customers', 'Error getting customer report'),
|
|
205
|
+
pro_wpcli_execute: h('POST', 'fc-manager/v1/power/wpcli/execute', 'Error executing WP-CLI'),
|
|
206
|
+
pro_wpcli_available: h('GET', 'fc-manager/v1/power/wpcli/available', 'Error checking WP-CLI'),
|
|
207
|
+
pro_woo_get_product: hId('GET', 'fc-manager/v1/power/woo/products', 'id', 'Error getting product'),
|
|
208
|
+
pro_woo_update_product: hId('PUT', 'fc-manager/v1/power/woo/products', 'id', 'Error updating product'),
|
|
209
|
+
pro_woo_delete_product: hId('DELETE', 'fc-manager/v1/power/woo/products', 'id', 'Error deleting product'),
|
|
210
|
+
pro_woo_get_order: hId('GET', 'fc-manager/v1/power/woo/orders', 'id', 'Error getting order'),
|
|
211
|
+
pro_woo_update_order: hId('PUT', 'fc-manager/v1/power/woo/orders', 'id', 'Error updating order'),
|
|
212
|
+
pro_woo_delete_order: hId('DELETE', 'fc-manager/v1/power/woo/orders', 'id', 'Error deleting order'),
|
|
213
|
+
pro_woo_update_order_status: async (args) => {
|
|
214
|
+
try {
|
|
215
|
+
const r = await makeWordPressRequest('POST', `fc-manager/v1/power/woo/orders/${args.id}/status`, args);
|
|
216
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(r, null, 2) }] } };
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: 'Error updating status: ' + e.message }] } };
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
pro_woo_get_customer: hId('GET', 'fc-manager/v1/power/woo/customers', 'id', 'Error getting customer'),
|
|
223
|
+
pro_woo_update_customer: hId('PUT', 'fc-manager/v1/power/woo/customers', 'id', 'Error updating customer'),
|
|
224
|
+
pro_woo_delete_customer: hId('DELETE', 'fc-manager/v1/power/woo/customers', 'id', 'Error deleting customer'),
|
|
1663
225
|
};
|
|
226
|
+
// Verification: 64 tools, 64 handlers
|