@connect-xlab/mcp-server 0.2.0 → 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 CHANGED
@@ -99,6 +99,7 @@ import { listCompanyCategoriesTool } from './tools/listCompanyCategories.js';
99
99
  import { createCompanyCategoryTool } from './tools/createCompanyCategory.js';
100
100
  import { updateCompanyCategoryTool } from './tools/updateCompanyCategory.js';
101
101
  import { deleteCompanyCategoryTool } from './tools/deleteCompanyCategory.js';
102
+ import { toggleCompanyVisibilityTool } from './tools/toggleCompanyVisibility.js';
102
103
  import { listFunnelOffersTool } from './tools/listFunnelOffers.js';
103
104
  import { getFunnelTool } from './tools/getFunnel.js';
104
105
  import { createFunnelTool } from './tools/createFunnel.js';
@@ -239,6 +240,7 @@ const tools = [
239
240
  createCompanyCategoryTool,
240
241
  updateCompanyCategoryTool,
241
242
  deleteCompanyCategoryTool,
243
+ toggleCompanyVisibilityTool,
242
244
  // Tunnels de vente (order bump / upsell / downsell)
243
245
  listFunnelOffersTool,
244
246
  getFunnelTool,
@@ -19,6 +19,7 @@ export const createCompanyTool = {
19
19
  text_cta: { type: 'string', maxLength: 255, description: 'Libelle du bouton CTA (optionnel)' },
20
20
  color: { type: 'string', description: 'Couleur de fond hex (optionnel, defaut #5A6BE3)' },
21
21
  company_category_id: { type: 'number', description: "Id d'une categorie Marketplace (list_company_categories)" },
22
+ is_published: { type: 'boolean', description: 'Optionnel : publiee (true, defaut) ou masquee/brouillon (false).' },
22
23
  },
23
24
  required: ['lab', 'name', 'website', 'description', 'short_description', 'cta_link', 'company_category_id'],
24
25
  additionalProperties: false,
@@ -33,6 +34,7 @@ export const createCompanyTool = {
33
34
  text_cta: z.string().max(255).optional(),
34
35
  color: z.string().max(20).optional(),
35
36
  company_category_id: z.number().int().positive(),
37
+ is_published: z.boolean().optional(),
36
38
  }),
37
39
  async handler(args) {
38
40
  const parsed = this.zodSchema.parse(args);
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Tool `toggle_company_visibility` — publie / masque une société du Marketplace.
3
+ */
4
+ import { z } from 'zod';
5
+ import { http, formatApiError } from '../http.js';
6
+ export const toggleCompanyVisibilityTool = {
7
+ name: 'toggle_company_visibility',
8
+ description: "Publie ou masque une societe du Marketplace sans la supprimer. Par defaut bascule l'etat courant ; passe is_published (true = publiee/visible, false = masquee/brouillon) pour forcer une valeur. uuid vient de list_companies (qui renvoie is_published).",
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ lab: { type: 'string' },
13
+ uuid: { type: 'string', description: 'uuid de la societe (list_companies)' },
14
+ is_published: { type: 'boolean', description: 'Optionnel : force la valeur (sinon bascule).' },
15
+ },
16
+ required: ['lab', 'uuid'],
17
+ additionalProperties: false,
18
+ },
19
+ zodSchema: z.object({
20
+ lab: z.string(),
21
+ uuid: z.string(),
22
+ is_published: z.boolean().optional(),
23
+ }),
24
+ async handler(args) {
25
+ const p = this.zodSchema.parse(args);
26
+ const body = p.is_published !== undefined ? { is_published: p.is_published } : {};
27
+ try {
28
+ const { data } = await http.patch(`/mcp/labs/${encodeURIComponent(p.lab)}/companies/${encodeURIComponent(p.uuid)}/visibility`, body);
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
+ };
@@ -19,6 +19,7 @@ export const updateCompanyTool = {
19
19
  text_cta: { type: 'string', maxLength: 255 },
20
20
  color: { type: 'string' },
21
21
  company_category_id: { type: 'number', description: 'Nouvelle categorie (list_company_categories)' },
22
+ is_published: { type: 'boolean', description: 'Publiee (true) ou masquee/brouillon (false).' },
22
23
  },
23
24
  required: ['lab', 'uuid'],
24
25
  additionalProperties: false,
@@ -34,6 +35,7 @@ export const updateCompanyTool = {
34
35
  text_cta: z.string().max(255).nullable().optional(),
35
36
  color: z.string().max(20).optional(),
36
37
  company_category_id: z.number().int().positive().optional(),
38
+ is_published: z.boolean().optional(),
37
39
  }),
38
40
  async handler(args) {
39
41
  const parsed = this.zodSchema.parse(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connect-xlab/mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Serveur MCP pour piloter ton Lab ConnectXLab depuis Claude Desktop / Cursor / n'importe quel client MCP.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",