jotae-mcp 1.0.1 → 1.0.3
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 +58 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -186,6 +186,53 @@ const TOOLS = [
|
|
|
186
186
|
},
|
|
187
187
|
},
|
|
188
188
|
},
|
|
189
|
+
{
|
|
190
|
+
name: 'get_template',
|
|
191
|
+
description: 'Retorna o conteúdo completo de um template (body, subject, mídia). Use para ler o que está escrito antes de editar.',
|
|
192
|
+
inputSchema: {
|
|
193
|
+
type: 'object',
|
|
194
|
+
properties: {
|
|
195
|
+
template_id: { type: 'string', description: 'ID do template' },
|
|
196
|
+
},
|
|
197
|
+
required: ['template_id'],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: 'create_template',
|
|
202
|
+
description: 'Cria um novo template de WhatsApp ou e-mail com conteúdo.',
|
|
203
|
+
inputSchema: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
properties: {
|
|
206
|
+
channel: { type: 'string', enum: ['whatsapp', 'email'], description: 'Canal do template' },
|
|
207
|
+
name: { type: 'string', description: 'Nome do template' },
|
|
208
|
+
body: { type: 'string', description: 'Corpo da mensagem. Use {{nome}}, {{evento}} como variáveis.' },
|
|
209
|
+
subject: { type: 'string', description: 'Assunto (só e-mail)' },
|
|
210
|
+
sender_name: { type: 'string', description: 'Nome do remetente (só e-mail)' },
|
|
211
|
+
destination: { type: 'string', enum: ['individual', 'group'], description: 'Destino WhatsApp (padrão: individual)' },
|
|
212
|
+
media_url: { type: 'string', description: 'URL de mídia opcional (WhatsApp)' },
|
|
213
|
+
media_type: { type: 'string', enum: ['image', 'video', 'document'], description: 'Tipo de mídia (WhatsApp)' },
|
|
214
|
+
},
|
|
215
|
+
required: ['channel', 'name', 'body'],
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'update_template',
|
|
220
|
+
description: 'Edita o conteúdo de um template existente. Passe apenas os campos que deseja alterar.',
|
|
221
|
+
inputSchema: {
|
|
222
|
+
type: 'object',
|
|
223
|
+
properties: {
|
|
224
|
+
template_id: { type: 'string', description: 'ID do template' },
|
|
225
|
+
name: { type: 'string' },
|
|
226
|
+
body: { type: 'string', description: 'Novo corpo da mensagem' },
|
|
227
|
+
subject: { type: 'string', description: 'Novo assunto (e-mail)' },
|
|
228
|
+
sender_name: { type: 'string', description: 'Nome do remetente (e-mail)' },
|
|
229
|
+
destination: { type: 'string', enum: ['individual', 'group'] },
|
|
230
|
+
media_url: { type: 'string' },
|
|
231
|
+
media_type: { type: 'string', enum: ['image', 'video', 'document'] },
|
|
232
|
+
},
|
|
233
|
+
required: ['template_id'],
|
|
234
|
+
},
|
|
235
|
+
},
|
|
189
236
|
// ── Dados ──
|
|
190
237
|
{
|
|
191
238
|
name: 'list_contacts',
|
|
@@ -331,6 +378,17 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (req) => {
|
|
|
331
378
|
case 'list_templates':
|
|
332
379
|
result = await api('GET', `/templates${a.channel ? `?channel=${a.channel}` : ''}`);
|
|
333
380
|
break;
|
|
381
|
+
case 'get_template':
|
|
382
|
+
result = await api('GET', `/templates/${a.template_id}`);
|
|
383
|
+
break;
|
|
384
|
+
case 'create_template':
|
|
385
|
+
result = await api('POST', '/templates', a);
|
|
386
|
+
break;
|
|
387
|
+
case 'update_template': {
|
|
388
|
+
const { template_id, ...patch } = a;
|
|
389
|
+
result = await api('PATCH', `/templates/${template_id}`, patch);
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
334
392
|
case 'list_contacts':
|
|
335
393
|
result = await api('GET', `/contacts?limit=${a.limit ?? 100}&offset=${a.offset ?? 0}`);
|
|
336
394
|
break;
|