@wplaunchify/ml-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +220 -0
- package/build/cli.d.ts +2 -0
- package/build/cli.js +52 -0
- package/build/server.d.ts +2 -0
- package/build/server.js +97 -0
- package/build/tools/comments.d.ts +212 -0
- package/build/tools/comments.js +181 -0
- package/build/tools/fluent-affiliate.d.ts +2 -0
- package/build/tools/fluent-affiliate.js +3 -0
- package/build/tools/fluent-cart.d.ts +706 -0
- package/build/tools/fluent-cart.js +642 -0
- package/build/tools/fluent-community-BACKUP.d.ts +364 -0
- package/build/tools/fluent-community-BACKUP.js +883 -0
- package/build/tools/fluent-community-MINIMAL.d.ts +69 -0
- package/build/tools/fluent-community-MINIMAL.js +92 -0
- package/build/tools/fluent-community-design.d.ts +3 -0
- package/build/tools/fluent-community-design.js +150 -0
- package/build/tools/fluent-community-layout.d.ts +119 -0
- package/build/tools/fluent-community-layout.js +88 -0
- package/build/tools/fluent-community.d.ts +364 -0
- package/build/tools/fluent-community.js +528 -0
- package/build/tools/fluent-crm.d.ts +3 -0
- package/build/tools/fluent-crm.js +392 -0
- package/build/tools/index.d.ts +2205 -0
- package/build/tools/index.js +54 -0
- package/build/tools/media.d.ts +135 -0
- package/build/tools/media.js +168 -0
- package/build/tools/ml-canvas.d.ts +91 -0
- package/build/tools/ml-canvas.js +109 -0
- package/build/tools/ml-image-editor.d.ts +230 -0
- package/build/tools/ml-image-editor.js +270 -0
- package/build/tools/ml-media-hub.d.ts +575 -0
- package/build/tools/ml-media-hub.js +714 -0
- package/build/tools/plugin-repository.d.ts +62 -0
- package/build/tools/plugin-repository.js +149 -0
- package/build/tools/plugins.d.ts +129 -0
- package/build/tools/plugins.js +148 -0
- package/build/tools/unified-content.d.ts +313 -0
- package/build/tools/unified-content.js +615 -0
- package/build/tools/unified-taxonomies.d.ts +229 -0
- package/build/tools/unified-taxonomies.js +479 -0
- package/build/tools/users.d.ts +227 -0
- package/build/tools/users.js +182 -0
- package/build/types/wordpress-types.d.ts +151 -0
- package/build/types/wordpress-types.js +2 -0
- package/build/wordpress.d.ts +26 -0
- package/build/wordpress.js +223 -0
- package/package.json +67 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const mlImageEditorTools: ({
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
prompt: z.ZodString;
|
|
9
|
+
aspectRatio: z.ZodOptional<z.ZodEnum<["1:1", "4:3", "16:9", "9:16"]>>;
|
|
10
|
+
selectedImages: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
11
|
+
externalImageUrl: z.ZodOptional<z.ZodString>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object";
|
|
19
|
+
properties: {
|
|
20
|
+
imageId: z.ZodNumber;
|
|
21
|
+
prompt: z.ZodString;
|
|
22
|
+
preserveOriginal: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object";
|
|
30
|
+
properties: {
|
|
31
|
+
imageId: z.ZodNumber;
|
|
32
|
+
prompt: z.ZodString;
|
|
33
|
+
iterationStrength: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
numberOfVariations: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object";
|
|
42
|
+
properties: {
|
|
43
|
+
prompts: z.ZodArray<z.ZodObject<{
|
|
44
|
+
prompt: z.ZodString;
|
|
45
|
+
title: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
prompt: string;
|
|
48
|
+
title?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
prompt: string;
|
|
51
|
+
title?: string | undefined;
|
|
52
|
+
}>, "many">;
|
|
53
|
+
sharedSettings: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
aspectRatio: z.ZodOptional<z.ZodEnum<["1:1", "4:3", "16:9", "9:16"]>>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
aspectRatio?: "1:1" | "4:3" | "16:9" | "9:16" | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
aspectRatio?: "1:1" | "4:3" | "16:9" | "9:16" | undefined;
|
|
59
|
+
}>>;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
} | {
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: "object";
|
|
67
|
+
properties: {
|
|
68
|
+
operationType: z.ZodOptional<z.ZodEnum<["generated", "edited", "iterated", "all"]>>;
|
|
69
|
+
category: z.ZodOptional<z.ZodString>;
|
|
70
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
orderBy: z.ZodOptional<z.ZodEnum<["date", "title", "modified"]>>;
|
|
73
|
+
order: z.ZodOptional<z.ZodEnum<["DESC", "ASC"]>>;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
} | {
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
inputSchema: {
|
|
80
|
+
type: "object";
|
|
81
|
+
properties: {
|
|
82
|
+
id: z.ZodNumber;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
} | {
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: "object";
|
|
90
|
+
properties: {};
|
|
91
|
+
};
|
|
92
|
+
})[];
|
|
93
|
+
export declare const mlImageEditorHandlers: {
|
|
94
|
+
mlimg_generate: (args: any) => Promise<{
|
|
95
|
+
toolResult: {
|
|
96
|
+
content: {
|
|
97
|
+
type: string;
|
|
98
|
+
text: string;
|
|
99
|
+
}[];
|
|
100
|
+
isError?: undefined;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
103
|
+
toolResult: {
|
|
104
|
+
isError: boolean;
|
|
105
|
+
content: {
|
|
106
|
+
type: string;
|
|
107
|
+
text: string;
|
|
108
|
+
}[];
|
|
109
|
+
};
|
|
110
|
+
}>;
|
|
111
|
+
mlimg_edit: (args: any) => Promise<{
|
|
112
|
+
toolResult: {
|
|
113
|
+
content: {
|
|
114
|
+
type: string;
|
|
115
|
+
text: string;
|
|
116
|
+
}[];
|
|
117
|
+
isError?: undefined;
|
|
118
|
+
};
|
|
119
|
+
} | {
|
|
120
|
+
toolResult: {
|
|
121
|
+
isError: boolean;
|
|
122
|
+
content: {
|
|
123
|
+
type: string;
|
|
124
|
+
text: string;
|
|
125
|
+
}[];
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
mlimg_iterate: (args: any) => Promise<{
|
|
129
|
+
toolResult: {
|
|
130
|
+
content: {
|
|
131
|
+
type: string;
|
|
132
|
+
text: string;
|
|
133
|
+
}[];
|
|
134
|
+
isError?: undefined;
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
137
|
+
toolResult: {
|
|
138
|
+
isError: boolean;
|
|
139
|
+
content: {
|
|
140
|
+
type: string;
|
|
141
|
+
text: string;
|
|
142
|
+
}[];
|
|
143
|
+
};
|
|
144
|
+
}>;
|
|
145
|
+
mlimg_batch_generate: (args: any) => Promise<{
|
|
146
|
+
toolResult: {
|
|
147
|
+
content: {
|
|
148
|
+
type: string;
|
|
149
|
+
text: string;
|
|
150
|
+
}[];
|
|
151
|
+
isError?: undefined;
|
|
152
|
+
};
|
|
153
|
+
} | {
|
|
154
|
+
toolResult: {
|
|
155
|
+
isError: boolean;
|
|
156
|
+
content: {
|
|
157
|
+
type: string;
|
|
158
|
+
text: string;
|
|
159
|
+
}[];
|
|
160
|
+
};
|
|
161
|
+
}>;
|
|
162
|
+
mlimg_list_images: (args: any) => Promise<{
|
|
163
|
+
toolResult: {
|
|
164
|
+
content: {
|
|
165
|
+
type: string;
|
|
166
|
+
text: string;
|
|
167
|
+
}[];
|
|
168
|
+
isError?: undefined;
|
|
169
|
+
};
|
|
170
|
+
} | {
|
|
171
|
+
toolResult: {
|
|
172
|
+
isError: boolean;
|
|
173
|
+
content: {
|
|
174
|
+
type: string;
|
|
175
|
+
text: string;
|
|
176
|
+
}[];
|
|
177
|
+
};
|
|
178
|
+
}>;
|
|
179
|
+
mlimg_get_history: (args: any) => Promise<{
|
|
180
|
+
toolResult: {
|
|
181
|
+
content: {
|
|
182
|
+
type: string;
|
|
183
|
+
text: string;
|
|
184
|
+
}[];
|
|
185
|
+
isError?: undefined;
|
|
186
|
+
};
|
|
187
|
+
} | {
|
|
188
|
+
toolResult: {
|
|
189
|
+
isError: boolean;
|
|
190
|
+
content: {
|
|
191
|
+
type: string;
|
|
192
|
+
text: string;
|
|
193
|
+
}[];
|
|
194
|
+
};
|
|
195
|
+
}>;
|
|
196
|
+
mlimg_list_categories: (args: any) => Promise<{
|
|
197
|
+
toolResult: {
|
|
198
|
+
content: {
|
|
199
|
+
type: string;
|
|
200
|
+
text: string;
|
|
201
|
+
}[];
|
|
202
|
+
isError?: undefined;
|
|
203
|
+
};
|
|
204
|
+
} | {
|
|
205
|
+
toolResult: {
|
|
206
|
+
isError: boolean;
|
|
207
|
+
content: {
|
|
208
|
+
type: string;
|
|
209
|
+
text: string;
|
|
210
|
+
}[];
|
|
211
|
+
};
|
|
212
|
+
}>;
|
|
213
|
+
mlimg_health: (args: any) => Promise<{
|
|
214
|
+
toolResult: {
|
|
215
|
+
content: {
|
|
216
|
+
type: string;
|
|
217
|
+
text: string;
|
|
218
|
+
}[];
|
|
219
|
+
isError?: undefined;
|
|
220
|
+
};
|
|
221
|
+
} | {
|
|
222
|
+
toolResult: {
|
|
223
|
+
isError: boolean;
|
|
224
|
+
content: {
|
|
225
|
+
type: string;
|
|
226
|
+
text: string;
|
|
227
|
+
}[];
|
|
228
|
+
};
|
|
229
|
+
}>;
|
|
230
|
+
};
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// ML Image Editor Tools - AI Image Generation & Editing via Gemini 2.5 Flash
|
|
4
|
+
export const mlImageEditorTools = [
|
|
5
|
+
{
|
|
6
|
+
name: 'mlimg_generate',
|
|
7
|
+
description: 'Generate new AI image from text prompt using Gemini 2.5 Flash. Perfect for creating custom images, illustrations, and visual content.',
|
|
8
|
+
inputSchema: { type: 'object', properties: z.object({
|
|
9
|
+
prompt: z.string().describe('Text description of image to generate (required)'),
|
|
10
|
+
aspectRatio: z.enum(['1:1', '4:3', '16:9', '9:16']).optional().describe('Image aspect ratio (default: 1:1)'),
|
|
11
|
+
selectedImages: z.array(z.number()).optional().describe('Reference image attachment IDs'),
|
|
12
|
+
externalImageUrl: z.string().optional().describe('External reference image URL'),
|
|
13
|
+
}).shape },
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'mlimg_edit',
|
|
17
|
+
description: 'Edit existing image with AI. Modify colors, add elements, change styles, or transform existing images.',
|
|
18
|
+
inputSchema: { type: 'object', properties: z.object({
|
|
19
|
+
imageId: z.number().describe('WordPress attachment ID to edit (required)'),
|
|
20
|
+
prompt: z.string().describe('How to modify the image (required)'),
|
|
21
|
+
preserveOriginal: z.boolean().optional().describe('Keep original image (default: true)'),
|
|
22
|
+
}).shape },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'mlimg_iterate',
|
|
26
|
+
description: 'Create variations of existing image. Generate multiple versions with different styles or modifications.',
|
|
27
|
+
inputSchema: { type: 'object', properties: z.object({
|
|
28
|
+
imageId: z.number().describe('Base image attachment ID (required)'),
|
|
29
|
+
prompt: z.string().describe('How to vary the image (required)'),
|
|
30
|
+
iterationStrength: z.number().min(0).max(1).optional().describe('Variation strength 0-1 (default: 0.5)'),
|
|
31
|
+
numberOfVariations: z.number().min(1).max(4).optional().describe('Number of variations 1-4 (default: 1)'),
|
|
32
|
+
}).shape },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'mlimg_batch_generate',
|
|
36
|
+
description: 'Generate multiple AI images in batch. Create multiple images from different prompts in one request.',
|
|
37
|
+
inputSchema: { type: 'object', properties: z.object({
|
|
38
|
+
prompts: z.array(z.object({
|
|
39
|
+
prompt: z.string().describe('Image description'),
|
|
40
|
+
title: z.string().optional().describe('Image title'),
|
|
41
|
+
})).describe('Array of prompts to generate (required)'),
|
|
42
|
+
sharedSettings: z.object({
|
|
43
|
+
aspectRatio: z.enum(['1:1', '4:3', '16:9', '9:16']).optional(),
|
|
44
|
+
}).optional().describe('Settings applied to all generations'),
|
|
45
|
+
}).shape },
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'mlimg_list_images',
|
|
49
|
+
description: 'List AI-generated/edited images. Filter by operation type, category, and more.',
|
|
50
|
+
inputSchema: { type: 'object', properties: z.object({
|
|
51
|
+
operationType: z.enum(['generated', 'edited', 'iterated', 'all']).optional().describe('Filter by operation (default: all)'),
|
|
52
|
+
category: z.string().optional().describe('Filter by media category'),
|
|
53
|
+
perPage: z.number().min(1).max(100).optional().describe('Items per page (default: 20)'),
|
|
54
|
+
page: z.number().min(1).optional().describe('Page number (default: 1)'),
|
|
55
|
+
orderBy: z.enum(['date', 'title', 'modified']).optional().describe('Sort by (default: date)'),
|
|
56
|
+
order: z.enum(['DESC', 'ASC']).optional().describe('Sort order (default: DESC)'),
|
|
57
|
+
}).shape },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'mlimg_get_history',
|
|
61
|
+
description: 'Get image generation/editing history for a specific image. See all operations performed on an image.',
|
|
62
|
+
inputSchema: { type: 'object', properties: z.object({
|
|
63
|
+
id: z.number().describe('Attachment ID (required)'),
|
|
64
|
+
}).shape },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'mlimg_list_categories',
|
|
68
|
+
description: 'List media categories available for organizing AI-generated images.',
|
|
69
|
+
inputSchema: { type: 'object', properties: {} },
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'mlimg_health',
|
|
73
|
+
description: 'Check ML Image Editor API health and configuration. Verify plugin is installed and API keys are configured.',
|
|
74
|
+
inputSchema: { type: 'object', properties: {} },
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
export const mlImageEditorHandlers = {
|
|
78
|
+
mlimg_generate: async (args) => {
|
|
79
|
+
try {
|
|
80
|
+
const response = await makeWordPressRequest('POST', 'ml-image/v1/generate', args);
|
|
81
|
+
return {
|
|
82
|
+
toolResult: {
|
|
83
|
+
content: [{
|
|
84
|
+
type: 'text',
|
|
85
|
+
text: JSON.stringify(response, null, 2)
|
|
86
|
+
}]
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
return {
|
|
92
|
+
toolResult: {
|
|
93
|
+
isError: true,
|
|
94
|
+
content: [{
|
|
95
|
+
type: 'text',
|
|
96
|
+
text: `Error generating image: ${error.message}`
|
|
97
|
+
}]
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
mlimg_edit: async (args) => {
|
|
103
|
+
try {
|
|
104
|
+
const response = await makeWordPressRequest('POST', 'ml-image/v1/edit', args);
|
|
105
|
+
return {
|
|
106
|
+
toolResult: {
|
|
107
|
+
content: [{
|
|
108
|
+
type: 'text',
|
|
109
|
+
text: JSON.stringify(response, null, 2)
|
|
110
|
+
}]
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
return {
|
|
116
|
+
toolResult: {
|
|
117
|
+
isError: true,
|
|
118
|
+
content: [{
|
|
119
|
+
type: 'text',
|
|
120
|
+
text: `Error editing image: ${error.message}`
|
|
121
|
+
}]
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
mlimg_iterate: async (args) => {
|
|
127
|
+
try {
|
|
128
|
+
const response = await makeWordPressRequest('POST', 'ml-image/v1/iterate', args);
|
|
129
|
+
return {
|
|
130
|
+
toolResult: {
|
|
131
|
+
content: [{
|
|
132
|
+
type: 'text',
|
|
133
|
+
text: JSON.stringify(response, null, 2)
|
|
134
|
+
}]
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
return {
|
|
140
|
+
toolResult: {
|
|
141
|
+
isError: true,
|
|
142
|
+
content: [{
|
|
143
|
+
type: 'text',
|
|
144
|
+
text: `Error iterating image: ${error.message}`
|
|
145
|
+
}]
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
mlimg_batch_generate: async (args) => {
|
|
151
|
+
try {
|
|
152
|
+
const response = await makeWordPressRequest('POST', 'ml-image/v1/batch-generate', args);
|
|
153
|
+
return {
|
|
154
|
+
toolResult: {
|
|
155
|
+
content: [{
|
|
156
|
+
type: 'text',
|
|
157
|
+
text: JSON.stringify(response, null, 2)
|
|
158
|
+
}]
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
return {
|
|
164
|
+
toolResult: {
|
|
165
|
+
isError: true,
|
|
166
|
+
content: [{
|
|
167
|
+
type: 'text',
|
|
168
|
+
text: `Error batch generating images: ${error.message}`
|
|
169
|
+
}]
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
mlimg_list_images: async (args) => {
|
|
175
|
+
try {
|
|
176
|
+
const response = await makeWordPressRequest('GET', 'ml-image/v1/ai-images', args);
|
|
177
|
+
return {
|
|
178
|
+
toolResult: {
|
|
179
|
+
content: [{
|
|
180
|
+
type: 'text',
|
|
181
|
+
text: JSON.stringify(response, null, 2)
|
|
182
|
+
}]
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
return {
|
|
188
|
+
toolResult: {
|
|
189
|
+
isError: true,
|
|
190
|
+
content: [{
|
|
191
|
+
type: 'text',
|
|
192
|
+
text: `Error listing images: ${error.message}`
|
|
193
|
+
}]
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
mlimg_get_history: async (args) => {
|
|
199
|
+
try {
|
|
200
|
+
const response = await makeWordPressRequest('GET', `ml-image/v1/ai-images/${args.id}/history`);
|
|
201
|
+
return {
|
|
202
|
+
toolResult: {
|
|
203
|
+
content: [{
|
|
204
|
+
type: 'text',
|
|
205
|
+
text: JSON.stringify(response, null, 2)
|
|
206
|
+
}]
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
return {
|
|
212
|
+
toolResult: {
|
|
213
|
+
isError: true,
|
|
214
|
+
content: [{
|
|
215
|
+
type: 'text',
|
|
216
|
+
text: `Error getting image history: ${error.message}`
|
|
217
|
+
}]
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
mlimg_list_categories: async (args) => {
|
|
223
|
+
try {
|
|
224
|
+
const response = await makeWordPressRequest('GET', 'ml-image/v1/categories');
|
|
225
|
+
return {
|
|
226
|
+
toolResult: {
|
|
227
|
+
content: [{
|
|
228
|
+
type: 'text',
|
|
229
|
+
text: JSON.stringify(response, null, 2)
|
|
230
|
+
}]
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
return {
|
|
236
|
+
toolResult: {
|
|
237
|
+
isError: true,
|
|
238
|
+
content: [{
|
|
239
|
+
type: 'text',
|
|
240
|
+
text: `Error listing categories: ${error.message}`
|
|
241
|
+
}]
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
mlimg_health: async (args) => {
|
|
247
|
+
try {
|
|
248
|
+
const response = await makeWordPressRequest('GET', 'ml-image/v1/health');
|
|
249
|
+
return {
|
|
250
|
+
toolResult: {
|
|
251
|
+
content: [{
|
|
252
|
+
type: 'text',
|
|
253
|
+
text: JSON.stringify(response, null, 2)
|
|
254
|
+
}]
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
return {
|
|
260
|
+
toolResult: {
|
|
261
|
+
isError: true,
|
|
262
|
+
content: [{
|
|
263
|
+
type: 'text',
|
|
264
|
+
text: `Error checking ML Image Editor health: ${error.message}`
|
|
265
|
+
}]
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
};
|