jotae-mcp 1.0.5 → 1.0.7
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 +39 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -139,11 +139,12 @@ const TOOLS = [
|
|
|
139
139
|
channel: { type: 'string', enum: ['whatsapp', 'email'] },
|
|
140
140
|
trigger: { type: 'string', enum: ['registration', 'event_start', 'event_end', 'attended', 'no_show', 'watched_pitch', 'clicked_cta', 'purchased', 'scheduled'] },
|
|
141
141
|
delay_minutes: { type: 'number', description: 'Minutos após o gatilho (negativo = antes)' },
|
|
142
|
-
template_id: { type: 'string', description: 'ID do template (WhatsApp ou e-mail — mesmo campo para ambos
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
template_id: { type: 'string', description: 'ID do template (WhatsApp ou e-mail — mesmo campo para ambos)' },
|
|
143
|
+
destination: { type: 'string', enum: ['individual', 'group'], description: 'WhatsApp: individual (padrão) ou group' },
|
|
144
|
+
group_id: { type: 'string', description: 'ID do grupo WhatsApp (quando destination=group)' },
|
|
145
|
+
scheduled_at: { type: 'string', description: 'ISO 8601 — obrigatório quando trigger=scheduled' },
|
|
146
|
+
audience_list_id: { type: 'string', description: 'ID da lista de destinatários (filtra quem recebe)' },
|
|
147
|
+
exclude_list_id: { type: 'string', description: 'ID da lista de exclusão (quem não recebe)' },
|
|
147
148
|
},
|
|
148
149
|
required: ['event_id', 'channel', 'trigger'],
|
|
149
150
|
},
|
|
@@ -156,9 +157,15 @@ const TOOLS = [
|
|
|
156
157
|
properties: {
|
|
157
158
|
automation_id: { type: 'string' },
|
|
158
159
|
label: { type: 'string' },
|
|
160
|
+
channel: { type: 'string', enum: ['whatsapp', 'email'] },
|
|
161
|
+
trigger: { type: 'string' },
|
|
159
162
|
delay_minutes: { type: 'number' },
|
|
160
|
-
|
|
163
|
+
template_id: { type: 'string' },
|
|
164
|
+
destination: { type: 'string', enum: ['individual', 'group'] },
|
|
165
|
+
group_id: { type: 'string' },
|
|
161
166
|
scheduled_at: { type: 'string' },
|
|
167
|
+
audience_list_id: { type: 'string' },
|
|
168
|
+
exclude_list_id: { type: 'string' },
|
|
162
169
|
active: { type: 'boolean' },
|
|
163
170
|
},
|
|
164
171
|
required: ['automation_id'],
|
|
@@ -210,6 +217,7 @@ const TOOLS = [
|
|
|
210
217
|
destination: { type: 'string', enum: ['individual', 'group'], description: 'Destino WhatsApp (padrão: individual)' },
|
|
211
218
|
media_url: { type: 'string', description: 'URL de mídia opcional (WhatsApp)' },
|
|
212
219
|
media_type: { type: 'string', enum: ['image', 'video', 'document'], description: 'Tipo de mídia (WhatsApp)' },
|
|
220
|
+
folder_id: { type: 'string', description: 'ID da pasta (use list_folders ou create_folder)' },
|
|
213
221
|
},
|
|
214
222
|
required: ['channel', 'name', 'body'],
|
|
215
223
|
},
|
|
@@ -232,6 +240,23 @@ const TOOLS = [
|
|
|
232
240
|
required: ['template_id'],
|
|
233
241
|
},
|
|
234
242
|
},
|
|
243
|
+
// ── Pastas de templates ──
|
|
244
|
+
{
|
|
245
|
+
name: 'list_folders',
|
|
246
|
+
description: 'Lista as pastas de templates criadas pelo produtor.',
|
|
247
|
+
inputSchema: { type: 'object', properties: {} },
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'create_folder',
|
|
251
|
+
description: 'Cria uma pasta para organizar templates. Retorna o folder_id para usar em create_template.',
|
|
252
|
+
inputSchema: {
|
|
253
|
+
type: 'object',
|
|
254
|
+
properties: {
|
|
255
|
+
name: { type: 'string', description: 'Nome da pasta (ex: "Aquecimento", "Pós-live")' },
|
|
256
|
+
},
|
|
257
|
+
required: ['name'],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
235
260
|
// ── Dados ──
|
|
236
261
|
{
|
|
237
262
|
name: 'list_contacts',
|
|
@@ -364,9 +389,9 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (req) => {
|
|
|
364
389
|
result = await api('GET', `/automations${a.event_id ? `?event_id=${a.event_id}` : ''}`);
|
|
365
390
|
break;
|
|
366
391
|
case 'create_automation': {
|
|
367
|
-
// broadcast_template_id não
|
|
392
|
+
// send_time e broadcast_template_id não existem na tabela whatsapp_automations
|
|
368
393
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
369
|
-
const { broadcast_template_id:
|
|
394
|
+
const { broadcast_template_id: _b, send_time: _s, ...autoBody } = a;
|
|
370
395
|
result = await api('POST', '/automations', autoBody);
|
|
371
396
|
break;
|
|
372
397
|
}
|
|
@@ -392,6 +417,12 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (req) => {
|
|
|
392
417
|
result = await api('PATCH', `/templates/${template_id}`, patch);
|
|
393
418
|
break;
|
|
394
419
|
}
|
|
420
|
+
case 'list_folders':
|
|
421
|
+
result = await api('GET', '/folders');
|
|
422
|
+
break;
|
|
423
|
+
case 'create_folder':
|
|
424
|
+
result = await api('POST', '/folders', { name: a.name });
|
|
425
|
+
break;
|
|
395
426
|
case 'list_contacts':
|
|
396
427
|
result = await api('GET', `/contacts?limit=${a.limit ?? 100}&offset=${a.offset ?? 0}`);
|
|
397
428
|
break;
|