mergeon-mcp 1.70.0 → 1.79.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 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 (202)](#tools-disponibles)
20
+ 3. [Tools disponibles (217)](#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)
@@ -36,7 +36,7 @@ Cada tool es una función que Claude puede invocar. Internamente, el MCP autenti
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 202 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, reparto automático de contactos entre asesores con avisos dirigidos por WhatsApp, 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**.
39
+ Las 217 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, reparto automático de contactos entre asesores con avisos dirigidos por WhatsApp, 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
 
@@ -128,7 +128,7 @@ npx mergeon-mcp skills list
128
128
 
129
129
  ## Tools disponibles
130
130
 
131
- 202 tools organizadas en 24 dominios. Cada nombre corresponde a la cadena exacta que verás en Claude Desktop.
131
+ 217 tools organizadas en 25 dominios. Cada nombre corresponde a la cadena exacta que verás en Claude Desktop.
132
132
 
133
133
  > 💡 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.
134
134
 
@@ -267,6 +267,18 @@ Auditoría y backfill de eventos de Conversions API for Business Messaging. Para
267
267
  | `meta_events_send_order_capi` | Reenvía evento Purchase para una orden. Idempotente: si ya existe devuelve `already_exists: true`. |
268
268
  | `meta_events_send_bulk_capi` | Reenvía Purchase para muchas órdenes (recibe la lista que devuelve `meta_events_orders_pending_capi`). |
269
269
 
270
+ ### Eventos a TikTok (6 tools)
271
+ Retroalimentación de conversiones a TikTok Ads con **Events API 2.0** (`event_source: crm`). Es el equivalente de Meta CAPI para TikTok y **no depende de ninguna beta**: empareja la venta con el clic por teléfono y correo del comprador (hasheados con SHA-256), así que funciona igual cuando el anuncio de TikTok abre WhatsApp en vez de un DM. El canal de mensajes de TikTok es otra cosa y sigue esperando la allowlist de Business Messaging.
272
+
273
+ | Tool | Qué hace |
274
+ |---|---|
275
+ | `tiktok_status` | Si el negocio reporta a TikTok y cómo está configurado. **Mira `in_test_mode` primero**: con el test event code puesto, nada cuenta como conversión real — es la causa #1 de "TikTok no me recibe las ventas". Nunca devuelve el token. |
276
+ | `tiktok_connect` | Conecta la cuenta con dos datos de TikTok Events Manager: el access token de Events API y el ID de un conjunto de eventos tipo CRM. No valida al guardar (TikTok no expone un "¿este token sirve?"): se prueba con `tiktok_test`. |
277
+ | `tiktok_config_update` | Nombre del evento de compra y de lead, test event code y encendido/apagado. El nombre del evento **tiene que ser el mismo al que está optimizada la campaña**. Mandar `test_event_code` vacío es lo que saca al negocio del modo de prueba. |
278
+ | `tiktok_test` | Manda un evento ficticio a Test Events. Exige el test event code a propósito: sin él la prueba entraría como conversión real. |
279
+ | `tiktok_send_order_event` | Reporta un pedido a mano (backfill). Idempotente: un pedido ya reportado vuelve con `skipped_duplicate: true` salvo que pases `force`. |
280
+ | `tiktok_disconnect` | Borra las credenciales. Los eventos ya reportados se quedan en TikTok. |
281
+
270
282
  ### Nurturing / Hidratación de leads (6 tools + catálogo descubrible)
271
283
  Secuencias multi-touch por etapa del CRM (cold/warm/hot/sold/...). Internamente endpoint `/hydration/`. Para diseñar secuencias, instala el skill `nurturing-creation`. **v1.13.0:** los flows aceptan `interest_keywords` para segmentar por interés; la IA de WhatsApp etiqueta leads con la tool de bot `add_lead_keyword` (aparece en `agent_tools_get`).
272
284
 
@@ -205,7 +205,7 @@ const ACTION_PAYLOADS = [
205
205
  },
206
206
  ];
207
207
  const PLACEHOLDER_REFERENCE = {
208
- order: ["customer_name", "name", "user_name", "address", "city", "phone", "user_phone", "email", "amount", "total", "provider", "status", "order_id", "id", "observations", "delivery_price", "products", "product_names"],
208
+ order: ["customer_name", "name", "user_name", "address", "city", "phone", "user_phone", "email", "amount", "total", "provider", "status", "order_id", "id", "order_number", "external_id", "observations", "delivery_price", "products", "product_names"],
209
209
  crm: ["name", "customer_name", "user_name", "phone", "cellphone", "user_phone", "city", "country", "source", "status", "ig_id", "ig_user", "messenger_id", "notes", "attended_by", "id", "contacted_at", "last_message"],
210
210
  message: ["content", "message", "session_id", "source", "type"],
211
211
  event: ["query_description", "problem_description", "detail", "title", "attended_by (alias: advisor)", "customer_name", "session_id", "kind"],
@@ -1 +1 @@
1
- {"version":3,"file":"flows.js","sourceRoot":"","sources":["../../src/tools/flows.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,yEAAyE;AACzE,sEAAsE;AACtE,yEAAyE;AACzE,yEAAyE;AAEzE,MAAM,aAAa,GAAG;IACpB,iBAAiB,EAAM,2EAA2E;IAClG,eAAe,EAAQ,8BAA8B;IACrD,aAAa,EAAU,kCAAkC;IACzD,oBAAoB,EAAG,wDAAwD;IAC/E,MAAM,EAAiB,2DAA2D;IAClF,qBAAqB,EAAE,0DAA0D;IACjF,wBAAwB,EAAE,+EAA+E;IACzG,qBAAqB,EAAE,6EAA6E;IACpG,YAAY,EAAW,0BAA0B;IACjD,aAAa,EAAU,wCAAwC;IAC/D,eAAe,EAAQ,0CAA0C;IACjE,gBAAgB,EAAO,kDAAkD;IACzE,eAAe,EAAQ,wEAAwE;IAC/F,iBAAiB,EAAM,+EAA+E;IACtG,qBAAqB,EAAE,0EAA0E;CACzF,CAAC;AAEX,MAAM,YAAY,GAAG;IACnB,cAAc,EAAU,sEAAsE;IAC9F,cAAc,EAAU,wFAAwF;IAChH,YAAY,EAAY,oEAAoE;IAC5F,aAAa,EAAW,2CAA2C;IACnE,eAAe,EAAS,0DAA0D;IAClF,iBAAiB,EAAO,gEAAgE;IACxF,iBAAiB,EAAO,uEAAuE;IAC/F,WAAW,EAAa,+CAA+C;I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;gBAC9B,uBAAuB;gBACvB,4CAA4C;aAC7C;SACF;QACD;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,6JAA6J;YAC1K,UAAU,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,kDAAkD,CAAC;SAC/F;QACD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,6EAA6E;YAC1F,UAAU,EAAE,CAAC,8BAA8B,EAAE,yBAAyB,EAAE,2BAA2B,CAAC;SACrG;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,mFAAmF;YAChG,UAAU,EAAE,CAAC,kEAAkE,EAAE,kDAAkD,CAAC;SACrI;QACD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,kUAAkU;YAC/U,UAAU,EAAE,CAAC,2DAA2D,EAAE,yCAAyC,CAAC;SACrH;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,wLAAwL;YACrM,UAAU,EAAE,CAAC,+DAA+D,EAAE,iBAAiB,CAAC;SACjG;KACF;IACD,YAAY,EAAE,eAAe;IAC7B,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,qBAAqB;CACxC,CAAC"}
@@ -10,14 +10,13 @@ import { registerAnalyticsTools } from "./analytics.js";
10
10
  import { registerWorkersTools } from "./workers.js";
11
11
  import { registerAdvisorsTools } from "./advisors.js";
12
12
  import { registerAdminTools } from "./admin.js";
13
+ import { registerPlansTools } from "./plans.js";
13
14
  import { registerAgentConfigTools } from "./agent-config.js";
14
15
  import { registerAgentsRegistryTools } from "./agents-registry.js";
15
16
  import { registerBusinessContextTools } from "./business-context.js";
16
17
  import { registerTemplatesTools } from "./templates.js";
17
18
  import { registerEcommerceTools } from "./ecommerce.js";
18
19
  import { registerShopifyTools } from "./shopify.js";
19
- import { registerSiigoTools, registerIntegrationRolesTools } from "./siigo.js";
20
- import { registerPaymentMethodsTools } from "./payments.js";
21
20
  import { registerSalesAnalyticsTools } from "./sales-analytics.js";
22
21
  import { registerMetaEventsTools } from "./meta-events.js";
23
22
  import { registerNurturingTools } from "./nurturing.js";
@@ -31,6 +30,7 @@ import { registerNpsTools } from "./nps.js";
31
30
  import { registerCustomToolsTools } from "./custom-tools.js";
32
31
  import { registerChannelsTools } from "./channels.js";
33
32
  import { registerLinesTools } from "./lines.js";
33
+ import { registerTikTokTools } from "./tiktok.js";
34
34
  export function registerAllTools(server, client) {
35
35
  registerCrmTools(server, client);
36
36
  registerOrdersTools(server, client);
@@ -44,15 +44,13 @@ export function registerAllTools(server, client) {
44
44
  registerWorkersTools(server, client);
45
45
  registerAdvisorsTools(server, client);
46
46
  registerAdminTools(server, client);
47
+ registerPlansTools(server, client);
47
48
  registerAgentConfigTools(server, client);
48
49
  registerAgentsRegistryTools(server, client);
49
50
  registerBusinessContextTools(server, client);
50
51
  registerTemplatesTools(server, client);
51
52
  registerEcommerceTools(server, client);
52
53
  registerShopifyTools(server, client);
53
- registerSiigoTools(server, client);
54
- registerIntegrationRolesTools(server, client);
55
- registerPaymentMethodsTools(server, client);
56
54
  registerSalesAnalyticsTools(server, client);
57
55
  registerMetaEventsTools(server, client);
58
56
  registerNurturingTools(server, client);
@@ -66,5 +64,6 @@ export function registerAllTools(server, client) {
66
64
  registerCustomToolsTools(server, client);
67
65
  registerChannelsTools(server, client);
68
66
  registerLinesTools(server, client);
67
+ registerTikTokTools(server, client);
69
68
  }
70
69
  //# sourceMappingURL=index.js.map
@@ -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,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AA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AC;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;IAClD,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { MergeOnClient } from "../client.js";
3
- export declare function registerPaymentMethodsTools(server: McpServer, client: MergeOnClient): void;
3
+ export declare function registerPlansTools(server: McpServer, client: MergeOnClient): void;
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ function text(data) {
3
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
4
+ }
5
+ // Un plan es de la plataforma (owner_implementer_id=null, los de MergeOn, los
6
+ // únicos que pueden ser públicos) o privado de un implementador, que solo ve y
7
+ // toca los suyos. El backend resuelve eso solo a partir de la key: acá no se
8
+ // decide nada, solo se expone el CRUD.
9
+ export function registerPlansTools(server, client) {
10
+ server.tool("plans_list", "List the subscription plans this key can see: the public platform plans plus the private ones of the implementer that manages you (a superadmin key, ecommerce_id=1, sees ALL of them). This is the CATALOG of plans — use it, not admin_subscriptions_list, to find out which plans exist: a plan nobody is subscribed to shows up here and NOT there. Each plan carries its id (what you pass as plan_id to admin_subscription_update), name, base_price, currency, the tools it enables and its contact limits.", {
11
+ ecommerce_id: z.string().optional().describe("Ecommerce ID (defaults to your own)"),
12
+ }, async () => text(await client.get("/plans/")));
13
+ server.tool("plans_get", "Get one plan by id, with its full configuration: price, currency, enabled tools, active-contact limit and overage price, included WhatsApp numbers, and whether it is offered on Shopify. Returns 404 if the plan does not exist or belongs to another implementer.", {
14
+ plan_id: z.number().describe("Plan id (from plans_list)"),
15
+ ecommerce_id: z.string().optional().describe("Ecommerce ID (defaults to your own)"),
16
+ }, async ({ plan_id }) => text(await client.get(`/plans/${plan_id}`)));
17
+ server.tool("plans_create", "Create a subscription plan. Only a superadmin key (ecommerce_id=1) or an implementer key can do this; an implementer's plan is FORCED to private and to their own ownership by the backend, no matter what you send.\n\nFor a free plan pass base_price 0 and commission 0. Note that `tools` is what gates the agent's capabilities: leaving it empty does NOT mean 'no tools' — the platform falls back to the full catalog when a plan does not restrict anything, so a free plan with an empty list hands out everything. List explicitly what the plan should allow.\n\nUse active_contacts_limit to cap a free tier (0 = unlimited), and public:false for a plan you only assign by hand.", {
18
+ name: z.string().describe("Plan name, e.g. 'Free'"),
19
+ description: z.string().describe("What the plan includes, in business language"),
20
+ base_price: z.number().describe("Monthly base price. 0 for a free plan"),
21
+ commission: z.number().describe("Plan commission as a whole number. 0 if none"),
22
+ currency: z.string().optional().describe("Currency code, default 'COP'"),
23
+ tools: z
24
+ .array(z.string())
25
+ .optional()
26
+ .describe("Agent tool names this plan enables. IMPORTANT: an empty list means 'no restriction' and falls back to the WHOLE catalog — spell out the tools for a limited plan"),
27
+ active: z.boolean().optional().describe("Whether the plan can be assigned. Default true"),
28
+ public: z.boolean().optional().describe("true = shown in the public catalog; false = assigned by hand only. Default true"),
29
+ b2b: z.boolean().optional().describe("Whether the plan targets B2B clients. Default true"),
30
+ only_api: z.boolean().optional().describe("true = API migration only, without AI. Default false"),
31
+ active_contacts_limit: z
32
+ .number()
33
+ .optional()
34
+ .describe("Active contacts allowed (0 = unlimited). This is the usual lever for capping a free tier"),
35
+ aditional_contact_price: z.number().optional().describe("Price per contact over the limit"),
36
+ included_numbers: z.number().optional().describe("WhatsApp numbers included. Default 1"),
37
+ additional_number_price: z
38
+ .number()
39
+ .optional()
40
+ .describe("Monthly price per extra WhatsApp number. Omit to not charge for extras"),
41
+ available_ecommerces: z
42
+ .array(z.number())
43
+ .optional()
44
+ .describe("Restrict the plan to these ecommerce ids. Empty/omitted = available to all"),
45
+ plan_id: z.string().optional().describe("Plan id in the external payment system, if any"),
46
+ available_on_shopify: z
47
+ .boolean()
48
+ .optional()
49
+ .describe("Offer it to Shopify merchants. Shopify caps an app at 4 public plans. Default false"),
50
+ shopify_plan_handle: z.string().optional().describe("Matching plan handle in Shopify App Pricing"),
51
+ ecommerce_id: z.string().optional().describe("Ecommerce ID (defaults to your own)"),
52
+ }, async ({ ecommerce_id, ...plan }) => text(await client.post("/plans/", plan)));
53
+ server.tool("plans_update", "Replace a plan's configuration. This is a PUT: send the plan whole, because the fields you leave out go back to their defaults — read it with plans_get first and resend everything you want to keep. An implementer can only touch their own plans.", {
54
+ plan_id: z.number().describe("Plan id to update"),
55
+ name: z.string().describe("Plan name"),
56
+ description: z.string().describe("What the plan includes"),
57
+ base_price: z.number().describe("Monthly base price"),
58
+ commission: z.number().describe("Plan commission"),
59
+ currency: z.string().optional().describe("Currency code, default 'COP'"),
60
+ tools: z.array(z.string()).optional().describe("Agent tools enabled. Empty = no restriction (full catalog)"),
61
+ active: z.boolean().optional().describe("Whether the plan can be assigned"),
62
+ public: z.boolean().optional().describe("Public catalog or hand-assigned only"),
63
+ b2b: z.boolean().optional().describe("Targets B2B clients"),
64
+ only_api: z.boolean().optional().describe("API only, without AI"),
65
+ active_contacts_limit: z.number().optional().describe("Active contacts allowed (0 = unlimited)"),
66
+ aditional_contact_price: z.number().optional().describe("Price per contact over the limit"),
67
+ included_numbers: z.number().optional().describe("WhatsApp numbers included"),
68
+ additional_number_price: z.number().optional().describe("Monthly price per extra number"),
69
+ available_ecommerces: z.array(z.number()).optional().describe("Restrict to these ecommerce ids"),
70
+ plan_id_external: z.string().optional().describe("Plan id in the external payment system"),
71
+ available_on_shopify: z.boolean().optional().describe("Offer it to Shopify merchants"),
72
+ shopify_plan_handle: z.string().optional().describe("Matching Shopify plan handle"),
73
+ ecommerce_id: z.string().optional().describe("Ecommerce ID (defaults to your own)"),
74
+ }, async ({ plan_id, plan_id_external, ecommerce_id, ...rest }) => {
75
+ const body = { ...rest };
76
+ // El campo del modelo se llama plan_id igual que la ruta, así que en la
77
+ // tool viaja como plan_id_external para no pisar el id del plan a editar.
78
+ if (plan_id_external !== undefined)
79
+ body.plan_id = plan_id_external;
80
+ return text(await client.put(`/plans/${plan_id}`, body));
81
+ });
82
+ server.tool("plans_delete", "Delete a plan permanently. Prefer plans_update with active:false — deleting one that ecommerces are still subscribed to leaves those subscriptions pointing at a plan that no longer exists.", {
83
+ plan_id: z.number().describe("Plan id to delete"),
84
+ ecommerce_id: z.string().optional().describe("Ecommerce ID (defaults to your own)"),
85
+ }, async ({ plan_id }) => text(await client.delete(`/plans/${plan_id}`)));
86
+ }
87
+ //# sourceMappingURL=plans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/tools/plans.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,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,uCAAuC;AACvC,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAqB;IACzE,MAAM,C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CAAC,CAAC,CAAC;IAC3D,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,cAAc,EACd,8LAA8L,EAC9L;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QACjD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACpF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC,CACtE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { MergeOnClient } from "../client.js";
3
+ export declare function registerTikTokTools(server: McpServer, client: MergeOnClient): void;
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+ function text(data) {
3
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
4
+ }
5
+ export function registerTikTokTools(server, client) {
6
+ server.tool("tiktok_status", "Check whether this business reports conversions to TikTok and how it is configured. Read `in_test_mode` first: while a test event code is set, NOTHING counts as a real conversion — that is the most common reason a client says 'TikTok is not receiving my sales'. Never returns the access token.", {}, async () => text(await client.get("/integrations/tiktok/status")));
7
+ server.tool("tiktok_connect", "Connect this business's TikTok Ads account for conversion reporting (Events API 2.0). Needs two values from TikTok Events Manager: the Events API access token and the id of a CRM-type event set. This is NOT the TikTok DM channel (that one is still gated behind TikTok's Business Messaging allowlist) — it is the feedback loop that tells TikTok which ad produced a sale, and it works today even when the ad opens WhatsApp instead of a TikTok DM. Credentials are stored, not validated here: the only way to test a TikTok token is to send an event, so run tiktok_test right after.", {
8
+ access_token: z
9
+ .string()
10
+ .describe("Events API access token, generated in TikTok Events Manager for the event set"),
11
+ event_set_id: z
12
+ .string()
13
+ .describe("Id of the CRM event set that conversions are reported to"),
14
+ }, async (args) => text(await client.post("/integrations/tiktok/credentials", args)));
15
+ server.tool("tiktok_config_update", "Set how conversions are reported to TikTok. `purchase_event_name` must match the event the client's campaign is optimised for, or TikTok receives the conversion and the campaign ignores it. Send `test_event_code` empty to LEAVE test mode and start reporting for real — that is the step people forget after validating. `enabled: false` keeps the account connected but stops automatic sending.", {
16
+ purchase_event_name: z
17
+ .string()
18
+ .optional()
19
+ .describe("Event name for a closed sale. Defaults to 'Purchase'."),
20
+ lead_event_name: z
21
+ .string()
22
+ .optional()
23
+ .describe("Event name for a lead. Defaults to 'SubmitForm'."),
24
+ test_event_code: z
25
+ .string()
26
+ .optional()
27
+ .describe("Test Events code. While set, every event lands in Test Events and counts as nothing. Send an empty string to clear it."),
28
+ enabled: z
29
+ .boolean()
30
+ .optional()
31
+ .describe("false pauses automatic reporting without disconnecting the account"),
32
+ }, async (args) => text(await client.put("/integrations/tiktok/config", args)));
33
+ server.tool("tiktok_test", "Send a fake event to TikTok Test Events to prove the token and event set actually work. The test event code is required on purpose: without it the probe would land as a real conversion and pollute the client's data. Watch it appear in Events Manager → Test Events.", {
34
+ test_event_code: z
35
+ .string()
36
+ .describe("Test Events code, copied from TikTok Events Manager"),
37
+ }, async (args) => text(await client.post("/integrations/tiktok/test", args)));
38
+ server.tool("tiktok_send_order_event", "Report one order to TikTok by hand. This is the backfill button for a sale that never reached TikTok (token expired, TikTok down, or the flow was not wired yet). Idempotent: an order already reported comes back with `skipped_duplicate: true` unless you pass `force`. Matching happens on the buyer's hashed phone and email, so an order whose contact is a WhatsApp username with no real number cannot be attributed and is rejected with that reason.", {
39
+ order_id: z.string().describe("Id of the order to report"),
40
+ event_name: z
41
+ .string()
42
+ .optional()
43
+ .describe("Override the configured event name for this one send"),
44
+ test_event_code: z
45
+ .string()
46
+ .optional()
47
+ .describe("Send this one to Test Events instead of production"),
48
+ force: z
49
+ .boolean()
50
+ .optional()
51
+ .describe("Re-send an order that was already reported"),
52
+ }, async (args) => {
53
+ const { order_id, ...body } = args;
54
+ return text(await client.post(`/integrations/tiktok/orders/${order_id}/event`, body));
55
+ });
56
+ server.tool("tiktok_disconnect", "Disconnect TikTok conversion reporting. Events already reported stay in TikTok; only the credentials are removed.", {}, async () => text(await client.delete("/integrations/tiktok/credentials")));
57
+ }
58
+ //# sourceMappingURL=tiktok.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tiktok.js","sourceRoot":"","sources":["../../src/tools/tiktok.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,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAqB;IAC1E,MAAM,CAAC,IAAI,CACT,eAAe,EACf,uSAAuS,EACvS,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAClE,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,gBAAgB,EAChB,mkBAAmkB,EACnkB;QACE,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,CAAC,+EAA+E,CAAC;QAC5F,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,CAAC,0DAA0D,CAAC;KACxE,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,IAAI,CAAC,CAAC,CAClF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,yYAAyY,EACzY;QACE,mBAAmB,EAAE,CAAC;aACnB,MAAM,EAAE;aACR,QAAQ,EAAE;a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,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,+BAA+B,QAAQ,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IACxF,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,mHAAmH,EACnH,EAAE,EACF,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAC1E,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mergeon-mcp",
3
- "version": "1.70.0",
3
+ "version": "1.79.0",
4
4
  "description": "MCP server for MergeOn Seller — manage your ecommerce CRM, orders, products, flows, calendar and more from Claude",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -442,6 +442,35 @@ Manda el evento Purchase a Meta Conversions API con el monto de la orden. Combí
442
442
 
443
443
  ---
444
444
 
445
+ ### `send_tiktok_event` — Notificar a TikTok Ads (compra) (solo con orden en contexto)
446
+ ```json
447
+ { "send_tiktok_event": "" }
448
+ // o con el nombre del evento al que está optimizada la campaña:
449
+ { "send_tiktok_event": { "event_name": "CompletePayment" } }
450
+ ```
451
+
452
+ Manda la compra a **TikTok Events API 2.0** con el monto del pedido. Es el equivalente de `send_order_event` para TikTok, y se pueden usar los dos en el mismo flow: son plataformas distintas y no se pisan.
453
+
454
+ **Lo que lo hace distinto de Meta:** TikTok empareja la conversión con el clic por el **teléfono y el correo del comprador** (hasheados con SHA-256), no por un click id. Por eso funciona HOY con Instant Messaging Ads que abren WhatsApp — no hace falta el canal de DMs de TikTok, que sigue en beta cerrada.
455
+
456
+ - Requiere TikTok conectado (`tiktok_connect`) con su Event Set ID de tipo CRM.
457
+ - Es idempotente: el mismo pedido no se reporta dos veces aunque el trigger corra de nuevo.
458
+ - Un pedido cuyo contacto no tenga teléfono real ni correo **no se puede atribuir** y la acción lo dice en el log en vez de mandar humo.
459
+ - Si el negocio dejó puesto el `test_event_code`, el evento va a Test Events y **no cuenta como conversión**.
460
+
461
+ ---
462
+
463
+ ### `send_tiktok_lead_event` — Notificar a TikTok Ads (lead) (con CRM en contexto)
464
+ ```json
465
+ { "send_tiktok_lead_event": "" }
466
+ // o con nombre de evento y valor estimado:
467
+ { "send_tiktok_lead_event": { "event_name": "Contact", "value": 50000 } }
468
+ ```
469
+
470
+ Para campañas de TikTok optimizadas a lead, donde la venta llega semanas después y lo que hay que retroalimentar es el contacto. Combínalo con `crm_created` (lead nuevo) o con `lead_status_change` (lead calificado).
471
+
472
+ ---
473
+
445
474
  ### `send_appointment_event` — Notificar a Meta CAPI (Schedule, Lead o Purchase) (solo con cita en contexto)
446
475
  ```json
447
476
  { "send_appointment_event": "" }
@@ -1044,6 +1073,8 @@ Pregunta al usuario:
1044
1073
  | Cambiar el estado del pedido automáticamente | `change_order_status` |
1045
1074
  | Trackear conversión en Meta Ads (Lead) | `send_lead_event` |
1046
1075
  | Trackear conversión en Meta Ads (Purchase) | `send_order_event` |
1076
+ | Trackear conversión en TikTok Ads (compra) | `send_tiktok_event` |
1077
+ | Trackear conversión en TikTok Ads (lead) | `send_tiktok_lead_event` |
1047
1078
  | Registrar en Google Sheets | `send_to_sheets` |
1048
1079
  | Repartir el contacto entre asesores | `assign_advisor` |
1049
1080
  | Avisar al asesor por WhatsApp (no al cliente) | `notify_advisor` |
@@ -1,78 +0,0 @@
1
- import { z } from "zod";
2
- function text(data) {
3
- return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
4
- }
5
- const kindEnum = z
6
- .enum(["bank", "wallet", "cash", "cod", "card", "gateway", "other"])
7
- .describe("Kind of collection: bank (bank account), wallet (Nequi/Daviplata), cash, cod (cash on delivery), card (POS terminal), gateway (payment link), other");
8
- export function registerPaymentMethodsTools(server, client) {
9
- server.tool("payment_methods_list", "List the payment methods this business accepts — the real accounts money is sent to (bank accounts, Nequi/Daviplata numbers, cash, cash on delivery). These fill the 'Pago' dropdown on every order and are what the AI agent quotes to a buyer who asks where to transfer. Use `include_inactive` to also see the ones that were turned off.", {
10
- include_inactive: z
11
- .boolean()
12
- .optional()
13
- .describe("Also return methods that are turned off. Default false."),
14
- }, async ({ include_inactive }) => text(await client.get(`/payment-methods${include_inactive ? "?include_inactive=true" : ""}`)));
15
- server.tool("payment_methods_create", "Add a payment method the business collects with. The account details are shown to the buyer, so write them exactly as they should be read out (account numbers keep their dashes and leading zeros). A business can have several accounts at the same bank — each one is its own method. Map `siigo_payment_type_id` when the business invoices in Siigo, so the invoice carries the right payment form without anyone fixing it by hand.", {
16
- display_name: z
17
- .string()
18
- .describe("Name the advisor and the buyer see. E.g. 'Bancolombia Ahorros'"),
19
- kind: kindEnum.optional(),
20
- bank_name: z.string().optional().describe("Bank or provider. E.g. 'Bancolombia'"),
21
- account_type: z.string().optional().describe("'ahorros' | 'corriente' | free text"),
22
- account_number: z
23
- .string()
24
- .optional()
25
- .describe("Account number, or the phone number for a wallet"),
26
- holder_name: z.string().optional().describe("Account holder"),
27
- holder_document: z.string().optional().describe("Holder's cédula or NIT"),
28
- holder_document_type: z.string().optional().describe("CC, NIT, CE…"),
29
- instructions: z
30
- .string()
31
- .optional()
32
- .describe("What the agent tells the buyer. Leave empty to have it built from the account details."),
33
- requires_reference: z
34
- .boolean()
35
- .optional()
36
- .describe("Demand a receipt number when an order is marked with this method. False for cash and cash on delivery."),
37
- siigo_payment_type_id: z
38
- .number()
39
- .nullable()
40
- .optional()
41
- .describe("Siigo payment type id (see siigo_catalogs)"),
42
- position: z.number().optional().describe("Order in the dropdown. Lower comes first."),
43
- active: z.boolean().optional().describe("Show it in the dropdown. Default true."),
44
- }, async (args) => text(await client.post("/payment-methods", args)));
45
- server.tool("payment_methods_update", "Change a payment method. Send only the fields to change. The slug cannot change because past orders point at it. Turning `active` off hides the method from new orders without touching history — prefer it over deleting.", {
46
- slug: z.string().describe("Method identifier, from payment_methods_list"),
47
- display_name: z.string().optional(),
48
- kind: kindEnum.optional(),
49
- bank_name: z.string().optional(),
50
- account_type: z.string().optional(),
51
- account_number: z.string().optional(),
52
- holder_name: z.string().optional(),
53
- holder_document: z.string().optional(),
54
- holder_document_type: z.string().optional(),
55
- instructions: z.string().optional(),
56
- requires_reference: z.boolean().optional(),
57
- siigo_payment_type_id: z.number().nullable().optional(),
58
- position: z.number().optional(),
59
- active: z.boolean().optional(),
60
- }, async ({ slug, ...changes }) => text(await client.patch(`/payment-methods/${slug}`, changes)));
61
- server.tool("payment_methods_delete", "Remove a payment method from the business's catalogue. Orders that already used it keep their own copy of the account details, so history stays intact. If the goal is just to stop offering it, use payment_methods_update with active:false instead.", { slug: z.string().describe("Method identifier") }, async ({ slug }) => text(await client.delete(`/payment-methods/${slug}`)));
62
- server.tool("orders_assign_payment", "Record which account an order was actually paid into. Stores a frozen copy of the account details on the order, so editing or deleting the method later never rewrites what happened. Pass `method_id: null` to clear it. Methods created with `requires_reference` refuse to be assigned without a receipt number or image.", {
63
- order_id: z.string().describe("Order id"),
64
- method_id: z
65
- .string()
66
- .nullable()
67
- .describe("Payment method slug. null clears the payment from the order."),
68
- reference: z.string().optional().describe("Transfer reference or receipt number"),
69
- receipt_url: z.string().optional().describe("Image or PDF of the receipt"),
70
- amount: z.number().optional().describe("Amount paid, if different from the order total"),
71
- paid_at: z.string().optional().describe("ISO 8601 date of the payment. Defaults to now."),
72
- mark_paid: z
73
- .boolean()
74
- .optional()
75
- .describe("Also flip the order to paid. Default false."),
76
- }, async ({ order_id, ...body }) => text(await client.put(`/orders/${order_id}/payment`, body)));
77
- }
78
- //# sourceMappingURL=payments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/tools/payments.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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C,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;QACjF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QAC1E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QACxF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QACzF,SAAS,EAAE,CAAC;aACT,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,6CAA6C,CAAC;KAC3D,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAC9B,IAAI,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,WAAW,QAAQ,UAAU,EAAE,IAAI,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { MergeOnClient } from "../client.js";
3
- export declare function registerIntegrationRolesTools(server: McpServer, client: MergeOnClient): void;
4
- export declare function registerSiigoTools(server: McpServer, client: MergeOnClient): void;
@@ -1,101 +0,0 @@
1
- import { z } from "zod";
2
- function text(data) {
3
- return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
4
- }
5
- export function registerIntegrationRolesTools(server, client) {
6
- server.tool("integration_roles_get", "See which connected integration does what for this business: who owns the catalogue, who issues invoices, and where orders are replicated. `resolved` is what the system is using right now; `explicit` is null for capabilities still on automatic (derived from the store type). `options` lists every choice and whether the business has that integration connected. Read this before blaming an integration for 'not doing anything' — it may simply not have that job.", {}, async () => text(await client.get("/integrations/roles")));
7
- server.tool("integration_roles_set", "Assign which integration does what. This is what lets a business keep Shopify as the catalogue (it has the photos and variants) while Siigo only issues invoices — the exact GetMoving setup. Send only the capabilities you want to change; the rest keep their value. Pass null to put one back on automatic. A provider the business has not connected is rejected, so invoicing never ends up pointing at credentials that do not exist.", {
8
- catalog: z
9
- .enum(["scratch", "shopify", "woocommerce", "siigo"])
10
- .nullable()
11
- .optional()
12
- .describe("Who owns products, prices and availability. 'scratch' means managed inside MergeOn. 'siigo' means Siigo is the source of truth and its products are synced into MergeOn (Siigo has no product photos, so the catalogue is not read live from it)."),
13
- invoicing: z
14
- .enum(["none", "siigo"])
15
- .nullable()
16
- .optional()
17
- .describe("Who issues the sales invoice. Independent of the catalogue on purpose. 'none' means nobody invoices."),
18
- orders: z
19
- .enum(["none", "shopify", "woocommerce", "dropi", "siigo"])
20
- .nullable()
21
- .optional()
22
- .describe("Where a closed order is replicated to. 'siigo' registers the sale in Siigo — it moves inventory and lands in the books WITHOUT being stamped to the DIAN, which is how a business stops paying Shopify's per-manual-order commission. Issuing the electronic invoice is a separate decision and lives in `invoicing`."),
23
- }, async (args) => text(await client.put("/integrations/roles", args)));
24
- }
25
- export function registerSiigoTools(server, client) {
26
- server.tool("siigo_status", "Check whether this business has Siigo connected and how it is configured (document type, seller, default payment form, whether invoices go to the DIAN). Never returns the access key. Start here before troubleshooting 'the invoice was not created'.", {}, async () => text(await client.get("/integrations/siigo/status")));
27
- server.tool("siigo_connect", "Connect this business's Siigo account. Needs only two values, both generated in Siigo Nube → Configuración → Alianzas e integraciones: the API user and the access key. The credentials are tested against Siigo BEFORE being stored, so a failure here means Siigo rejected them, not that saving failed.", {
28
- username: z.string().describe("Siigo API user (the email the credentials were issued for)"),
29
- access_key: z.string().describe("Siigo access key"),
30
- partner_id: z
31
- .string()
32
- .optional()
33
- .describe("Application name for the Partner-Id header. Defaults to 'MergeOn'. Only set it if Siigo assigned this client a specific one."),
34
- }, async (args) => text(await client.post("/integrations/siigo/credentials", args)));
35
- server.tool("siigo_catalogs", "List the internal ids of this business's Siigo account: document types, payment forms, sellers, inventory groups, taxes and warehouses. Siigo will not accept names on an invoice — only these ids — so this is what you read before calling siigo_config_update. Catalogs the account has no permission for come back empty with their error listed separately.", {}, async () => text(await client.get("/integrations/siigo/catalogs")));
36
- server.tool("siigo_config_update", "Set the Siigo account ids used for invoicing. `document_type_id` is the one that is mandatory — without it every invoice fails. Read the valid ids with siigo_catalogs first. Leave `send_to_dian` false while validating a new client: invoices stay as drafts inside Siigo so someone can check them before they are legally issued.", {
37
- document_type_id: z
38
- .number()
39
- .nullable()
40
- .optional()
41
- .describe("Sales invoice document type (FV). Required before any invoice can be created."),
42
- seller_id: z.number().nullable().optional().describe("Seller credited on the invoices"),
43
- default_payment_type_id: z
44
- .number()
45
- .nullable()
46
- .optional()
47
- .describe("Payment form used when the order's method has no Siigo mapping"),
48
- account_group: z
49
- .number()
50
- .nullable()
51
- .optional()
52
- .describe("Inventory group for products MergeOn pushes into Siigo"),
53
- default_tax_id: z.number().nullable().optional().describe("Default tax for new products"),
54
- generic_item_code: z
55
- .string()
56
- .optional()
57
- .describe("Product code used for invoice lines whose product does not exist in Siigo"),
58
- default_customer_identification: z
59
- .string()
60
- .optional()
61
- .describe("Default buyer document. Empty means final consumer (222222222222) — MergeOn never asks the buyer for a cédula in chat."),
62
- send_to_dian: z
63
- .boolean()
64
- .optional()
65
- .describe("Send invoices to the DIAN on creation. False leaves them as drafts in Siigo."),
66
- send_email_to_customer: z
67
- .boolean()
68
- .optional()
69
- .describe("Have Siigo email the invoice to the buyer"),
70
- }, async (args) => text(await client.put("/integrations/siigo/config", args)));
71
- server.tool("siigo_test", "Re-authenticate against Siigo and check each catalog the integration depends on. Run this the moment a client's real credentials arrive: if anything in Siigo's contract differs from what the integration assumes, it surfaces here instead of halfway through an invoice.", {}, async () => text(await client.post("/integrations/siigo/test", {})));
72
- server.tool("siigo_sync_products", "Pull this business's catalogue from Siigo into MergeOn, matching on the Siigo product code. Existing products only get name, price and availability refreshed — photos, sales descriptions and categories set in MergeOn are left alone, because Siigo has nothing to replace them with. Products that vanished from Siigo are marked unavailable rather than deleted, so past orders keep resolving. Run with `dry_run` first on a large catalogue.", {
73
- dry_run: z
74
- .boolean()
75
- .optional()
76
- .describe("Count what would be created and updated without writing anything"),
77
- }, async ({ dry_run }) => text(await client.post(`/integrations/siigo/sync-products?dry_run=${dry_run ? "true" : "false"}`, {})));
78
- server.tool("siigo_invoice_order", "Create the Siigo sales invoice for a MergeOn order. Safe to call twice: an order that already has an invoice returns the existing one instead of issuing a second. Pass `customer_identification` when the buyer asked for the invoice in their own name; otherwise it goes out to final consumer. Use `force` only to re-invoice an order whose first invoice was voided in Siigo.", {
79
- order_id: z.string().describe("MergeOn order id"),
80
- customer_identification: z
81
- .string()
82
- .optional()
83
- .describe("Buyer's cédula or NIT, if they want the invoice in their name"),
84
- customer_id_type: z
85
- .string()
86
- .optional()
87
- .describe("DIAN document type: 13 = cédula, 31 = NIT"),
88
- send_to_dian: z
89
- .boolean()
90
- .optional()
91
- .describe("Override the connection setting for this one invoice"),
92
- send_email: z.boolean().optional().describe("Have Siigo email this invoice to the buyer"),
93
- observations: z.string().optional().describe("Invoice notes"),
94
- force: z
95
- .boolean()
96
- .optional()
97
- .describe("Issue a new invoice even if the order already has one. Default false."),
98
- }, async ({ order_id, ...body }) => text(await client.post(`/integrations/siigo/orders/${order_id}/invoice`, body)));
99
- server.tool("siigo_disconnect", "Disconnect this business's Siigo account. The catalogue already synced stays in MergeOn; only the credentials and the cached token go away.", {}, async () => text(await client.delete("/integrations/siigo/credentials")));
100
- }
101
- //# sourceMappingURL=siigo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"siigo.js","sourceRoot":"","sources":["../../src/tools/siigo.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,C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