@velaro/mcp-server 2.0.122 → 2.0.123

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/mcp-server",
3
- "version": "2.0.122",
3
+ "version": "2.0.123",
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": {
@@ -0,0 +1,37 @@
1
+ // velaro ticket-numbering (customer): ticket numbering per department (prefix, next number, increment).
2
+ // Site comes from the credential only; no siteId is ever passed. Parity module (CLI group -> MCP tools).
3
+
4
+ const pid = (v, n = 'teamId') => { const x = Number(v); if (!Number.isInteger(x) || x <= 0) throw new Error(n + ' must be a positive integer'); return x; };
5
+
6
+ export const tools = [
7
+ {
8
+ name: 'ticket_numbering_get',
9
+ description: 'Show how a department (team) numbers its tickets: prefix, next number, increment and an example of the next ticket number. A team with nothing set uses the site numbering.',
10
+ inputSchema: { type: 'object', properties: { teamId: { type: 'integer', description: 'Team (department) id' } }, required: ['teamId'] },
11
+ },
12
+ {
13
+ name: 'ticket_numbering_set',
14
+ description: 'Set ticket numbering for a department (team). Only the fields you pass change. New tickets get the prefix plus the next number; existing tickets keep their numbers. Pass reset true to go back to the site numbering.',
15
+ inputSchema: {
16
+ type: 'object',
17
+ properties: {
18
+ teamId: { type: 'integer', description: 'Team (department) id' },
19
+ prefix: { type: 'string', description: 'Prefix such as TK- (letters, numbers and - _ / . # only, up to 16). Blank means the default TK-.' },
20
+ nextNumber: { type: 'integer', description: 'The number the next ticket gets (1 or more)' },
21
+ increment: { type: 'integer', description: 'How much the number grows after each ticket (1 or more)' },
22
+ reset: { type: 'boolean', description: 'Clear all three settings and use the site numbering' },
23
+ },
24
+ required: ['teamId'],
25
+ },
26
+ },
27
+ ];
28
+
29
+ export const handlers = {
30
+ ticket_numbering_get: async (a, ctx) => ctx.messagingGet('/Teams/' + pid(a.teamId) + '/ticket-numbering'),
31
+ ticket_numbering_set: async (a, ctx) => {
32
+ const body = {};
33
+ for (const k of ['prefix', 'nextNumber', 'increment', 'reset']) if (a[k] !== undefined) body[k] = a[k];
34
+ if (!Object.keys(body).length) throw new Error('Pass at least one of prefix, nextNumber, increment or reset.');
35
+ return ctx.messagingPut('/Teams/' + pid(a.teamId) + '/ticket-numbering', body);
36
+ },
37
+ };