@connect-xlab/mcp-server 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +130 -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 +50 -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/toggleCompanyVisibility.js +35 -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 +51 -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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `delete_newsletter_subscriber` — retire un abonné de la newsletter.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteNewsletterSubscriberTool = {
|
|
7
|
+
name: 'delete_newsletter_subscriber',
|
|
8
|
+
description: "Retire un abonne de la newsletter du Lab. subscriber_id vient de list_newsletter_subscribers. IMPORTANT : action destructive, demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
subscriber_id: { type: 'number' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'subscriber_id'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), subscriber_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/subscribers/${p.subscriber_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_smart_join_question` — supprime une question Smart Join.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteSmartJoinQuestionTool = {
|
|
7
|
+
name: 'delete_smart_join_question',
|
|
8
|
+
description: "Supprime une question de qualification Smart Join. question_id vient de get_smart_join. 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)}/smart-join/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_subscription_price` — supprime un tier de prix non courant.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const deleteSubscriptionPriceTool = {
|
|
7
|
+
name: 'delete_subscription_price',
|
|
8
|
+
description: "Supprime un tier de prix d'abonnement NON courant (price_id, cf get_subscription_settings). Le prix courant ne peut pas etre supprime — definis un autre prix courant d'abord. IMPORTANT : demander confirmation.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
price_id: { type: 'number' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab', 'price_id'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string(), price_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)}/subscriptions/prices/${p.price_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 `duplicate_smart_join_question` — duplique une question Smart Join.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const duplicateSmartJoinQuestionTool = {
|
|
7
|
+
name: 'duplicate_smart_join_question',
|
|
8
|
+
description: "Duplique une question de qualification Smart Join (sous reserve de ne pas depasser le maximum de 3). question_id vient de get_smart_join.",
|
|
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.post(`/mcp/labs/${encodeURIComponent(p.lab)}/smart-join/questions/${p.question_id}/duplicate`, {});
|
|
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,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_calendar` — config complète du plug-in Calendrier IA d'un Lab.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const getCalendarTool = {
|
|
7
|
+
name: 'get_calendar',
|
|
8
|
+
description: "Lit la config complete du Calendrier IA (booking) d'un Lab : details du RDV, type de lieu, prix, duree, plage de dates, scoring IA, disponibilites, questions de qualification, regles de disqualification, relances.",
|
|
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.get(`/mcp/labs/${encodeURIComponent(p.lab)}/calendar`);
|
|
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,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_calendar_pipeline` — pipeline des leads (prospects) du Calendrier IA.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const getCalendarPipelineTool = {
|
|
7
|
+
name: 'get_calendar_pipeline',
|
|
8
|
+
description: "Liste le pipeline des leads (prospects) du Calendrier IA : personnes ayant demarre / complete le formulaire ou reserve un creneau, avec leur scoring (hot/warm/cold) et statut.",
|
|
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.get(`/mcp/labs/${encodeURIComponent(p.lab)}/calendar/pipeline`);
|
|
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,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_funnel` — recupere le tunnel de vente attache a 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 getFunnelTool = {
|
|
8
|
+
name: 'get_funnel',
|
|
9
|
+
description: "Recupere le tunnel de vente (order bump / upsell / downsell) attache a un produit vendable, avec ses items. Renvoie null si aucun funnel. sellable_type = type du produit principal, sellable_id = son id.",
|
|
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
|
+
},
|
|
17
|
+
required: ['lab', 'sellable_type', 'sellable_id'],
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
},
|
|
20
|
+
zodSchema: z.object({
|
|
21
|
+
lab: z.string(),
|
|
22
|
+
sellable_type: z.enum(SELLABLE_TYPES),
|
|
23
|
+
sellable_id: z.number().int().positive(),
|
|
24
|
+
}),
|
|
25
|
+
async handler(args) {
|
|
26
|
+
const p = this.zodSchema.parse(args);
|
|
27
|
+
try {
|
|
28
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/funnels/${p.sellable_type}/${p.sellable_id}`);
|
|
29
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_funnel_stats` — stats de conversion d'un tunnel par kind.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const getFunnelStatsTool = {
|
|
7
|
+
name: 'get_funnel_stats',
|
|
8
|
+
description: "Stats d'un tunnel de vente par kind (order_bump / upsell / downsell) sur les N derniers jours : vues (approx), acceptations, revenu genere. funnel_id vient de get_funnel.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
funnel_id: { type: 'number' },
|
|
14
|
+
days: { type: 'number', minimum: 1, maximum: 365, description: 'Fenetre en jours (defaut 30)' },
|
|
15
|
+
},
|
|
16
|
+
required: ['lab', 'funnel_id'],
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
},
|
|
19
|
+
zodSchema: z.object({
|
|
20
|
+
lab: z.string(),
|
|
21
|
+
funnel_id: z.number().int().positive(),
|
|
22
|
+
days: z.number().int().min(1).max(365).optional(),
|
|
23
|
+
}),
|
|
24
|
+
async handler(args) {
|
|
25
|
+
const p = this.zodSchema.parse(args);
|
|
26
|
+
const query = p.days !== undefined ? `?days=${p.days}` : '';
|
|
27
|
+
try {
|
|
28
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/funnels/${p.funnel_id}/stats${query}`);
|
|
29
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_lab_affiliation_config` — lit la config du programme d'affiliation
|
|
3
|
+
* au niveau du Lab entier.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const getLabAffiliationConfigTool = {
|
|
8
|
+
name: 'get_lab_affiliation_config',
|
|
9
|
+
description: "Lit la config du programme d'affiliation au niveau du Lab entier : statut (actif ?), pourcentage, scopes (paiements one-shot / abonnement lab / abonnement interne), visibilite du badge, part plateforme.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const p = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/affiliation/lab/config`);
|
|
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 `get_newsletter_edition` — contenu complet d'une édition (dont body_html).
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const getNewsletterEditionTool = {
|
|
7
|
+
name: 'get_newsletter_edition',
|
|
8
|
+
description: "Recupere le contenu complet d'une edition de newsletter (titre, objet, body_html, access, audience, statut, stats). edition_id vient de list_newsletter_editions.",
|
|
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.get(`/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
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_newsletter_revenue` — revenus de la newsletter premium.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const getNewsletterRevenueTool = {
|
|
7
|
+
name: 'get_newsletter_revenue',
|
|
8
|
+
description: "Revenus generes par les abonnements premium de la newsletter du Lab.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
},
|
|
14
|
+
required: ['lab'],
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
},
|
|
17
|
+
zodSchema: z.object({ lab: z.string() }),
|
|
18
|
+
async handler(args) {
|
|
19
|
+
const p = this.zodSchema.parse(args);
|
|
20
|
+
try {
|
|
21
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/newsletter/revenue`);
|
|
22
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_newsletter_settings` — config complète de la newsletter du Lab.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const getNewsletterSettingsTool = {
|
|
7
|
+
name: 'get_newsletter_settings',
|
|
8
|
+
description: "Lit la config complete de la newsletter du Lab (titre, slug, tagline, auteur, apparence, email de bienvenue, mode d'envoi, page de vente...).",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
},
|
|
14
|
+
required: ['lab'],
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
},
|
|
17
|
+
zodSchema: z.object({ lab: z.string() }),
|
|
18
|
+
async handler(args) {
|
|
19
|
+
const p = this.zodSchema.parse(args);
|
|
20
|
+
try {
|
|
21
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/newsletter/settings`);
|
|
22
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_product_affiliation_config` — lit la config d'affiliation d'un
|
|
3
|
+
* produit (boutique ou agent IA).
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
const PRODUCT_TYPES = ['shop_product', 'agent_ai'];
|
|
8
|
+
export const getProductAffiliationConfigTool = {
|
|
9
|
+
name: 'get_product_affiliation_config',
|
|
10
|
+
description: "Lit la config d'affiliation d'un produit (boutique ou agent IA custom) : activee ?, pourcentage, visibilite (qui peut s'affilier), part plateforme. product_type = shop_product | agent_ai, product_id = id du produit.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
lab: { type: 'string' },
|
|
15
|
+
product_type: { type: 'string', enum: [...PRODUCT_TYPES] },
|
|
16
|
+
product_id: { type: 'number' },
|
|
17
|
+
},
|
|
18
|
+
required: ['lab', 'product_type', 'product_id'],
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
},
|
|
21
|
+
zodSchema: z.object({
|
|
22
|
+
lab: z.string(),
|
|
23
|
+
product_type: z.enum(PRODUCT_TYPES),
|
|
24
|
+
product_id: z.number().int().positive(),
|
|
25
|
+
}),
|
|
26
|
+
async handler(args) {
|
|
27
|
+
const p = this.zodSchema.parse(args);
|
|
28
|
+
try {
|
|
29
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/affiliation/products/${p.product_type}/${p.product_id}/config`);
|
|
30
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_smart_join` — config Smart Join (questions de qualification) d'un Lab.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const getSmartJoinTool = {
|
|
7
|
+
name: 'get_smart_join',
|
|
8
|
+
description: "Lit la config du plug-in Smart Join d'un Lab : actif ou non + les questions de qualification (max 3) posees aux prospects avant l'adhesion.",
|
|
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.get(`/mcp/labs/${encodeURIComponent(p.lab)}/smart-join`);
|
|
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,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `get_subscription_settings` — prix d'abonnement, gratuit/payant et essai
|
|
3
|
+
* d'un Lab (onglet Abonnements, dispo quand le Lab est prive + payant).
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const getSubscriptionSettingsTool = {
|
|
8
|
+
name: 'get_subscription_settings',
|
|
9
|
+
description: "Lit les reglages d'abonnement d'un Lab : gratuit ou payant, prive/public, prix courant, la liste des tiers de prix (avec nb de membres + lequel est courant) et la periode d'essai (activee ? nb de jours).",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const p = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/subscriptions`);
|
|
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 `list_companies` — liste les societes du Marketplace d'un Lab (annuaire
|
|
3
|
+
* de mentors / partenaires). Distinct de la Boutique (list_shops).
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const listCompaniesTool = {
|
|
8
|
+
name: 'list_companies',
|
|
9
|
+
description: "Liste les societes du Marketplace d'un Lab (annuaire de mentors/partenaires) — distinct de la Boutique. Renvoie uuid, nom, description courte, site, CTA, categorie, position. Filtre optionnel par category_id (list_company_categories).",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string', description: 'Id ou url du Lab' },
|
|
14
|
+
category_id: { type: 'number', description: 'Optionnel — filtre par categorie Marketplace' },
|
|
15
|
+
},
|
|
16
|
+
required: ['lab'],
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
},
|
|
19
|
+
zodSchema: z.object({
|
|
20
|
+
lab: z.string(),
|
|
21
|
+
category_id: z.number().int().positive().optional(),
|
|
22
|
+
}),
|
|
23
|
+
async handler(args) {
|
|
24
|
+
const parsed = this.zodSchema.parse(args);
|
|
25
|
+
const query = parsed.category_id !== undefined ? `?category_id=${parsed.category_id}` : '';
|
|
26
|
+
try {
|
|
27
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(parsed.lab)}/companies${query}`);
|
|
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,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `list_company_categories` — liste les categories du Marketplace d'un Lab.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const listCompanyCategoriesTool = {
|
|
7
|
+
name: 'list_company_categories',
|
|
8
|
+
description: "Liste les categories du Marketplace d'un Lab (utilisees pour classer les societes). Renvoie id + nom. Recupere l'id ici avant create_company / list_companies.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string', description: 'Id ou url du Lab' },
|
|
13
|
+
},
|
|
14
|
+
required: ['lab'],
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
},
|
|
17
|
+
zodSchema: z.object({ lab: z.string() }),
|
|
18
|
+
async handler(args) {
|
|
19
|
+
const parsed = this.zodSchema.parse(args);
|
|
20
|
+
try {
|
|
21
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(parsed.lab)}/company-categories`);
|
|
22
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `list_funnel_offers` — liste les produits d'un Lab utilisables comme
|
|
3
|
+
* order bump / upsell / downsell dans un tunnel de vente.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const listFunnelOffersTool = {
|
|
8
|
+
name: 'list_funnel_offers',
|
|
9
|
+
description: "Liste les produits vendables du Lab utilisables comme order bump / upsell / downsell (agents IA payants, produits boutique Stripe, canaux payants, newsletters et podcasts premium). Renvoie type, id, titre, prix, kind (one_shot / recurring_monthly). Utilise-le pour recuperer offer_type + offer_id avant set_funnel_item.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string', description: 'Id ou url du Lab' },
|
|
14
|
+
},
|
|
15
|
+
required: ['lab'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
zodSchema: z.object({ lab: z.string() }),
|
|
19
|
+
async handler(args) {
|
|
20
|
+
const parsed = this.zodSchema.parse(args);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(parsed.lab)}/funnels/offers`);
|
|
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 `list_lab_affiliates` — liste les affiliés du Lab (niveau Lab) + KPIs.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { http, formatApiError } from '../http.js';
|
|
6
|
+
export const listLabAffiliatesTool = {
|
|
7
|
+
name: 'list_lab_affiliates',
|
|
8
|
+
description: "Liste les membres qui promeuvent le Lab (affiliation lab-level) avec KPIs : nb de filleuls, commission payee / en attente, pourcentage effectif, custom_percent, revoque ?. Pagine.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
lab: { type: 'string' },
|
|
13
|
+
page: { type: 'number', minimum: 1 },
|
|
14
|
+
per_page: { type: 'number', minimum: 1, maximum: 100 },
|
|
15
|
+
},
|
|
16
|
+
required: ['lab'],
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
},
|
|
19
|
+
zodSchema: z.object({
|
|
20
|
+
lab: z.string(),
|
|
21
|
+
page: z.number().int().min(1).optional(),
|
|
22
|
+
per_page: z.number().int().min(1).max(100).optional(),
|
|
23
|
+
}),
|
|
24
|
+
async handler(args) {
|
|
25
|
+
const p = this.zodSchema.parse(args);
|
|
26
|
+
const qs = new URLSearchParams();
|
|
27
|
+
if (p.page !== undefined)
|
|
28
|
+
qs.set('page', String(p.page));
|
|
29
|
+
if (p.per_page !== undefined)
|
|
30
|
+
qs.set('per_page', String(p.per_page));
|
|
31
|
+
const query = qs.toString() ? `?${qs.toString()}` : '';
|
|
32
|
+
try {
|
|
33
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/affiliation/lab/affiliates${query}`);
|
|
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
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool `list_pixel_requests` — demandes d'installation de Meta Pixel par les
|
|
3
|
+
* affiliés du Lab (sur la page À propos).
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { http, formatApiError } from '../http.js';
|
|
7
|
+
export const listPixelRequestsTool = {
|
|
8
|
+
name: 'list_pixel_requests',
|
|
9
|
+
description: "Liste les demandes d'installation de Meta Pixel envoyees par les affilies du Lab (pour retargeter les visiteurs qu'ils envoient). Filtre optionnel status = pending | approved | rejected | revoked. Pagine.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
lab: { type: 'string' },
|
|
14
|
+
status: { type: 'string', enum: ['pending', 'approved', 'rejected', 'revoked'] },
|
|
15
|
+
page: { type: 'number', minimum: 1 },
|
|
16
|
+
per_page: { type: 'number', minimum: 1, maximum: 100 },
|
|
17
|
+
},
|
|
18
|
+
required: ['lab'],
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
},
|
|
21
|
+
zodSchema: z.object({
|
|
22
|
+
lab: z.string(),
|
|
23
|
+
status: z.enum(['pending', 'approved', 'rejected', 'revoked']).optional(),
|
|
24
|
+
page: z.number().int().min(1).optional(),
|
|
25
|
+
per_page: z.number().int().min(1).max(100).optional(),
|
|
26
|
+
}),
|
|
27
|
+
async handler(args) {
|
|
28
|
+
const p = this.zodSchema.parse(args);
|
|
29
|
+
const qs = new URLSearchParams();
|
|
30
|
+
if (p.status !== undefined)
|
|
31
|
+
qs.set('status', p.status);
|
|
32
|
+
if (p.page !== undefined)
|
|
33
|
+
qs.set('page', String(p.page));
|
|
34
|
+
if (p.per_page !== undefined)
|
|
35
|
+
qs.set('per_page', String(p.per_page));
|
|
36
|
+
const query = qs.toString() ? `?${qs.toString()}` : '';
|
|
37
|
+
try {
|
|
38
|
+
const { data } = await http.get(`/mcp/labs/${encodeURIComponent(p.lab)}/subscriptions/pixel-requests${query}`);
|
|
39
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|