@velaro/mcp-server 2.0.104 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +47 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/mcp-server",
3
- "version": "2.0.104",
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
@@ -865,6 +865,26 @@ const TOOLS = [
865
865
  },
866
866
 
867
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
+ },
868
888
  {
869
889
  name: 'conversation_list',
870
890
  description: 'List recent conversations. Returns id, status, phoneNumber, assignedUserId, teamId, createdAt.',
@@ -1682,6 +1702,11 @@ For multiSelect dynamic options: the variable named in dynamicOptionsVariable mu
1682
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.",
1683
1703
  inputSchema: { type: 'object', properties: { kind: { type: 'string', enum: ['agents', 'teams'] }, page: { type: 'number' }, pageSize: { type: 'number' } } },
1684
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
+ },
1685
1710
  {
1686
1711
  name: 'public_api_webhooks',
1687
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).",
@@ -5819,6 +5844,14 @@ async function handleTool(name, args) {
5819
5844
  case 'conversation_list':
5820
5845
  return await rpc('conversation_list', args);
5821
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`));
5822
5855
  case 'conversation_get':
5823
5856
  return await rpc('conversation_get', args);
5824
5857
 
@@ -6437,6 +6470,20 @@ reply: ${r?.reply}`;
6437
6470
  return JSON.stringify(r, null, 2);
6438
6471
  }
6439
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
+
6440
6487
  // /api/v1/webhooks -> PublicApiWriteController
6441
6488
  case 'public_api_webhooks': {
6442
6489
  const { action, url, events, id } = args || {};