mergeon-mcp 1.23.0 → 1.27.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/README.md +18 -11
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/tools/admin.js +52 -1
- package/dist/tools/admin.js.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/orders-export.d.ts +3 -0
- package/dist/tools/orders-export.js +36 -0
- package/dist/tools/orders-export.js.map +1 -0
- package/dist/tools/products.js +60 -33
- package/dist/tools/products.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Y Claude usa el MCP para hacerlo directamente contra tu backend de MergeOn.
|
|
|
17
17
|
|
|
18
18
|
1. [¿Qué expone el MCP?](#qué-expone-el-mcp)
|
|
19
19
|
2. [Setup en Claude Desktop / Claude Code](#setup)
|
|
20
|
-
3. [Tools disponibles (
|
|
20
|
+
3. [Tools disponibles (110)](#tools-disponibles)
|
|
21
21
|
4. [Skills incluidos](#skills-incluidos)
|
|
22
22
|
5. [Variables de entorno](#variables-de-entorno)
|
|
23
23
|
6. [Desarrollo local](#desarrollo-local)
|
|
@@ -34,9 +34,9 @@ El MCP ofrece **dos tipos de capacidades** a Claude:
|
|
|
34
34
|
|
|
35
35
|
Cada tool es una función que Claude puede invocar. Internamente, el MCP autentica con tu API key (`mk_xxx`), llama al endpoint correcto del backend de MergeOn (`https://api.mergeon.dev` por defecto) inyectando tu `ecommerce_id`, y devuelve el JSON de respuesta a Claude. Claude decide cuándo usar cada tool según el contexto de la conversación.
|
|
36
36
|
|
|
37
|
-
> **
|
|
37
|
+
> **Cross-tenant (`ecommerce_id` override):** todas las tools aceptan un parámetro opcional `ecommerce_id` para apuntar a otro tenant (ej. `agent_prompts_update({ wpp_prompt_text: "...", ecommerce_id: "57" })`). La key de ecommerce 1 (superadmin) puede apuntar a **cualquier** tenant; una key de **implementador** puede apuntar a los ecommerces que gestiona; cualquier otra key solo opera sobre el suyo. El backend (`authorize_ecommerce_target`) valida la propiedad y devuelve 403 si no aplica.
|
|
38
38
|
|
|
39
|
-
Las
|
|
39
|
+
Las 116 tools cubren los principales dominios de MergeOn: **CRM, pedidos, productos, conversaciones, flujos de automatización (con catálogo de triggers/conditions/actions descubrible y filtros por reel específico via `media_ids`), calendario, marketing masivo, analytics legacy, analítica de ventas (revenue, top productos, comparativas y filtros por canal), eventos a Meta CAPI (auditoría + reenvío), nurturing/hidratación de leads, formularios dinámicos con tracking codes + UTMs, videos sociales con auto-tracking y funnel de conversión, webhooks entrantes, workers, admin, configuración del agente IA (prompts + tools), business context (conocimiento dinámico para el agente), plantillas de WhatsApp avanzadas y configuración general del ecommerce**.
|
|
40
40
|
|
|
41
41
|
### B. Skills (guías de experto instalables en `CLAUDE.md`)
|
|
42
42
|
|
|
@@ -119,7 +119,7 @@ npx mergeon-mcp skills list
|
|
|
119
119
|
|
|
120
120
|
## Tools disponibles
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
111 tools organizadas en 20 dominios. Cada nombre corresponde a la cadena exacta que verás en Claude Desktop.
|
|
123
123
|
|
|
124
124
|
> 💡 Los dominios marcados con **(catálogo descubrible)** exponen un tool `<dominio>_get_catalog` que devuelve los enums, shapes y reglas válidas. Llámalo SIEMPRE antes de crear/modificar para no inventar campos.
|
|
125
125
|
|
|
@@ -134,7 +134,7 @@ npx mergeon-mcp skills list
|
|
|
134
134
|
| `crm_delete` | Elimina contacto permanentemente. |
|
|
135
135
|
| `crm_bulk_import` | Importa varios contactos desde CSV (string con cabecera) en una sola llamada. Columnas que se guardan: name, cellphone, ig_id, ig_user, source, city, country. Deduplica por teléfono (o ig_id): los que ya existen se omiten, no se duplican. `trigger_flows` (default false) dispara el flow `crm_created` (ej. bienvenida) por cada contacto nuevo. Devuelve `{created, skipped, errors, created_ids, error_details}`. |
|
|
136
136
|
|
|
137
|
-
### Pedidos (
|
|
137
|
+
### Pedidos (7 tools)
|
|
138
138
|
| Tool | Qué hace |
|
|
139
139
|
|---|---|
|
|
140
140
|
| `orders_list` | Pedidos recientes ordenados por fecha. Filtro `last_order` (ISO datetime — solo pedidos posteriores). |
|
|
@@ -142,8 +142,10 @@ npx mergeon-mcp skills list
|
|
|
142
142
|
| `orders_create` | Crea pedido. Requiere `user_name`, `user_cellphone`, `amount` y `products: [{product_id, quantity}]`. Opcionales: dirección, email, status, payment_status, notes. |
|
|
143
143
|
| `orders_update` | PATCH parcial de status, payment_status, dirección, monto, notas. |
|
|
144
144
|
| `orders_create_shipment` | Crea envío y marca pedido como `ready_to_ship`. Acepta `tracking_number`, `tracking_url`, `courier`, `label_url`. |
|
|
145
|
+
| `orders_export_config_get` | Devuelve el mapeo de columnas de exportación CSV (orden, encabezados, separador, fila de encabezados) + `available_fields` (catálogo de campos del pedido mapeables). Mismo config que usa el botón "Exportar CSV" del dashboard. |
|
|
146
|
+
| `orders_export_config_update` | Define cómo se exportan los pedidos a CSV: `columns: [{field, header}]` (orden = orden de columnas), `delimiter` (',' ';' o '\t') e `include_header`. `field` debe ser una key de `available_fields`. Persiste por tenant. |
|
|
145
147
|
|
|
146
|
-
### Productos (
|
|
148
|
+
### Productos (6 tools)
|
|
147
149
|
| Tool | Qué hace |
|
|
148
150
|
|---|---|
|
|
149
151
|
| `products_list` | Catálogo paginado, búsqueda por `search` (nombre/descripción), `sort`, `limit`, `offset`. |
|
|
@@ -151,6 +153,7 @@ npx mergeon-mcp skills list
|
|
|
151
153
|
| `products_create` | Crea producto. Requiere `name` y `price`. Opcionales: `description`, `available` (pásalo `true` para publicarlo), `brand`, `category` (string o lista — se envía como lista), `discount_price`/`has_discount`, `slug`, `variants`. **Las imágenes y el stock viven en `variants`** (no hay columna `photo_url` a nivel producto): cada variante lleva su `photo_url` y `stock`. **No funciona en fuentes read-only (Shopify).** |
|
|
152
154
|
| `products_update` | PUT parcial de campos del producto: `name`, `price`, `description`, `available`, `brand`, `category`, `discount_price`/`has_discount`, `stock`/`manage_stock`, `slug`, `variants`. Pasar `variants` **reemplaza** el array completo; es la vía para fijar fotos por variante. |
|
|
153
155
|
| `products_bulk_update` | Aplica los mismos cambios a varios productos a la vez. Útil para subir/bajar precios en masa o (des)activar lotes. |
|
|
156
|
+
| `products_bulk_create` | Crea MUCHOS productos de una (array `products`, mismos campos que `products_create`). Para cargar un catálogo entero sin subir uno por uno. Crea cada uno por separado (una fila mala falla sola sin frenar el resto) y devuelve `{ total, created, failed, results }` con id o error por ítem. |
|
|
154
157
|
|
|
155
158
|
### Conversaciones (4 tools)
|
|
156
159
|
| Tool | Qué hace |
|
|
@@ -296,13 +299,17 @@ Endpoints HTTP que MergeOn expone para que sistemas externos creen contactos, ve
|
|
|
296
299
|
| `workers_create` | Crea worker (`username`, `password`, `role`: admin/manager/waiter, opcional `full_name`, `email`, `phone`, `notification_enabled`). |
|
|
297
300
|
| `workers_delete` | Elimina worker por `username`. No permite borrarte a ti mismo ni a usuarios `adev`. |
|
|
298
301
|
|
|
299
|
-
### Admin (
|
|
302
|
+
### Admin (8 tools — superadmin `ecommerce_id=1` o implementador)
|
|
300
303
|
| Tool | Qué hace |
|
|
301
304
|
|---|---|
|
|
302
|
-
| `admin_ecommerces_list` | Lista todos los
|
|
303
|
-
| `
|
|
304
|
-
| `
|
|
305
|
-
| `
|
|
305
|
+
| `admin_ecommerces_list` | Lista ecommerces. Superadmin: todos. Implementador: solo los que gestiona. |
|
|
306
|
+
| `admin_ecommerce_create` | Crea un ecommerce + su worker admin. Con key de implementador queda bajo su propiedad; superadmin puede pasar `implementer_id` para asignárselo a uno. |
|
|
307
|
+
| `admin_ecommerce_set_implementer` | Solo superadmin: marca/desmarca un ecommerce como implementador (`is_implementer`) y/o asigna su dueño (`implementer_id`, null para desasignar). |
|
|
308
|
+
| `admin_whatsapp_link` | Vincula WABA + número a uno de tus ecommerces (sin registrar en Meta). Implementador: solo negocios propios. Permite el mismo número en varios negocios propios. |
|
|
309
|
+
| `admin_whatsapp_disconnect` | Desconecta WhatsApp de uno de tus ecommerces (no borra el ecommerce). Implementador: solo negocios propios. |
|
|
310
|
+
| `admin_subscriptions_list` | Suscripciones con filtros `status` y `plan`. Solo superadmin. |
|
|
311
|
+
| `admin_prompts_get` | Prompts del agente IA de un ecommerce concreto. Solo superadmin. |
|
|
312
|
+
| `admin_prompts_update` | Actualiza prompts del agente IA de un ecommerce. Solo superadmin. |
|
|
306
313
|
|
|
307
314
|
### Agente IA — Configuración (8 tools)
|
|
308
315
|
| Tool | Qué hace |
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { registerAllTools } from "./tools/index.js";
|
|
|
7
7
|
const client = new MergeOnClient();
|
|
8
8
|
const server = new McpServer({
|
|
9
9
|
name: "mergeon",
|
|
10
|
-
version: "1.
|
|
10
|
+
version: "1.26.0",
|
|
11
11
|
});
|
|
12
12
|
// ── Superadmin cross-tenant override ─────────────────────────────────────────
|
|
13
13
|
// Inyecta un parámetro `ecommerce_id` opcional en TODAS las tools y lo enruta al
|
|
@@ -19,7 +19,7 @@ const ecommerceIdShape = {
|
|
|
19
19
|
ecommerce_id: z
|
|
20
20
|
.string()
|
|
21
21
|
.optional()
|
|
22
|
-
.describe("
|
|
22
|
+
.describe("Target a specific ecommerce. A superadmin key (ecommerce_id=1) can target ANY ecommerce; an implementer key can target the ecommerces it owns/manages; other keys can only act on their own ecommerce."),
|
|
23
23
|
};
|
|
24
24
|
const originalTool = server.tool.bind(server);
|
|
25
25
|
server.tool = (name, ...rest) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EA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cAAc,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjC,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC1B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/tools/admin.js
CHANGED
|
@@ -3,7 +3,46 @@ function text(data) {
|
|
|
3
3
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
4
4
|
}
|
|
5
5
|
export function registerAdminTools(server, client) {
|
|
6
|
-
server.tool("admin_ecommerces_list", "List
|
|
6
|
+
server.tool("admin_ecommerces_list", "List ecommerces (tenants). With a superadmin key (ecommerce_id=1) returns ALL tenants; with an implementer key returns only the ecommerces that implementer owns/manages.", {}, async () => text(await client.get("/admin/ecommerces")));
|
|
7
|
+
server.tool("admin_ecommerce_create", "Create a new ecommerce (tenant) plus its admin worker. With an implementer key the new ecommerce is automatically owned by that implementer; with a superadmin key (ecommerce_id=1) it is platform-direct unless implementer_id is passed to assign it to an implementer.", {
|
|
8
|
+
name: z.string().describe("Ecommerce/business name (must be unique)"),
|
|
9
|
+
full_name: z.string().describe("Admin worker full name"),
|
|
10
|
+
email: z.string().describe("Admin worker email"),
|
|
11
|
+
phone: z.string().describe("Admin worker phone"),
|
|
12
|
+
password: z.string().describe("Admin worker password"),
|
|
13
|
+
country_code: z.string().optional().describe("Phone country code, default '57'"),
|
|
14
|
+
implementer_id: z
|
|
15
|
+
.number()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Superadmin only: ecommerce_id of the implementer to assign this new tenant to. Ignored for implementer keys (they always own what they create)."),
|
|
18
|
+
}, async (params) => {
|
|
19
|
+
const body = {
|
|
20
|
+
name: params.name,
|
|
21
|
+
full_name: params.full_name,
|
|
22
|
+
email: params.email,
|
|
23
|
+
phone: params.phone,
|
|
24
|
+
password: params.password,
|
|
25
|
+
};
|
|
26
|
+
if (params.country_code !== undefined)
|
|
27
|
+
body.country_code = params.country_code;
|
|
28
|
+
if (params.implementer_id !== undefined)
|
|
29
|
+
body.implementer_id = params.implementer_id;
|
|
30
|
+
return text(await client.post("/admin/ecommerces", body));
|
|
31
|
+
});
|
|
32
|
+
server.tool("admin_whatsapp_link", "Link a WhatsApp WABA + phone number to one of your ecommerces (no Meta registration; for already-active WABAs). An implementer can only link to ecommerces it owns. The same number may be linked to several of your own ecommerces.", {
|
|
33
|
+
target_ecommerce_id: z.string().describe("ID of the ecommerce to link the number to (must be one you own)"),
|
|
34
|
+
waba_id: z.string().describe("WhatsApp Business Account ID"),
|
|
35
|
+
phone_number_id: z.string().describe("Meta phone_number_id"),
|
|
36
|
+
display_phone_number: z.string().optional().describe("Human-readable phone number"),
|
|
37
|
+
}, async ({ target_ecommerce_id, waba_id, phone_number_id, display_phone_number }) => {
|
|
38
|
+
const body = { waba_id, phone_number_id };
|
|
39
|
+
if (display_phone_number !== undefined)
|
|
40
|
+
body.display_phone_number = display_phone_number;
|
|
41
|
+
return text(await client.post(`/admin/ecommerces/${target_ecommerce_id}/link-whatsapp`, body));
|
|
42
|
+
});
|
|
43
|
+
server.tool("admin_whatsapp_disconnect", "Disconnect WhatsApp (WABA + number) from one of your ecommerces. Clears the integration but does NOT delete the ecommerce. An implementer can only disconnect numbers from ecommerces it owns.", {
|
|
44
|
+
target_ecommerce_id: z.string().describe("ID of the ecommerce to disconnect WhatsApp from (must be one you own)"),
|
|
45
|
+
}, async ({ target_ecommerce_id }) => text(await client.delete(`/ecommerce/${target_ecommerce_id}/whatsapp`)));
|
|
7
46
|
server.tool("admin_subscriptions_list", "List all subscriptions with ecommerce data. Filter by status or plan. Superadmin only.", {
|
|
8
47
|
status: z.string().optional().describe("Filter: active, canceled, expired"),
|
|
9
48
|
plan: z.string().optional().describe("Filter by plan name"),
|
|
@@ -22,5 +61,17 @@ export function registerAdminTools(server, client) {
|
|
|
22
61
|
}, async ({ ecommerce_id, prompts }) => {
|
|
23
62
|
return text(await client.patch(`/admin/prompts/${ecommerce_id}`, prompts));
|
|
24
63
|
});
|
|
64
|
+
server.tool("admin_ecommerce_set_implementer", "Superadmin only (ecommerce_id=1): mark/unmark an ecommerce as an implementer (is_implementer) and/or assign which implementer owns it (implementer_id). Pass implementer_id=null to unassign (make it platform-direct).", {
|
|
65
|
+
target_ecommerce_id: z.string().describe("ID of the ecommerce to modify"),
|
|
66
|
+
is_implementer: z.boolean().optional().describe("true = this ecommerce becomes an implementer (can own others); false = revoke"),
|
|
67
|
+
implementer_id: z.number().nullable().optional().describe("ecommerce_id of the owning implementer; null to unassign"),
|
|
68
|
+
}, async ({ target_ecommerce_id, is_implementer, implementer_id }) => {
|
|
69
|
+
const body = {};
|
|
70
|
+
if (is_implementer !== undefined)
|
|
71
|
+
body.is_implementer = is_implementer;
|
|
72
|
+
if (implementer_id !== undefined)
|
|
73
|
+
body.implementer_id = implementer_id;
|
|
74
|
+
return text(await client.patch(`/admin/ecommerces/${target_ecommerce_id}`, body));
|
|
75
|
+
});
|
|
25
76
|
}
|
|
26
77
|
//# sourceMappingURL=admin.js.map
|
package/dist/tools/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/tools/admin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,IAAI,CAAC,IAAS;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI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KAAK,SAAS;YAAE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACvE,OAAO,IAAI,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,qBAAqB,mBAAmB,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;IACpF,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { registerCrmTools } from "./crm.js";
|
|
2
2
|
import { registerOrdersTools } from "./orders.js";
|
|
3
|
+
import { registerOrdersExportTools } from "./orders-export.js";
|
|
3
4
|
import { registerProductsTools } from "./products.js";
|
|
4
5
|
import { registerConversationsTools } from "./conversations.js";
|
|
5
6
|
import { registerFlowsTools } from "./flows.js";
|
|
@@ -24,6 +25,7 @@ import { registerAppointmentRemindersTools } from "./appointment-reminders.js";
|
|
|
24
25
|
export function registerAllTools(server, client) {
|
|
25
26
|
registerCrmTools(server, client);
|
|
26
27
|
registerOrdersTools(server, client);
|
|
28
|
+
registerOrdersExportTools(server, client);
|
|
27
29
|
registerProductsTools(server, client);
|
|
28
30
|
registerConversationsTools(server, client);
|
|
29
31
|
registerFlowsTools(server, client);
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,sBA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,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
function text(data) {
|
|
3
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
4
|
+
}
|
|
5
|
+
export function registerOrdersExportTools(server, client) {
|
|
6
|
+
server.tool("orders_export_config_get", "Get the CSV export configuration for orders: the ordered list of columns (each maps an order field to a CSV header), the delimiter and whether a header row is included, plus `available_fields` (the catalog of order fields that can be mapped). Call this before updating to see the current mapping and the valid field keys. Same config the dashboard's 'Export CSV' button uses.", {}, async () => text(await client.get("/orders/export-config")));
|
|
7
|
+
server.tool("orders_export_config_update", "Set how orders are exported to CSV: define the ordered `columns` (each {field, header}), the `delimiter` (',' ';' or '\\t' for tab) and `include_header`. Every `field` must be a key from orders_export_config_get's available_fields; unknown fields are ignored. Replaces the whole column mapping. This config persists per tenant and is shared with the dashboard export.", {
|
|
8
|
+
columns: z
|
|
9
|
+
.array(z.object({
|
|
10
|
+
field: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe("Order field key — must be one of available_fields from orders_export_config_get (e.g. 'id', 'user_name', 'products', 'amount')"),
|
|
13
|
+
header: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("CSV column header text; defaults to the field's label if omitted"),
|
|
17
|
+
}))
|
|
18
|
+
.describe("Ordered list of CSV columns, top-to-bottom = left-to-right"),
|
|
19
|
+
delimiter: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("Column separator: ',' (default), ';' or '\\t' for tab"),
|
|
23
|
+
include_header: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Whether to include a header row (default true)"),
|
|
27
|
+
}, async ({ columns, delimiter, include_header }) => {
|
|
28
|
+
const body = { columns };
|
|
29
|
+
if (delimiter !== undefined)
|
|
30
|
+
body.delimiter = delimiter;
|
|
31
|
+
if (include_header !== undefined)
|
|
32
|
+
body.include_header = include_header;
|
|
33
|
+
return text(await client.put("/orders/export-config", body));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=orders-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders-export.js","sourceRoot":"","sources":["../../src/tools/orders-export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,IAAI,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MAAM,MAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/products.js
CHANGED
|
@@ -30,6 +30,44 @@ function normalizeVariants(variants) {
|
|
|
30
30
|
return out;
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
+
// Campos de creación de producto. Compartido por products_create (uno) y
|
|
34
|
+
// products_bulk_create (varios) para que ambos acepten exactamente lo mismo.
|
|
35
|
+
const productCreateShape = {
|
|
36
|
+
name: z.string().describe("Product name"),
|
|
37
|
+
price: z.number().describe("Product price in COP"),
|
|
38
|
+
description: z.string().optional().describe("Product description"),
|
|
39
|
+
available: z.boolean().optional().describe("Whether the product is available/visible in the catalog. Pass true to publish it; if omitted it stays unset (null)."),
|
|
40
|
+
brand: z.string().optional().describe("Brand"),
|
|
41
|
+
category: z
|
|
42
|
+
.union([z.string(), z.array(z.string())])
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("Category or list of categories. A single string is auto-wrapped into a list (the backend stores categories as an array)."),
|
|
45
|
+
discount_price: z.number().optional().describe("Sale/discounted price in COP. Setting it auto-enables has_discount."),
|
|
46
|
+
has_discount: z.boolean().optional().describe("Whether the discount is active (auto-true when discount_price is set)."),
|
|
47
|
+
slug: z.string().optional().describe("URL slug (lowercase, numbers, hyphens)"),
|
|
48
|
+
variants: z
|
|
49
|
+
.array(variantSchema)
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Product variants (color/size combos). Each variant carries its own stock and photo_url — this is how images and inventory are attached to scratch products."),
|
|
52
|
+
};
|
|
53
|
+
// Arma el body para POST /products/ a partir de los campos de creación:
|
|
54
|
+
// envuelve category en lista, normaliza variants y auto-activa has_discount.
|
|
55
|
+
function buildProductBody(params) {
|
|
56
|
+
const body = {};
|
|
57
|
+
for (const [k, v] of Object.entries(params)) {
|
|
58
|
+
if (v === undefined)
|
|
59
|
+
continue;
|
|
60
|
+
if (k === "category")
|
|
61
|
+
body.category = Array.isArray(v) ? v : [v];
|
|
62
|
+
else if (k === "variants")
|
|
63
|
+
body.variants = normalizeVariants(v);
|
|
64
|
+
else
|
|
65
|
+
body[k] = v;
|
|
66
|
+
}
|
|
67
|
+
if (body.discount_price !== undefined && body.has_discount === undefined)
|
|
68
|
+
body.has_discount = true;
|
|
69
|
+
return body;
|
|
70
|
+
}
|
|
33
71
|
export function registerProductsTools(server, client) {
|
|
34
72
|
server.tool("products_list", "List products in the catalog with pagination and optional search. Returns name, price, stock, image, and category.", {
|
|
35
73
|
search: z.string().optional().describe("Search by product name or description"),
|
|
@@ -45,39 +83,7 @@ export function registerProductsTools(server, client) {
|
|
|
45
83
|
return text(await client.get("/products/", qp));
|
|
46
84
|
});
|
|
47
85
|
server.tool("products_get", "Get full details of a product by ID or slug, including variants, images, and inventory.", { identificator: z.string().describe("Product ID or slug") }, async ({ identificator }) => text(await client.get(`/products/${identificator}`)));
|
|
48
|
-
server.tool("products_create", "Create a new product in the catalog (scratch sources only — Shopify/WooCommerce are read-only). Pass `available: true` to publish it so the catalog/agent can show it. Images and inventory live on `variants`: there is NO product-level photo_url column, so attach each photo/stock via a variant (e.g. one variant per Color/Talla combo). Pass `variants` here to create everything in one call, or add them later with products_update.",
|
|
49
|
-
name: z.string().describe("Product name"),
|
|
50
|
-
price: z.number().describe("Product price in COP"),
|
|
51
|
-
description: z.string().optional().describe("Product description"),
|
|
52
|
-
available: z.boolean().optional().describe("Whether the product is available/visible in the catalog. Pass true to publish it; if omitted it stays unset (null)."),
|
|
53
|
-
brand: z.string().optional().describe("Brand"),
|
|
54
|
-
category: z
|
|
55
|
-
.union([z.string(), z.array(z.string())])
|
|
56
|
-
.optional()
|
|
57
|
-
.describe("Category or list of categories. A single string is auto-wrapped into a list (the backend stores categories as an array)."),
|
|
58
|
-
discount_price: z.number().optional().describe("Sale/discounted price in COP. Setting it auto-enables has_discount."),
|
|
59
|
-
has_discount: z.boolean().optional().describe("Whether the discount is active (auto-true when discount_price is set)."),
|
|
60
|
-
slug: z.string().optional().describe("URL slug (lowercase, numbers, hyphens)"),
|
|
61
|
-
variants: z
|
|
62
|
-
.array(variantSchema)
|
|
63
|
-
.optional()
|
|
64
|
-
.describe("Product variants (color/size combos). Each variant carries its own stock and photo_url — this is how images and inventory are attached to scratch products."),
|
|
65
|
-
}, async (params) => {
|
|
66
|
-
const body = {};
|
|
67
|
-
for (const [k, v] of Object.entries(params)) {
|
|
68
|
-
if (v === undefined)
|
|
69
|
-
continue;
|
|
70
|
-
if (k === "category")
|
|
71
|
-
body.category = Array.isArray(v) ? v : [v];
|
|
72
|
-
else if (k === "variants")
|
|
73
|
-
body.variants = normalizeVariants(v);
|
|
74
|
-
else
|
|
75
|
-
body[k] = v;
|
|
76
|
-
}
|
|
77
|
-
if (body.discount_price !== undefined && body.has_discount === undefined)
|
|
78
|
-
body.has_discount = true;
|
|
79
|
-
return text(await client.post("/products/", body));
|
|
80
|
-
});
|
|
86
|
+
server.tool("products_create", "Create a new product in the catalog (scratch sources only — Shopify/WooCommerce are read-only). Pass `available: true` to publish it so the catalog/agent can show it. Images and inventory live on `variants`: there is NO product-level photo_url column, so attach each photo/stock via a variant (e.g. one variant per Color/Talla combo). Pass `variants` here to create everything in one call, or add them later with products_update.", productCreateShape, async (params) => text(await client.post("/products/", buildProductBody(params))));
|
|
81
87
|
server.tool("products_update", "Update a product's fields (scratch sources only). Send only the fields to change. Use `available` to show/hide it, `stock`/`manage_stock` for product-level inventory, `discount_price` for a sale price. IMPORTANT: images are NOT a product-level field — attach photos through `variants` (each variant has its own photo_url). Passing `variants` REPLACES the full variants array.", {
|
|
82
88
|
product_id: z.string().describe("Product ID to update"),
|
|
83
89
|
name: z.string().optional(),
|
|
@@ -131,5 +137,26 @@ export function registerProductsTools(server, client) {
|
|
|
131
137
|
body.has_discount = true;
|
|
132
138
|
return text(await client.post(`/products/bulk-update`, { product_ids, updates: body }));
|
|
133
139
|
});
|
|
140
|
+
server.tool("products_bulk_create", "Create MANY products at once (scratch sources only) so a business can onboard its whole catalog without adding them one by one. Pass `products`: an array of items with the SAME fields as products_create (name, price, variants, etc.). Each product is created individually, so a bad row fails on its own without blocking the rest. Returns a summary { total, created, failed, results } with the new id or the error per item.", {
|
|
141
|
+
products: z
|
|
142
|
+
.array(z.object(productCreateShape))
|
|
143
|
+
.min(1)
|
|
144
|
+
.describe("List of products to create. Each item takes the same fields as products_create."),
|
|
145
|
+
}, async ({ products }) => {
|
|
146
|
+
const results = [];
|
|
147
|
+
let created = 0;
|
|
148
|
+
for (let i = 0; i < products.length; i++) {
|
|
149
|
+
const p = products[i];
|
|
150
|
+
try {
|
|
151
|
+
const res = await client.post("/products/", buildProductBody(p));
|
|
152
|
+
created++;
|
|
153
|
+
results.push({ index: i, name: p.name, success: true, id: res?.id ?? null, slug: res?.slug ?? null });
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
results.push({ index: i, name: p.name, success: false, error: e?.message ?? String(e) });
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return text({ total: products.length, created, failed: products.length - created, results });
|
|
160
|
+
});
|
|
134
161
|
}
|
|
135
162
|
//# sourceMappingURL=products.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/tools/products.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,IAAI,CAAC,IAAS;IACrB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACvF,CAAC;AAED,uEAAuE;AACvE,6EAA6E;AAC7E,8EAA8E;AAC9E,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ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