@connect-xlab/mcp-server 0.1.2 → 0.2.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/dist/index.js +128 -0
- package/dist/tools/addCalendarQuestion.js +41 -0
- package/dist/tools/addSmartJoinQuestion.js +38 -0
- package/dist/tools/addSubscriptionPrice.js +33 -0
- package/dist/tools/clearSmartJoinResponses.js +26 -0
- package/dist/tools/createCompany.js +48 -0
- package/dist/tools/createCompanyCategory.js +29 -0
- package/dist/tools/createFunnel.js +40 -0
- package/dist/tools/createPost.js +4 -1
- package/dist/tools/createShopProduct.js +5 -3
- package/dist/tools/deleteCalendarQuestion.js +29 -0
- package/dist/tools/deleteCompany.js +29 -0
- package/dist/tools/deleteCompanyCategory.js +29 -0
- package/dist/tools/deleteFunnel.js +29 -0
- package/dist/tools/deleteFunnelItem.js +34 -0
- package/dist/tools/deleteNewsletterEdition.js +29 -0
- package/dist/tools/deleteNewsletterSubscriber.js +29 -0
- package/dist/tools/deleteSmartJoinQuestion.js +29 -0
- package/dist/tools/deleteSubscriptionPrice.js +29 -0
- package/dist/tools/duplicateSmartJoinQuestion.js +29 -0
- package/dist/tools/getCalendar.js +26 -0
- package/dist/tools/getCalendarPipeline.js +26 -0
- package/dist/tools/getFunnel.js +35 -0
- package/dist/tools/getFunnelStats.js +35 -0
- package/dist/tools/getLabAffiliationConfig.js +29 -0
- package/dist/tools/getNewsletterEdition.js +29 -0
- package/dist/tools/getNewsletterRevenue.js +28 -0
- package/dist/tools/getNewsletterSettings.js +28 -0
- package/dist/tools/getProductAffiliationConfig.js +36 -0
- package/dist/tools/getSmartJoin.js +26 -0
- package/dist/tools/getSubscriptionSettings.js +29 -0
- package/dist/tools/listCompanies.js +34 -0
- package/dist/tools/listCompanyCategories.js +28 -0
- package/dist/tools/listFunnelOffers.js +29 -0
- package/dist/tools/listLabAffiliates.js +40 -0
- package/dist/tools/listPixelRequests.js +45 -0
- package/dist/tools/listProductAffiliates.js +49 -0
- package/dist/tools/listSmartJoinResponses.js +40 -0
- package/dist/tools/manageLabAffiliate.js +41 -0
- package/dist/tools/managePixelRequest.js +35 -0
- package/dist/tools/manageProductAffiliate.js +45 -0
- package/dist/tools/reactivateNewsletter.js +28 -0
- package/dist/tools/reorderClass.js +34 -0
- package/dist/tools/reorderSmartJoinQuestions.js +32 -0
- package/dist/tools/scheduleNewsletterEdition.js +34 -0
- package/dist/tools/setCurrentSubscriptionPrice.js +34 -0
- package/dist/tools/setFunnelItem.js +94 -0
- package/dist/tools/stopNewsletter.js +28 -0
- package/dist/tools/updateCalendar.js +70 -0
- package/dist/tools/updateCalendarAvailability.js +51 -0
- package/dist/tools/updateCalendarDisqualifRules.js +48 -0
- package/dist/tools/updateCalendarFollowupConfig.js +51 -0
- package/dist/tools/updateCalendarQuestion.js +43 -0
- package/dist/tools/updateCompany.js +49 -0
- package/dist/tools/updateCompanyCategory.js +34 -0
- package/dist/tools/updateFunnel.js +37 -0
- package/dist/tools/updateLabAffiliationConfig.js +44 -0
- package/dist/tools/updateLinkInBio.js +13 -13
- package/dist/tools/updateNewsletterEdition.js +43 -0
- package/dist/tools/updateNewsletterSettings.js +63 -0
- package/dist/tools/updatePost.js +3 -1
- package/dist/tools/updateProductAffiliationConfig.js +43 -0
- package/dist/tools/updateShopProduct.js +5 -1
- package/dist/tools/updateSmartJoinQuestion.js +40 -0
- package/dist/tools/updateSmartJoinSettings.js +29 -0
- package/dist/tools/updateTrialSettings.js +34 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91,6 +91,66 @@ import { createLinkInBioBlockTool } from './tools/createLinkInBioBlock.js';
|
|
|
91
91
|
import { updateLinkInBioBlockTool } from './tools/updateLinkInBioBlock.js';
|
|
92
92
|
import { deleteLinkInBioBlockTool } from './tools/deleteLinkInBioBlock.js';
|
|
93
93
|
import { reorderLinkInBioBlocksTool } from './tools/reorderLinkInBioBlocks.js';
|
|
94
|
+
import { listCompaniesTool } from './tools/listCompanies.js';
|
|
95
|
+
import { createCompanyTool } from './tools/createCompany.js';
|
|
96
|
+
import { updateCompanyTool } from './tools/updateCompany.js';
|
|
97
|
+
import { deleteCompanyTool } from './tools/deleteCompany.js';
|
|
98
|
+
import { listCompanyCategoriesTool } from './tools/listCompanyCategories.js';
|
|
99
|
+
import { createCompanyCategoryTool } from './tools/createCompanyCategory.js';
|
|
100
|
+
import { updateCompanyCategoryTool } from './tools/updateCompanyCategory.js';
|
|
101
|
+
import { deleteCompanyCategoryTool } from './tools/deleteCompanyCategory.js';
|
|
102
|
+
import { listFunnelOffersTool } from './tools/listFunnelOffers.js';
|
|
103
|
+
import { getFunnelTool } from './tools/getFunnel.js';
|
|
104
|
+
import { createFunnelTool } from './tools/createFunnel.js';
|
|
105
|
+
import { updateFunnelTool } from './tools/updateFunnel.js';
|
|
106
|
+
import { deleteFunnelTool } from './tools/deleteFunnel.js';
|
|
107
|
+
import { setFunnelItemTool } from './tools/setFunnelItem.js';
|
|
108
|
+
import { deleteFunnelItemTool } from './tools/deleteFunnelItem.js';
|
|
109
|
+
import { getFunnelStatsTool } from './tools/getFunnelStats.js';
|
|
110
|
+
import { getProductAffiliationConfigTool } from './tools/getProductAffiliationConfig.js';
|
|
111
|
+
import { updateProductAffiliationConfigTool } from './tools/updateProductAffiliationConfig.js';
|
|
112
|
+
import { listProductAffiliatesTool } from './tools/listProductAffiliates.js';
|
|
113
|
+
import { manageProductAffiliateTool } from './tools/manageProductAffiliate.js';
|
|
114
|
+
import { getLabAffiliationConfigTool } from './tools/getLabAffiliationConfig.js';
|
|
115
|
+
import { updateLabAffiliationConfigTool } from './tools/updateLabAffiliationConfig.js';
|
|
116
|
+
import { listLabAffiliatesTool } from './tools/listLabAffiliates.js';
|
|
117
|
+
import { manageLabAffiliateTool } from './tools/manageLabAffiliate.js';
|
|
118
|
+
import { getSubscriptionSettingsTool } from './tools/getSubscriptionSettings.js';
|
|
119
|
+
import { addSubscriptionPriceTool } from './tools/addSubscriptionPrice.js';
|
|
120
|
+
import { setCurrentSubscriptionPriceTool } from './tools/setCurrentSubscriptionPrice.js';
|
|
121
|
+
import { deleteSubscriptionPriceTool } from './tools/deleteSubscriptionPrice.js';
|
|
122
|
+
import { updateTrialSettingsTool } from './tools/updateTrialSettings.js';
|
|
123
|
+
import { listPixelRequestsTool } from './tools/listPixelRequests.js';
|
|
124
|
+
import { managePixelRequestTool } from './tools/managePixelRequest.js';
|
|
125
|
+
import { getNewsletterEditionTool } from './tools/getNewsletterEdition.js';
|
|
126
|
+
import { updateNewsletterEditionTool } from './tools/updateNewsletterEdition.js';
|
|
127
|
+
import { deleteNewsletterEditionTool } from './tools/deleteNewsletterEdition.js';
|
|
128
|
+
import { scheduleNewsletterEditionTool } from './tools/scheduleNewsletterEdition.js';
|
|
129
|
+
import { deleteNewsletterSubscriberTool } from './tools/deleteNewsletterSubscriber.js';
|
|
130
|
+
import { getNewsletterSettingsTool } from './tools/getNewsletterSettings.js';
|
|
131
|
+
import { updateNewsletterSettingsTool } from './tools/updateNewsletterSettings.js';
|
|
132
|
+
import { getNewsletterRevenueTool } from './tools/getNewsletterRevenue.js';
|
|
133
|
+
import { stopNewsletterTool } from './tools/stopNewsletter.js';
|
|
134
|
+
import { reactivateNewsletterTool } from './tools/reactivateNewsletter.js';
|
|
135
|
+
import { reorderClassTool } from './tools/reorderClass.js';
|
|
136
|
+
import { getCalendarTool } from './tools/getCalendar.js';
|
|
137
|
+
import { getCalendarPipelineTool } from './tools/getCalendarPipeline.js';
|
|
138
|
+
import { updateCalendarTool } from './tools/updateCalendar.js';
|
|
139
|
+
import { updateCalendarAvailabilityTool } from './tools/updateCalendarAvailability.js';
|
|
140
|
+
import { addCalendarQuestionTool } from './tools/addCalendarQuestion.js';
|
|
141
|
+
import { updateCalendarQuestionTool } from './tools/updateCalendarQuestion.js';
|
|
142
|
+
import { deleteCalendarQuestionTool } from './tools/deleteCalendarQuestion.js';
|
|
143
|
+
import { updateCalendarDisqualifRulesTool } from './tools/updateCalendarDisqualifRules.js';
|
|
144
|
+
import { updateCalendarFollowupConfigTool } from './tools/updateCalendarFollowupConfig.js';
|
|
145
|
+
import { getSmartJoinTool } from './tools/getSmartJoin.js';
|
|
146
|
+
import { updateSmartJoinSettingsTool } from './tools/updateSmartJoinSettings.js';
|
|
147
|
+
import { addSmartJoinQuestionTool } from './tools/addSmartJoinQuestion.js';
|
|
148
|
+
import { updateSmartJoinQuestionTool } from './tools/updateSmartJoinQuestion.js';
|
|
149
|
+
import { reorderSmartJoinQuestionsTool } from './tools/reorderSmartJoinQuestions.js';
|
|
150
|
+
import { deleteSmartJoinQuestionTool } from './tools/deleteSmartJoinQuestion.js';
|
|
151
|
+
import { duplicateSmartJoinQuestionTool } from './tools/duplicateSmartJoinQuestion.js';
|
|
152
|
+
import { listSmartJoinResponsesTool } from './tools/listSmartJoinResponses.js';
|
|
153
|
+
import { clearSmartJoinResponsesTool } from './tools/clearSmartJoinResponses.js';
|
|
94
154
|
const tools = [
|
|
95
155
|
listLabsTool,
|
|
96
156
|
listMembersTool,
|
|
@@ -170,6 +230,74 @@ const tools = [
|
|
|
170
230
|
updateLinkInBioBlockTool,
|
|
171
231
|
deleteLinkInBioBlockTool,
|
|
172
232
|
reorderLinkInBioBlocksTool,
|
|
233
|
+
// Marketplace (societes + categories)
|
|
234
|
+
listCompaniesTool,
|
|
235
|
+
createCompanyTool,
|
|
236
|
+
updateCompanyTool,
|
|
237
|
+
deleteCompanyTool,
|
|
238
|
+
listCompanyCategoriesTool,
|
|
239
|
+
createCompanyCategoryTool,
|
|
240
|
+
updateCompanyCategoryTool,
|
|
241
|
+
deleteCompanyCategoryTool,
|
|
242
|
+
// Tunnels de vente (order bump / upsell / downsell)
|
|
243
|
+
listFunnelOffersTool,
|
|
244
|
+
getFunnelTool,
|
|
245
|
+
createFunnelTool,
|
|
246
|
+
updateFunnelTool,
|
|
247
|
+
deleteFunnelTool,
|
|
248
|
+
setFunnelItemTool,
|
|
249
|
+
deleteFunnelItemTool,
|
|
250
|
+
getFunnelStatsTool,
|
|
251
|
+
// Affiliation (par-produit + lab-level)
|
|
252
|
+
getProductAffiliationConfigTool,
|
|
253
|
+
updateProductAffiliationConfigTool,
|
|
254
|
+
listProductAffiliatesTool,
|
|
255
|
+
manageProductAffiliateTool,
|
|
256
|
+
getLabAffiliationConfigTool,
|
|
257
|
+
updateLabAffiliationConfigTool,
|
|
258
|
+
listLabAffiliatesTool,
|
|
259
|
+
manageLabAffiliateTool,
|
|
260
|
+
// Abonnements (prix / essai / demandes pixel affilies)
|
|
261
|
+
getSubscriptionSettingsTool,
|
|
262
|
+
addSubscriptionPriceTool,
|
|
263
|
+
setCurrentSubscriptionPriceTool,
|
|
264
|
+
deleteSubscriptionPriceTool,
|
|
265
|
+
updateTrialSettingsTool,
|
|
266
|
+
listPixelRequestsTool,
|
|
267
|
+
managePixelRequestTool,
|
|
268
|
+
// Newsletter (complements : editions CRUD, abonnes, config)
|
|
269
|
+
getNewsletterEditionTool,
|
|
270
|
+
updateNewsletterEditionTool,
|
|
271
|
+
deleteNewsletterEditionTool,
|
|
272
|
+
scheduleNewsletterEditionTool,
|
|
273
|
+
deleteNewsletterSubscriberTool,
|
|
274
|
+
getNewsletterSettingsTool,
|
|
275
|
+
updateNewsletterSettingsTool,
|
|
276
|
+
getNewsletterRevenueTool,
|
|
277
|
+
stopNewsletterTool,
|
|
278
|
+
reactivateNewsletterTool,
|
|
279
|
+
// Reorder cours
|
|
280
|
+
reorderClassTool,
|
|
281
|
+
// Calendrier IA (booking)
|
|
282
|
+
getCalendarTool,
|
|
283
|
+
getCalendarPipelineTool,
|
|
284
|
+
updateCalendarTool,
|
|
285
|
+
updateCalendarAvailabilityTool,
|
|
286
|
+
addCalendarQuestionTool,
|
|
287
|
+
updateCalendarQuestionTool,
|
|
288
|
+
deleteCalendarQuestionTool,
|
|
289
|
+
updateCalendarDisqualifRulesTool,
|
|
290
|
+
updateCalendarFollowupConfigTool,
|
|
291
|
+
// Smart Join (questions de qualification + reponses prospects)
|
|
292
|
+
getSmartJoinTool,
|
|
293
|
+
updateSmartJoinSettingsTool,
|
|
294
|
+
addSmartJoinQuestionTool,
|
|
295
|
+
updateSmartJoinQuestionTool,
|
|
296
|
+
reorderSmartJoinQuestionsTool,
|
|
297
|
+
deleteSmartJoinQuestionTool,
|
|
298
|
+
duplicateSmartJoinQuestionTool,
|
|
299
|
+
listSmartJoinResponsesTool,
|
|
300
|
+
clearSmartJoinResponsesTool,
|
|
173
301
|
];
|
|
174
302
|
const server = new Server({ name: 'connectxlab', version: '0.1.0' }, { capabilities: { tools: {} } });
|
|
175
303
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `add_calendar_question` — ajoute une question de qualification au calendrier.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const addCalendarQuestionTool = {
|
|
7
|
+
name: 'add_calendar_question',
|
|
8
|
+
description: "Ajoute une question de qualification au Calendrier IA. question_type = text (reponse libre) ou qcm (choix multiple — options requises, min 2). icon et required optionnels.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
label: { type: 'string', maxLength: 500 },
|
|
14
|
+
question_type: { type: 'string', enum: ['text', 'qcm'] },
|
|
15
|
+
icon: { type: 'string', maxLength: 40 },
|
|
16
|
+
required: { type: 'boolean' },
|
|
17
|
+
options: { type: 'array', items: { type: 'string', maxLength: 200 }, description: 'Requis si question_type=qcm (min 2)' },
|
|
18
|
+
},
|
|
19
|
+
required: ['lab', 'label', 'question_type'],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
zodSchema: z.object({
|
|
23
|
+
lab: z.string(),
|
|
24
|
+
label: z.string().min(1).max(500),
|
|
25
|
+
question_type: z.enum(['text', 'qcm']),
|
|
26
|
+
icon: z.string().max(40).nullable().optional(),
|
|
27
|
+
required: z.boolean().optional(),
|
|
28
|
+
options: z.array(z.string().max(200)).optional(),
|
|
29
|
+
}),
|
|
30
|
+
async handler(args) {
|
|
31
|
+
const p = this.zodSchema.parse(args);
|
|
32
|
+
const { lab, ...body } = p;
|
|
33
|
+
try {
|
|
34
|
+
const { data } = await http.post(`/mcp/labs/${encodeURIComponent(lab)}/calendar/questions`, body);
|
|
35
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `add_smart_join_question` — ajoute une question Smart Join (max 3).
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
const TYPES = ['email', 'short_text', 'long_text', 'phone', 'number', 'single_choice', 'multiple_choice'];
|
|
7
|
+
export const addSmartJoinQuestionTool = {
|
|
8
|
+
name: 'add_smart_join_question',
|
|
9
|
+
description: "Ajoute une question de qualification Smart Join (max 3 par Lab). type = email | short_text | long_text | phone | number | single_choice | multiple_choice. Pour single_choice / multiple_choice, fournis options (liste de libelles).",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
label: { type: 'string', maxLength: 500 },
|
|
15
|
+
type: { type: 'string', enum: [...TYPES] },
|
|
16
|
+
options: { type: 'array', items: { type: 'string' }, description: 'Requis pour single_choice / multiple_choice' },
|
|
17
|
+
},
|
|
18
|
+
required: ['lab', 'label', 'type'],
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
},
|
|
21
|
+
zodSchema: z.object({
|
|
22
|
+
lab: z.string(),
|
|
23
|
+
label: z.string().min(1).max(500),
|
|
24
|
+
type: z.enum(TYPES),
|
|
25
|
+
options: z.array(z.string()).optional(),
|
|
26
|
+
}),
|
|
27
|
+
async handler(args) {
|
|
28
|
+
const p = this.zodSchema.parse(args);
|
|
29
|
+
const { lab, ...body } = p;
|
|
30
|
+
try {
|
|
31
|
+
const { data } = await http.post(`/mcp/labs/${encodeURIComponent(lab)}/smart-join/questions`, body);
|
|
32
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `add_subscription_price` — ajoute un prix d'abonnement mensuel a un Lab
|
|
3
|
+
* (et le rend courant). Le Lab doit etre prive.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const addSubscriptionPriceTool = {
|
|
8
|
+
name: 'add_subscription_price',
|
|
9
|
+
description: "Ajoute un tier de prix d'abonnement mensuel a un Lab et le rend courant. amount en euros (0 = repasse gratuit). Le Lab doit etre prive ; un amount > 0 exige que l'owner ait configure Stripe Connect (sinon erreur). IMPORTANT : action ecriture, demander confirmation.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
amount: { type: 'number', minimum: 0, description: "Prix mensuel en euros (ex 29.90)" },
|
|
15
|
+
},
|
|
16
|
+
required: ['lab', 'amount'],
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
},
|
|
19
|
+
zodSchema: z.object({
|
|
20
|
+
lab: z.string(),
|
|
21
|
+
amount: z.number().min(0),
|
|
22
|
+
}),
|
|
23
|
+
async handler(args) {
|
|
24
|
+
const p = this.zodSchema.parse(args);
|
|
25
|
+
try {
|
|
26
|
+
const { data } = await http.post(`/mcp/labs/${encodeURIComponent(p.lab)}/subscriptions/prices`, { amount: p.amount });
|
|
27
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `clear_smart_join_responses` — efface toutes les réponses Smart Join.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const clearSmartJoinResponsesTool = {
|
|
7
|
+
name: 'clear_smart_join_responses',
|
|
8
|
+
description: "Efface TOUTES les reponses des prospects au questionnaire Smart Join du Lab. IMPORTANT : action destructive et irreversible, demander confirmation explicite.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: { lab: { type: 'string' } },
|
|
12
|
+
required: ['lab'],
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
},
|
|
15
|
+
zodSchema: z.object({ lab: z.string() }),
|
|
16
|
+
async handler(args) {
|
|
17
|
+
const p = this.zodSchema.parse(args);
|
|
18
|
+
try {
|
|
19
|
+
const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(p.lab)}/smart-join/responses`);
|
|
20
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `create_company` — cree une societe dans le Marketplace d'un Lab.
|
|
3
|
+
* Logo / banniere = fichiers, a uploader ensuite via le front.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const createCompanyTool = {
|
|
8
|
+
name: 'create_company',
|
|
9
|
+
description: "Cree une societe dans le Marketplace du Lab (annuaire de mentors/partenaires). Logo et banniere non geres par MCP — a uploader ensuite via le front. Necessite une categorie valide (list_company_categories).",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
name: { type: 'string', maxLength: 255 },
|
|
15
|
+
website: { type: 'string', description: 'URL du site (https://...)' },
|
|
16
|
+
description: { type: 'string' },
|
|
17
|
+
short_description: { type: 'string' },
|
|
18
|
+
cta_link: { type: 'string', description: 'URL du bouton CTA (https://...)' },
|
|
19
|
+
text_cta: { type: 'string', maxLength: 255, description: 'Libelle du bouton CTA (optionnel)' },
|
|
20
|
+
color: { type: 'string', description: 'Couleur de fond hex (optionnel, defaut #5A6BE3)' },
|
|
21
|
+
company_category_id: { type: 'number', description: "Id d'une categorie Marketplace (list_company_categories)" },
|
|
22
|
+
},
|
|
23
|
+
required: ['lab', 'name', 'website', 'description', 'short_description', 'cta_link', 'company_category_id'],
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
},
|
|
26
|
+
zodSchema: z.object({
|
|
27
|
+
lab: z.string(),
|
|
28
|
+
name: z.string().min(1).max(255),
|
|
29
|
+
website: z.string().url(),
|
|
30
|
+
description: z.string().min(1),
|
|
31
|
+
short_description: z.string().min(1),
|
|
32
|
+
cta_link: z.string().url(),
|
|
33
|
+
text_cta: z.string().max(255).optional(),
|
|
34
|
+
color: z.string().max(20).optional(),
|
|
35
|
+
company_category_id: z.number().int().positive(),
|
|
36
|
+
}),
|
|
37
|
+
async handler(args) {
|
|
38
|
+
const parsed = this.zodSchema.parse(args);
|
|
39
|
+
const { lab, ...body } = parsed;
|
|
40
|
+
try {
|
|
41
|
+
const { data } = await http.post(`/mcp/labs/${encodeURIComponent(lab)}/companies`, body);
|
|
42
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `create_company_category` — cree une categorie Marketplace dans un Lab.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const createCompanyCategoryTool = {
|
|
7
|
+
name: 'create_company_category',
|
|
8
|
+
description: "Cree une categorie dans le Marketplace du Lab (pour classer les societes).",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
name: { type: 'string', maxLength: 255 },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'name'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), name: z.string().min(1).max(255) }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const parsed = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.post(`/mcp/labs/${encodeURIComponent(parsed.lab)}/company-categories`, { name: parsed.name });
|
|
23
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `create_funnel` — cree (ou met a jour) le tunnel de vente d'un produit.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
const SELLABLE_TYPES = ['agent_ai', 'group_shop', 'course', 'newsletter', 'podcast_show', 'lab_channel'];
|
|
7
|
+
export const createFunnelTool = {
|
|
8
|
+
name: 'create_funnel',
|
|
9
|
+
description: "Cree (ou recupere) le tunnel de vente d'un produit vendable. 1 seul funnel par produit. Passe is_active pour l'activer. Ajoute ensuite des order bump / upsell / downsell via set_funnel_item.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
sellable_type: { type: 'string', enum: [...SELLABLE_TYPES], description: 'Type du produit principal' },
|
|
15
|
+
sellable_id: { type: 'number', description: 'Id du produit principal' },
|
|
16
|
+
name: { type: 'string', maxLength: 120, description: 'Nom du tunnel (interne)' },
|
|
17
|
+
is_active: { type: 'boolean', description: 'Active le tunnel' },
|
|
18
|
+
},
|
|
19
|
+
required: ['lab', 'sellable_type', 'sellable_id'],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
zodSchema: z.object({
|
|
23
|
+
lab: z.string(),
|
|
24
|
+
sellable_type: z.enum(SELLABLE_TYPES),
|
|
25
|
+
sellable_id: z.number().int().positive(),
|
|
26
|
+
name: z.string().max(120).nullable().optional(),
|
|
27
|
+
is_active: z.boolean().optional(),
|
|
28
|
+
}),
|
|
29
|
+
async handler(args) {
|
|
30
|
+
const p = this.zodSchema.parse(args);
|
|
31
|
+
const { lab, ...body } = p;
|
|
32
|
+
try {
|
|
33
|
+
const { data } = await http.post(`/mcp/labs/${encodeURIComponent(lab)}/funnels`, body);
|
|
34
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
package/dist/tools/createPost.js
CHANGED
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
import { http, formatApiError } from '../http.js';
|
|
7
7
|
export const createPostTool = {
|
|
8
8
|
name: 'create_post',
|
|
9
|
-
description: "Cree un nouveau post dans un Lab. Le body peut etre du texte simple (sera wrappe en <p>) ou du HTML. Necessite un category_id valide — utilise list_categories pour l'obtenir.",
|
|
9
|
+
description: "Cree un nouveau post dans un Lab. Le body peut etre du texte simple (sera wrappe en <p>) ou du HTML. Necessite un category_id valide — utilise list_categories pour l'obtenir. Optionnel : shop_id pour mettre en avant un produit de la Boutique dans le post (CTA d'achat) — recupere l'id via list_shops.",
|
|
10
10
|
inputSchema: {
|
|
11
11
|
type: 'object',
|
|
12
12
|
properties: {
|
|
@@ -14,6 +14,7 @@ export const createPostTool = {
|
|
|
14
14
|
title: { type: 'string', description: 'Titre du post (max 255 char)' },
|
|
15
15
|
body: { type: 'string', description: 'Contenu du post — texte ou HTML' },
|
|
16
16
|
category_id: { type: 'number', description: "Id d'une categorie du Lab (list_categories)" },
|
|
17
|
+
shop_id: { type: 'number', description: "Optionnel — id d'un produit Boutique a mettre en avant dans le post (list_shops). Doit appartenir a ce Lab." },
|
|
17
18
|
},
|
|
18
19
|
required: ['lab', 'title', 'body', 'category_id'],
|
|
19
20
|
additionalProperties: false,
|
|
@@ -23,6 +24,7 @@ export const createPostTool = {
|
|
|
23
24
|
title: z.string().min(1).max(255),
|
|
24
25
|
body: z.string().min(1),
|
|
25
26
|
category_id: z.number().int().positive(),
|
|
27
|
+
shop_id: z.number().int().positive().optional(),
|
|
26
28
|
}),
|
|
27
29
|
async handler(args) {
|
|
28
30
|
const parsed = this.zodSchema.parse(args);
|
|
@@ -31,6 +33,7 @@ export const createPostTool = {
|
|
|
31
33
|
title: parsed.title,
|
|
32
34
|
body: parsed.body,
|
|
33
35
|
category_id: parsed.category_id,
|
|
36
|
+
...(parsed.shop_id !== undefined ? { shop_id: parsed.shop_id } : {}),
|
|
34
37
|
});
|
|
35
38
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
36
39
|
}
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { http, formatApiError } from '../http.js';
|
|
3
3
|
export const createShopProductTool = {
|
|
4
4
|
name: 'create_shop_product',
|
|
5
|
-
description: "Cree un produit dans la boutique du Lab. Files (bannieres, PDF) non geres par MCP — a uploader ensuite via le front. Prix en centimes (price_cents).",
|
|
5
|
+
description: "Cree un produit dans la boutique du Lab. Files (bannieres, PDF) non geres par MCP — a uploader ensuite via le front. Prix en centimes (price_cents) — c'est le PRODUIT qui porte le prix de vente. offer_type=formation : l'achat debloque un cours du Lab — fournis alors course_id (via list_classes) ET price_cents (>= 50, obligatoire, le cours lui-meme n'a pas de prix de vente) ; le paiement passe forcement en Stripe.",
|
|
6
6
|
inputSchema: {
|
|
7
7
|
type: 'object',
|
|
8
8
|
properties: {
|
|
@@ -11,7 +11,8 @@ export const createShopProductTool = {
|
|
|
11
11
|
short_description: { type: 'string' },
|
|
12
12
|
description: { type: 'string' },
|
|
13
13
|
price_cents: { type: 'number', minimum: 0, description: 'Prix en centimes (ex 2990 = 29.90 EUR)' },
|
|
14
|
-
offer_type: { type: 'string', enum: ['digital', '
|
|
14
|
+
offer_type: { type: 'string', enum: ['digital', 'calendar', 'formation'], description: "digital = telechargeable ; calendar = Calendrier IA ; formation = debloque un cours a l'achat (course_id requis)." },
|
|
15
|
+
course_id: { type: 'number', description: "Requis si offer_type=formation — id d'un cours du Lab (list_classes). Doit appartenir a ce Lab." },
|
|
15
16
|
payment_mode: { type: 'string', enum: ['external', 'stripe'] },
|
|
16
17
|
payment_link_text: { type: 'string', maxLength: 255 },
|
|
17
18
|
support_email: { type: 'string', format: 'email' },
|
|
@@ -26,7 +27,8 @@ export const createShopProductTool = {
|
|
|
26
27
|
short_description: z.string(),
|
|
27
28
|
description: z.string(),
|
|
28
29
|
price_cents: z.number().int().min(0).nullable().optional(),
|
|
29
|
-
offer_type: z.enum(['digital', '
|
|
30
|
+
offer_type: z.enum(['digital', 'calendar', 'formation']).optional(),
|
|
31
|
+
course_id: z.number().int().positive().optional(),
|
|
30
32
|
payment_mode: z.enum(['external', 'stripe']).optional(),
|
|
31
33
|
payment_link_text: z.string().max(255).nullable().optional(),
|
|
32
34
|
support_email: z.string().email().nullable().optional(),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `delete_calendar_question` — supprime une question du calendrier.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteCalendarQuestionTool = {
|
|
7
|
+
name: 'delete_calendar_question',
|
|
8
|
+
description: "Supprime une question de qualification du Calendrier IA. question_id vient de get_calendar. IMPORTANT : demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
question_id: { type: 'number' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'question_id'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), question_id: z.number().int().positive() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const p = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(p.lab)}/calendar/questions/${p.question_id}`);
|
|
23
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `delete_company` — supprime une societe du Marketplace (par uuid).
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteCompanyTool = {
|
|
7
|
+
name: 'delete_company',
|
|
8
|
+
description: "Supprime une societe du Marketplace (et ses contacts). Identifiee par son uuid (list_companies). IMPORTANT : action destructive, demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
uuid: { type: 'string', description: 'uuid de la societe (list_companies)' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'uuid'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), uuid: z.string() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const parsed = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(parsed.lab)}/companies/${encodeURIComponent(parsed.uuid)}`);
|
|
23
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `delete_company_category` — supprime une categorie Marketplace.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteCompanyCategoryTool = {
|
|
7
|
+
name: 'delete_company_category',
|
|
8
|
+
description: "Supprime une categorie du Marketplace (par id, cf list_company_categories). Les societes de cette categorie perdent la reference. IMPORTANT : demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
category_id: { type: 'number', description: 'Id de la categorie (list_company_categories)' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'category_id'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), category_id: z.number().int().positive() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const parsed = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(parsed.lab)}/company-categories/${parsed.category_id}`);
|
|
23
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `delete_funnel` — supprime le tunnel de vente d'un produit (et ses items).
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteFunnelTool = {
|
|
7
|
+
name: 'delete_funnel',
|
|
8
|
+
description: "Supprime un tunnel de vente et tous ses items (order bump / upsell / downsell). funnel_id vient de get_funnel. IMPORTANT : action destructive, demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
funnel_id: { type: 'number' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'funnel_id'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), funnel_id: z.number().int().positive() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const p = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(p.lab)}/funnels/${p.funnel_id}`);
|
|
23
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `delete_funnel_item` — supprime un item d'un tunnel (bump/upsell/downsell).
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteFunnelItemTool = {
|
|
7
|
+
name: 'delete_funnel_item',
|
|
8
|
+
description: "Supprime un item de tunnel (order bump / upsell / downsell). item_id vient de get_funnel. IMPORTANT : demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
funnel_id: { type: 'number' },
|
|
14
|
+
item_id: { type: 'number' },
|
|
15
|
+
},
|
|
16
|
+
required: ['lab', 'funnel_id', 'item_id'],
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
},
|
|
19
|
+
zodSchema: z.object({
|
|
20
|
+
lab: z.string(),
|
|
21
|
+
funnel_id: z.number().int().positive(),
|
|
22
|
+
item_id: z.number().int().positive(),
|
|
23
|
+
}),
|
|
24
|
+
async handler(args) {
|
|
25
|
+
const p = this.zodSchema.parse(args);
|
|
26
|
+
try {
|
|
27
|
+
const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(p.lab)}/funnels/${p.funnel_id}/items/${p.item_id}`);
|
|
28
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `delete_newsletter_edition` — supprime une édition de newsletter.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteNewsletterEditionTool = {
|
|
7
|
+
name: 'delete_newsletter_edition',
|
|
8
|
+
description: "Supprime une edition de newsletter. edition_id vient de list_newsletter_editions. IMPORTANT : action destructive, demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
edition_id: { type: 'number' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'edition_id'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), edition_id: z.number().int().positive() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const p = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(p.lab)}/newsletter/editions/${p.edition_id}`);
|
|
23
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|