@velaro/mcp-server 2.0.103 → 2.0.105
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/package.json +1 -1
- package/server.js +71 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velaro/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.105",
|
|
4
4
|
"description": "Velaro MCP server — connect Claude and other AI agents directly to your Velaro account: KB, workflows, bots, conversations, contacts, routing, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/server.js
CHANGED
|
@@ -604,6 +604,16 @@ const TOOLS = [
|
|
|
604
604
|
description: 'Restore a deleted KB topic.',
|
|
605
605
|
inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Topic ID' } }, required: ['id'] },
|
|
606
606
|
},
|
|
607
|
+
{
|
|
608
|
+
name: 'contact_notes_list',
|
|
609
|
+
description: 'List notes on a contact (newest first, paged).',
|
|
610
|
+
inputSchema: { type: 'object', properties: { id: { type: 'number' }, page: { type: 'number' }, pageSize: { type: 'number' } }, required: ['id'] },
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: 'contact_tag_remove',
|
|
614
|
+
description: 'Remove a tag from a contact.',
|
|
615
|
+
inputSchema: { type: 'object', properties: { id: { type: 'number' }, tagId: { type: 'number' } }, required: ['id', 'tagId'] },
|
|
616
|
+
},
|
|
607
617
|
{
|
|
608
618
|
name: 'contactsegment_list_deleted',
|
|
609
619
|
description: 'List recently deleted contact segments (restorable for 30 days).',
|
|
@@ -855,6 +865,26 @@ const TOOLS = [
|
|
|
855
865
|
},
|
|
856
866
|
|
|
857
867
|
// ── Conversations ─────────────────────────────────────────────────────────
|
|
868
|
+
{
|
|
869
|
+
name: 'conversation_action_send_message',
|
|
870
|
+
description: 'Send an agent message into a conversation (REST: POST /api/v1/conversations/{id}/messages). Requires write:conversations.',
|
|
871
|
+
inputSchema: { type: 'object', properties: { conversationId: { type: 'number' }, text: { type: 'string' }, agentId: { type: 'number', description: 'Optional agent to send as' } }, required: ['conversationId', 'text'] },
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
name: 'conversation_action_resolve',
|
|
875
|
+
description: 'Resolve (close) a conversation (REST: POST /api/v1/conversations/{id}/resolve). Requires write:conversations.',
|
|
876
|
+
inputSchema: { type: 'object', properties: { conversationId: { type: 'number' }, topic: { type: 'string' } }, required: ['conversationId'] },
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
name: 'conversation_action_assign',
|
|
880
|
+
description: 'Assign a conversation to an agent (REST: POST /api/v1/conversations/{id}/assign). Requires write:conversations.',
|
|
881
|
+
inputSchema: { type: 'object', properties: { conversationId: { type: 'number' }, agentId: { type: 'number' } }, required: ['conversationId', 'agentId'] },
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
name: 'conversation_action_notes',
|
|
885
|
+
description: 'List notes on a conversation (REST: GET /api/v1/conversations/{id}/notes). Requires read:conversations.',
|
|
886
|
+
inputSchema: { type: 'object', properties: { conversationId: { type: 'number' } }, required: ['conversationId'] },
|
|
887
|
+
},
|
|
858
888
|
{
|
|
859
889
|
name: 'conversation_list',
|
|
860
890
|
description: 'List recent conversations. Returns id, status, phoneNumber, assignedUserId, teamId, createdAt.',
|
|
@@ -1641,6 +1671,9 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
|
|
|
1641
1671
|
contactId: { type: 'number' }, email: { type: 'string' }, firstName: { type: 'string' }, lastName: { type: 'string' },
|
|
1642
1672
|
phone: { type: 'string' }, mobile: { type: 'string' }, company: { type: 'string' }, jobTitle: { type: 'string' },
|
|
1643
1673
|
tags: { type: 'array', items: { type: 'string' } },
|
|
1674
|
+
customFields: { type: 'object', description: 'Custom field values {name: value}. Unknown or invalid keys return an error naming the key; nothing is silently dropped.' },
|
|
1675
|
+
id: { type: 'number', description: 'Alias for contactId' },
|
|
1676
|
+
fields: { type: 'object', description: 'Optional object of core fields merged into the update' },
|
|
1644
1677
|
},
|
|
1645
1678
|
required: ['contactId'],
|
|
1646
1679
|
},
|
|
@@ -1669,6 +1702,11 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
|
|
|
1669
1702
|
description: "List the site's agents or teams through the public REST API (GET /api/v1/agents or /api/v1/teams, scope read:agents). Set kind to 'teams' for teams; default is agents.",
|
|
1670
1703
|
inputSchema: { type: 'object', properties: { kind: { type: 'string', enum: ['agents', 'teams'] }, page: { type: 'number' }, pageSize: { type: 'number' } } },
|
|
1671
1704
|
},
|
|
1705
|
+
{
|
|
1706
|
+
name: 'public_api_ops_lookup',
|
|
1707
|
+
description: "Operational lookups through the public REST API (api/v1). what=agent_availability (GET /agents/availability, optional teamId; scope read:agents), team (GET /teams/{id} with members; needs id; read:agents), webhook_events (GET /webhooks/events; read:webhooks) or webhook_test (POST /webhooks/{id}/test queues a signed test delivery; needs id; write:webhooks).",
|
|
1708
|
+
inputSchema: { type: 'object', properties: { what: { type: 'string', enum: ['agent_availability', 'team', 'webhook_events', 'webhook_test'] }, id: { type: 'number' }, teamId: { type: 'number' } }, required: ['what'] },
|
|
1709
|
+
},
|
|
1672
1710
|
{
|
|
1673
1711
|
name: 'public_api_webhooks',
|
|
1674
1712
|
description: "Manage outbound webhook subscriptions through the public REST API (/api/v1/webhooks). action=list (scope read:webhooks), create (needs url, optional events; returns the signing secret ONCE) or delete (needs id) (scope write:webhooks). Events: contact_tag_added, conversation_started, conversation_closed. Deliveries are signed with X-Velaro-Signature (HMAC-SHA256).",
|
|
@@ -5671,6 +5709,14 @@ async function handleTool(name, args) {
|
|
|
5671
5709
|
return rows.map(r => `#${r.id} ${r.name} (deleted ${r.deletedAt}, purges in ${r.daysUntilPurge} day(s))`).join('\n');
|
|
5672
5710
|
}
|
|
5673
5711
|
|
|
5712
|
+
case 'contact_notes_list': {
|
|
5713
|
+
const r = await api('GET', `/api/v1/contacts/${args.id}/notes?page=${args.page || 1}&pageSize=${args.pageSize || 50}`);
|
|
5714
|
+
return JSON.stringify(r, null, 2);
|
|
5715
|
+
}
|
|
5716
|
+
case 'contact_tag_remove': {
|
|
5717
|
+
await api('DELETE', `/api/v1/contacts/${args.id}/tags/${args.tagId}`);
|
|
5718
|
+
return `Removed tag #${args.tagId} from contact #${args.id}.`;
|
|
5719
|
+
}
|
|
5674
5720
|
case 'contactsegment_restore': {
|
|
5675
5721
|
await api('POST', `/ContactSegments/${args.id}/restore`);
|
|
5676
5722
|
return `Restored #${args.id}.`;
|
|
@@ -5798,6 +5844,14 @@ async function handleTool(name, args) {
|
|
|
5798
5844
|
case 'conversation_list':
|
|
5799
5845
|
return await rpc('conversation_list', args);
|
|
5800
5846
|
|
|
5847
|
+
case 'conversation_action_send_message':
|
|
5848
|
+
return JSON.stringify(await api('POST', `/api/v1/conversations/${Number(args.conversationId)}/messages`, { text: args.text, agentId: args.agentId }));
|
|
5849
|
+
case 'conversation_action_resolve':
|
|
5850
|
+
return JSON.stringify(await api('POST', `/api/v1/conversations/${Number(args.conversationId)}/resolve`, { topic: args.topic }));
|
|
5851
|
+
case 'conversation_action_assign':
|
|
5852
|
+
return JSON.stringify(await api('POST', `/api/v1/conversations/${Number(args.conversationId)}/assign`, { agentId: args.agentId }));
|
|
5853
|
+
case 'conversation_action_notes':
|
|
5854
|
+
return JSON.stringify(await api('GET', `/api/v1/conversations/${Number(args.conversationId)}/notes`));
|
|
5801
5855
|
case 'conversation_get':
|
|
5802
5856
|
return await rpc('conversation_get', args);
|
|
5803
5857
|
|
|
@@ -6378,7 +6432,9 @@ reply: ${r?.reply}`;
|
|
|
6378
6432
|
|
|
6379
6433
|
// PATCH api/v1/contacts/{id} -> PublicApiController.PatchContact
|
|
6380
6434
|
case 'contact_update': {
|
|
6381
|
-
const { contactId, ...
|
|
6435
|
+
const { contactId: cid, id: legacyId, fields, ...rest } = args || {};
|
|
6436
|
+
const contactId = cid ?? legacyId;
|
|
6437
|
+
const body = { ...(fields || {}), ...rest };
|
|
6382
6438
|
if (!contactId) return 'Error: contactId is required.';
|
|
6383
6439
|
const r = await api('PATCH', `/api/v1/contacts/${encodeURIComponent(contactId)}`, body);
|
|
6384
6440
|
return `Updated contact #${r.id} (${r.email})${r.tags?.length ? ' tags: ' + r.tags.join(', ') : ''}`;
|
|
@@ -6414,6 +6470,20 @@ reply: ${r?.reply}`;
|
|
|
6414
6470
|
return JSON.stringify(r, null, 2);
|
|
6415
6471
|
}
|
|
6416
6472
|
|
|
6473
|
+
// PublicApiOpsController: availability, team detail, webhook catalog and test
|
|
6474
|
+
case 'public_api_ops_lookup': {
|
|
6475
|
+
const { what, id, teamId } = args || {};
|
|
6476
|
+
if (what === 'agent_availability') return JSON.stringify(await api('GET', `/api/v1/agents/availability${teamId ? '?teamId=' + encodeURIComponent(teamId) : ''}`), null, 2);
|
|
6477
|
+
if (what === 'webhook_events') return JSON.stringify(await api('GET', '/api/v1/webhooks/events'), null, 2);
|
|
6478
|
+
if (what === 'team' || what === 'webhook_test') {
|
|
6479
|
+
if (!id) throw new Error('id is required for ' + what);
|
|
6480
|
+
return what === 'team'
|
|
6481
|
+
? JSON.stringify(await api('GET', `/api/v1/teams/${encodeURIComponent(id)}`), null, 2)
|
|
6482
|
+
: JSON.stringify(await api('POST', `/api/v1/webhooks/${encodeURIComponent(id)}/test`, {}), null, 2);
|
|
6483
|
+
}
|
|
6484
|
+
throw new Error('what must be agent_availability, team, webhook_events or webhook_test');
|
|
6485
|
+
}
|
|
6486
|
+
|
|
6417
6487
|
// /api/v1/webhooks -> PublicApiWriteController
|
|
6418
6488
|
case 'public_api_webhooks': {
|
|
6419
6489
|
const { action, url, events, id } = args || {};
|