@connect-xlab/mcp-server 0.1.1 → 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.
Files changed (74) hide show
  1. package/dist/index.js +146 -0
  2. package/dist/tools/addCalendarQuestion.js +41 -0
  3. package/dist/tools/addSmartJoinQuestion.js +38 -0
  4. package/dist/tools/addSubscriptionPrice.js +33 -0
  5. package/dist/tools/clearSmartJoinResponses.js +26 -0
  6. package/dist/tools/createCompany.js +48 -0
  7. package/dist/tools/createCompanyCategory.js +29 -0
  8. package/dist/tools/createFunnel.js +40 -0
  9. package/dist/tools/createLinkInBioBlock.js +55 -0
  10. package/dist/tools/createPost.js +4 -1
  11. package/dist/tools/createShopProduct.js +5 -3
  12. package/dist/tools/deleteCalendarQuestion.js +29 -0
  13. package/dist/tools/deleteCompany.js +29 -0
  14. package/dist/tools/deleteCompanyCategory.js +29 -0
  15. package/dist/tools/deleteFunnel.js +29 -0
  16. package/dist/tools/deleteFunnelItem.js +34 -0
  17. package/dist/tools/deleteLinkInBioBlock.js +31 -0
  18. package/dist/tools/deleteNewsletterEdition.js +29 -0
  19. package/dist/tools/deleteNewsletterSubscriber.js +29 -0
  20. package/dist/tools/deleteSmartJoinQuestion.js +29 -0
  21. package/dist/tools/deleteSubscriptionPrice.js +29 -0
  22. package/dist/tools/duplicateSmartJoinQuestion.js +29 -0
  23. package/dist/tools/getCalendar.js +26 -0
  24. package/dist/tools/getCalendarPipeline.js +26 -0
  25. package/dist/tools/getFunnel.js +35 -0
  26. package/dist/tools/getFunnelStats.js +35 -0
  27. package/dist/tools/getLabAffiliationConfig.js +29 -0
  28. package/dist/tools/getLinkInBio.js +29 -0
  29. package/dist/tools/getNewsletterEdition.js +29 -0
  30. package/dist/tools/getNewsletterRevenue.js +28 -0
  31. package/dist/tools/getNewsletterSettings.js +28 -0
  32. package/dist/tools/getProductAffiliationConfig.js +36 -0
  33. package/dist/tools/getSmartJoin.js +26 -0
  34. package/dist/tools/getStripeConnectStatus.js +32 -0
  35. package/dist/tools/getSubscriptionSettings.js +29 -0
  36. package/dist/tools/listCompanies.js +34 -0
  37. package/dist/tools/listCompanyCategories.js +28 -0
  38. package/dist/tools/listFunnelOffers.js +29 -0
  39. package/dist/tools/listLabAffiliates.js +40 -0
  40. package/dist/tools/listPixelRequests.js +45 -0
  41. package/dist/tools/listProductAffiliates.js +49 -0
  42. package/dist/tools/listSmartJoinResponses.js +40 -0
  43. package/dist/tools/manageLabAffiliate.js +41 -0
  44. package/dist/tools/managePixelRequest.js +35 -0
  45. package/dist/tools/manageProductAffiliate.js +45 -0
  46. package/dist/tools/reactivateNewsletter.js +28 -0
  47. package/dist/tools/reorderClass.js +34 -0
  48. package/dist/tools/reorderLinkInBioBlocks.js +37 -0
  49. package/dist/tools/reorderSmartJoinQuestions.js +32 -0
  50. package/dist/tools/scheduleNewsletterEdition.js +34 -0
  51. package/dist/tools/setCurrentSubscriptionPrice.js +34 -0
  52. package/dist/tools/setFunnelItem.js +94 -0
  53. package/dist/tools/stopNewsletter.js +28 -0
  54. package/dist/tools/toggleLinkInBioPublish.js +29 -0
  55. package/dist/tools/updateCalendar.js +70 -0
  56. package/dist/tools/updateCalendarAvailability.js +51 -0
  57. package/dist/tools/updateCalendarDisqualifRules.js +48 -0
  58. package/dist/tools/updateCalendarFollowupConfig.js +51 -0
  59. package/dist/tools/updateCalendarQuestion.js +43 -0
  60. package/dist/tools/updateCompany.js +49 -0
  61. package/dist/tools/updateCompanyCategory.js +34 -0
  62. package/dist/tools/updateFunnel.js +37 -0
  63. package/dist/tools/updateLabAffiliationConfig.js +44 -0
  64. package/dist/tools/updateLinkInBio.js +61 -0
  65. package/dist/tools/updateLinkInBioBlock.js +44 -0
  66. package/dist/tools/updateNewsletterEdition.js +43 -0
  67. package/dist/tools/updateNewsletterSettings.js +63 -0
  68. package/dist/tools/updatePost.js +3 -1
  69. package/dist/tools/updateProductAffiliationConfig.js +43 -0
  70. package/dist/tools/updateShopProduct.js +5 -1
  71. package/dist/tools/updateSmartJoinQuestion.js +40 -0
  72. package/dist/tools/updateSmartJoinSettings.js +29 -0
  73. package/dist/tools/updateTrialSettings.js +34 -0
  74. package/package.json +19 -6
@@ -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,31 @@
1
+ /**
2
+ * Tool `delete_link_in_bio_block` — supprime definitivement un bloc de la
3
+ * page. Pour masquer sans supprimer, utiliser plutot update_link_in_bio_block
4
+ * avec is_active=false.
5
+ */
6
+ import { z } from 'zod';
7
+ import { http, formatApiError } from '../http.js';
8
+ export const deleteLinkInBioBlockTool = {
9
+ name: 'delete_link_in_bio_block',
10
+ description: "Supprime definitivement un bloc de la page Link in Bio. Pour un masquage temporaire, prefere update_link_in_bio_block avec is_active=false.",
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ lab: { type: 'string' },
15
+ block_id: { type: 'number', minimum: 1 },
16
+ },
17
+ required: ['lab', 'block_id'],
18
+ additionalProperties: false,
19
+ },
20
+ zodSchema: z.object({ lab: z.string(), block_id: z.number().int().positive() }),
21
+ async handler(args) {
22
+ const parsed = this.zodSchema.parse(args);
23
+ try {
24
+ const { data } = await http.delete(`/mcp/labs/${encodeURIComponent(parsed.lab)}/link-in-bio/blocks/${parsed.block_id}`);
25
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
26
+ }
27
+ catch (err) {
28
+ return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
29
+ }
30
+ },
31
+ };
@@ -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
+ };
@@ -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_link_in_bio` — recupere la page Link in Bio du Lab (settings +
3
+ * blocs). Renvoie null dans `page` si aucune page n'a encore ete creee.
4
+ */
5
+ import { z } from 'zod';
6
+ import { http, formatApiError } from '../http.js';
7
+ export const getLinkInBioTool = {
8
+ name: 'get_link_in_bio',
9
+ description: "Recupere la page Link in Bio d'un Lab : slug, published, display_name, bio, theme, layout (avatar/banner/portrait), desktop_layout (split/centered), avatar/banner/portrait URLs, socials, et la liste ordonnee des blocs (kind = external/product/lab).",
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)}/link-in-bio`);
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,32 @@
1
+ /**
2
+ * Tool `get_stripe_connect_status` — introspecte le compte Stripe Connect de
3
+ * l'owner du Lab. Utile pour verifier si l'owner peut vendre (charges_enabled)
4
+ * ou s'il doit finir sa configuration.
5
+ */
6
+ import { z } from 'zod';
7
+ import { http, formatApiError } from '../http.js';
8
+ export const getStripeConnectStatusTool = {
9
+ name: 'get_stripe_connect_status',
10
+ description: "Etat du compte Stripe Connect de l'owner du Lab (encaissement des ventes). Renvoie can_sell (bool), charges_enabled, has_account, requirements_due[]. Passer refresh=true force un rafraichissement depuis Stripe (utile juste apres onboarding). Le super admin plateforme retourne is_platform_owner=true (encaissement direct, pas de Connect).",
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ lab: { type: 'string', description: 'Id ou url du Lab' },
15
+ refresh: { type: 'boolean', description: 'Force un round-trip Stripe pour synchroniser (defaut false)' },
16
+ },
17
+ required: ['lab'],
18
+ additionalProperties: false,
19
+ },
20
+ zodSchema: z.object({ lab: z.string(), refresh: z.boolean().optional() }),
21
+ async handler(args) {
22
+ const parsed = this.zodSchema.parse(args);
23
+ try {
24
+ const qs = parsed.refresh ? '?refresh=1' : '';
25
+ const { data } = await http.get(`/mcp/labs/${encodeURIComponent(parsed.lab)}/payments/stripe-status${qs}`);
26
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
27
+ }
28
+ catch (err) {
29
+ return { isError: true, content: [{ type: 'text', text: formatApiError(err) }] };
30
+ }
31
+ },
32
+ };
@@ -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
+ };