@trustpager/mcp-server 1.0.0 → 1.1.1

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 (84) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +3 -103
  3. package/dist/index.js.map +1 -1
  4. package/dist/server.d.ts +57 -0
  5. package/dist/server.d.ts.map +1 -0
  6. package/dist/server.js +152 -0
  7. package/dist/server.js.map +1 -0
  8. package/dist/tools/activities.d.ts.map +1 -1
  9. package/dist/tools/activities.js +18 -5
  10. package/dist/tools/activities.js.map +1 -1
  11. package/dist/tools/ai.js +5 -5
  12. package/dist/tools/ai.js.map +1 -1
  13. package/dist/tools/automations.d.ts.map +1 -1
  14. package/dist/tools/automations.js +130 -12
  15. package/dist/tools/automations.js.map +1 -1
  16. package/dist/tools/communications.d.ts.map +1 -1
  17. package/dist/tools/communications.js +279 -8
  18. package/dist/tools/communications.js.map +1 -1
  19. package/dist/tools/contacts.d.ts.map +1 -1
  20. package/dist/tools/contacts.js +89 -8
  21. package/dist/tools/contacts.js.map +1 -1
  22. package/dist/tools/crm-templates.d.ts +7 -0
  23. package/dist/tools/crm-templates.d.ts.map +1 -0
  24. package/dist/tools/crm-templates.js +102 -0
  25. package/dist/tools/crm-templates.js.map +1 -0
  26. package/dist/tools/customers.d.ts.map +1 -1
  27. package/dist/tools/customers.js +43 -9
  28. package/dist/tools/customers.js.map +1 -1
  29. package/dist/tools/deals.d.ts.map +1 -1
  30. package/dist/tools/deals.js +101 -14
  31. package/dist/tools/deals.js.map +1 -1
  32. package/dist/tools/documents.d.ts.map +1 -1
  33. package/dist/tools/documents.js +78 -9
  34. package/dist/tools/documents.js.map +1 -1
  35. package/dist/tools/event-queues.d.ts +7 -0
  36. package/dist/tools/event-queues.d.ts.map +1 -0
  37. package/dist/tools/event-queues.js +142 -0
  38. package/dist/tools/event-queues.js.map +1 -0
  39. package/dist/tools/files.d.ts +7 -0
  40. package/dist/tools/files.d.ts.map +1 -0
  41. package/dist/tools/files.js +182 -0
  42. package/dist/tools/files.js.map +1 -0
  43. package/dist/tools/forms.d.ts.map +1 -1
  44. package/dist/tools/forms.js +74 -9
  45. package/dist/tools/forms.js.map +1 -1
  46. package/dist/tools/notepads.d.ts +7 -0
  47. package/dist/tools/notepads.d.ts.map +1 -0
  48. package/dist/tools/notepads.js +119 -0
  49. package/dist/tools/notepads.js.map +1 -0
  50. package/dist/tools/order-forms.d.ts +7 -0
  51. package/dist/tools/order-forms.d.ts.map +1 -0
  52. package/dist/tools/order-forms.js +127 -0
  53. package/dist/tools/order-forms.js.map +1 -0
  54. package/dist/tools/pipelines.js +6 -6
  55. package/dist/tools/pipelines.js.map +1 -1
  56. package/dist/tools/platform.d.ts.map +1 -1
  57. package/dist/tools/platform.js +45 -12
  58. package/dist/tools/platform.js.map +1 -1
  59. package/dist/tools/products.js +5 -5
  60. package/dist/tools/products.js.map +1 -1
  61. package/dist/tools/supplier-products.d.ts +7 -0
  62. package/dist/tools/supplier-products.d.ts.map +1 -0
  63. package/dist/tools/supplier-products.js +119 -0
  64. package/dist/tools/supplier-products.js.map +1 -0
  65. package/dist/tools/tasks.d.ts.map +1 -1
  66. package/dist/tools/tasks.js +19 -6
  67. package/dist/tools/tasks.js.map +1 -1
  68. package/dist/tools/text-agents.d.ts +7 -0
  69. package/dist/tools/text-agents.d.ts.map +1 -0
  70. package/dist/tools/text-agents.js +90 -0
  71. package/dist/tools/text-agents.js.map +1 -0
  72. package/dist/tools/transcripts.d.ts +7 -0
  73. package/dist/tools/transcripts.d.ts.map +1 -0
  74. package/dist/tools/transcripts.js +83 -0
  75. package/dist/tools/transcripts.js.map +1 -0
  76. package/dist/tools/webhooks.d.ts +7 -0
  77. package/dist/tools/webhooks.d.ts.map +1 -0
  78. package/dist/tools/webhooks.js +237 -0
  79. package/dist/tools/webhooks.js.map +1 -0
  80. package/dist/tools/work-orders.d.ts +7 -0
  81. package/dist/tools/work-orders.d.ts.map +1 -0
  82. package/dist/tools/work-orders.js +99 -0
  83. package/dist/tools/work-orders.js.map +1 -0
  84. package/package.json +3 -2
@@ -2,7 +2,7 @@ import { apiRequest, formatResponse, buildQuery, generateIdempotencyKey } from '
2
2
  export const automationTools = [
3
3
  {
4
4
  name: 'list_automations',
5
- description: 'List all automations with optional filters.',
5
+ description: 'List all automations browse, view, or get all workflows, rules, triggers, and sequences. Filter by enabled status. Use this to see automation rules, find active workflows, or check configured triggers.',
6
6
  inputSchema: {
7
7
  type: 'object',
8
8
  properties: {
@@ -14,7 +14,7 @@ export const automationTools = [
14
14
  },
15
15
  {
16
16
  name: 'get_automation',
17
- description: 'Get a single automation by ID with its triggers and actions inline.',
17
+ description: 'Get a single automation by ID with full details including triggers and actions inline. Returns workflow name, trigger type, conditions, and action sequence.',
18
18
  inputSchema: {
19
19
  type: 'object',
20
20
  properties: {
@@ -25,7 +25,7 @@ export const automationTools = [
25
25
  },
26
26
  {
27
27
  name: 'create_automation',
28
- description: 'Create a new automation.',
28
+ description: 'Create a new automation workflow with a trigger type and optional conditions. Use this to set up automated rules, sequences, or event-driven actions like sending emails on stage changes.',
29
29
  inputSchema: {
30
30
  type: 'object',
31
31
  properties: {
@@ -44,7 +44,7 @@ export const automationTools = [
44
44
  },
45
45
  {
46
46
  name: 'update_automation',
47
- description: 'Update an existing automation. Only include fields you want to change.',
47
+ description: 'Update an existing automation workflow. Only include fields you want to change. Can modify name, description, conditions, enabled status, and CRM integration config.',
48
48
  inputSchema: {
49
49
  type: 'object',
50
50
  properties: {
@@ -60,7 +60,7 @@ export const automationTools = [
60
60
  },
61
61
  {
62
62
  name: 'delete_automation',
63
- description: 'Permanently delete an automation.',
63
+ description: 'Permanently delete an automation workflow and all its triggers and actions. This action cannot be undone.',
64
64
  inputSchema: {
65
65
  type: 'object',
66
66
  properties: { id: { type: 'string', description: 'Automation UUID' } },
@@ -69,7 +69,7 @@ export const automationTools = [
69
69
  },
70
70
  {
71
71
  name: 'enable_automation',
72
- description: 'Enable an automation so it runs when triggered.',
72
+ description: 'Enable an automation so it actively runs when triggered. The automation will start processing events and executing its action sequence.',
73
73
  inputSchema: {
74
74
  type: 'object',
75
75
  properties: { id: { type: 'string', description: 'Automation UUID' } },
@@ -78,7 +78,7 @@ export const automationTools = [
78
78
  },
79
79
  {
80
80
  name: 'disable_automation',
81
- description: 'Disable an automation so it stops running.',
81
+ description: 'Disable an automation so it stops running. The automation will no longer process events or execute actions until re-enabled.',
82
82
  inputSchema: {
83
83
  type: 'object',
84
84
  properties: { id: { type: 'string', description: 'Automation UUID' } },
@@ -87,7 +87,7 @@ export const automationTools = [
87
87
  },
88
88
  {
89
89
  name: 'add_automation_trigger',
90
- description: 'Add a trigger to an automation.',
90
+ description: 'Add a trigger to an automation — define what event starts the workflow. Source types include pipeline stages, forms, phone numbers, websites, and webhooks.',
91
91
  inputSchema: {
92
92
  type: 'object',
93
93
  properties: {
@@ -101,7 +101,7 @@ export const automationTools = [
101
101
  },
102
102
  {
103
103
  name: 'add_automation_action',
104
- description: 'Add an action to an automation.',
104
+ description: 'Add an action step to an automation sequence. Action types include send_custom_email, send_sms, trigger_voice_call, add_tasks, create_lead, call_webhook, and more.',
105
105
  inputSchema: {
106
106
  type: 'object',
107
107
  properties: {
@@ -111,7 +111,10 @@ export const automationTools = [
111
111
  description: 'Action type (required). Examples: send_custom_email, send_sms, trigger_voice_call, add_tasks, create_lead, call_webhook',
112
112
  },
113
113
  sequence: { type: 'number', description: 'Execution order (required, starts at 1)' },
114
- config: { type: 'object', description: 'Action configuration (JSON)' },
114
+ config: {
115
+ type: 'object',
116
+ description: 'Action configuration (JSON). Required fields vary by action_type:\n\nsend_custom_email: { greeting, customMessage, showReplyButton?, recipient_target?, use_contact_email?, replyEmail? } — email_config_id is auto-resolved from company default if omitted. Content supports {{variable}} placeholders (e.g. {{contact.first_name}}, {{company_name}}).\nsend_sms: { phone_number_id, message_body, to_number_source? }\ntrigger_voice_call: { voice_agent_id, from_number? }\nadd_tasks: { tasks: [{ title, category?, due_offset_days? }] }\ncall_webhook: { url, method?, include_trigger_data? }\ncreate_lead: { pipeline_id, stage_id, create_deal? }',
117
+ },
115
118
  integration_id: { type: 'string', description: 'Integration UUID for integration-based actions' },
116
119
  },
117
120
  required: ['id', 'action_type', 'sequence'],
@@ -119,7 +122,7 @@ export const automationTools = [
119
122
  },
120
123
  {
121
124
  name: 'list_automation_runs',
122
- description: 'List execution runs for an automation with status and timestamps.',
125
+ description: 'List execution history and run logs for an automation. Shows each run with status (completed, failed, running), timestamps, and trigger data. Use this to check if an automation fired or debug failures.',
123
126
  inputSchema: {
124
127
  type: 'object',
125
128
  properties: {
@@ -132,7 +135,7 @@ export const automationTools = [
132
135
  },
133
136
  {
134
137
  name: 'trigger_automation',
135
- description: 'Manually trigger an automation. Costs 5 credits.',
138
+ description: 'Manually trigger an automation to execute immediately, bypassing normal trigger conditions. Costs 5 credits. Use this to test a workflow or force-run an automation on demand.',
136
139
  inputSchema: {
137
140
  type: 'object',
138
141
  properties: {
@@ -142,6 +145,98 @@ export const automationTools = [
142
145
  required: ['id'],
143
146
  },
144
147
  },
148
+ {
149
+ name: 'list_automation_actions',
150
+ description: 'List all action steps in an automation, ordered by execution sequence. Returns each action type, config, and sequence number. Use this to see the full action chain of a workflow.',
151
+ inputSchema: {
152
+ type: 'object',
153
+ properties: {
154
+ automation_id: { type: 'string', description: 'Automation UUID' },
155
+ },
156
+ required: ['automation_id'],
157
+ },
158
+ },
159
+ {
160
+ name: 'update_automation_action',
161
+ description: "Update an automation action step — change its type, execution order, config, or integration. Only include fields you want to change.",
162
+ inputSchema: {
163
+ type: 'object',
164
+ properties: {
165
+ automation_id: { type: 'string', description: 'Automation UUID' },
166
+ action_id: { type: 'string', description: 'Action UUID' },
167
+ action_type: { type: 'string', description: 'New action type' },
168
+ sequence: { type: 'number', description: 'New execution order' },
169
+ config: {
170
+ type: 'object',
171
+ description: 'New action configuration (JSON). See add_automation_action for required fields per action_type.',
172
+ },
173
+ integration_id: { type: 'string', description: 'Integration UUID for integration-based actions' },
174
+ },
175
+ required: ['automation_id', 'action_id'],
176
+ },
177
+ },
178
+ {
179
+ name: 'delete_automation_action',
180
+ description: 'Remove an action step from an automation sequence. This action cannot be undone.',
181
+ inputSchema: {
182
+ type: 'object',
183
+ properties: {
184
+ automation_id: { type: 'string', description: 'Automation UUID' },
185
+ action_id: { type: 'string', description: 'Action UUID' },
186
+ },
187
+ required: ['automation_id', 'action_id'],
188
+ },
189
+ },
190
+ {
191
+ name: 'update_automation_trigger',
192
+ description: 'Update an automation trigger — change the event source, source ID, or trigger configuration. Only include fields you want to change.',
193
+ inputSchema: {
194
+ type: 'object',
195
+ properties: {
196
+ automation_id: { type: 'string', description: 'Automation UUID' },
197
+ trigger_id: { type: 'string', description: 'Trigger UUID' },
198
+ source_type: { type: 'string', description: 'New trigger source type' },
199
+ source_id: { type: 'string', description: 'New trigger source ID' },
200
+ config: { type: 'object', description: 'New trigger configuration (JSON)' },
201
+ },
202
+ required: ['automation_id', 'trigger_id'],
203
+ },
204
+ },
205
+ {
206
+ name: 'delete_automation_trigger',
207
+ description: 'Remove a trigger from an automation. The automation will no longer fire from this event source.',
208
+ inputSchema: {
209
+ type: 'object',
210
+ properties: {
211
+ automation_id: { type: 'string', description: 'Automation UUID' },
212
+ trigger_id: { type: 'string', description: 'Trigger UUID' },
213
+ },
214
+ required: ['automation_id', 'trigger_id'],
215
+ },
216
+ },
217
+ {
218
+ name: 'reorder_automation_actions',
219
+ description: 'Reorder action steps in an automation — set the execution sequence by providing an ordered array of action IDs.',
220
+ inputSchema: {
221
+ type: 'object',
222
+ properties: {
223
+ automation_id: { type: 'string', description: 'Automation UUID' },
224
+ action_ids: { type: 'array', items: { type: 'string' }, description: 'Ordered array of action UUIDs' },
225
+ },
226
+ required: ['automation_id', 'action_ids'],
227
+ },
228
+ },
229
+ {
230
+ name: 'get_automation_run',
231
+ description: 'Get details of a specific automation run including action results, errors, status per step, and execution timestamps. Use this to debug why an automation failed or see what each action did.',
232
+ inputSchema: {
233
+ type: 'object',
234
+ properties: {
235
+ run_id: { type: 'string', description: 'Run UUID' },
236
+ },
237
+ required: ['run_id'],
238
+ },
239
+ },
145
240
  ];
146
241
  export async function handleAutomationTool(name, args) {
147
242
  switch (name) {
@@ -183,6 +278,29 @@ export async function handleAutomationTool(name, args) {
183
278
  const body = args.trigger_data ? { trigger_data: args.trigger_data } : undefined;
184
279
  return formatResponse(await apiRequest('POST', `/automations/${args.id}/trigger`, body, generateIdempotencyKey()));
185
280
  }
281
+ case 'list_automation_actions': {
282
+ return formatResponse(await apiRequest('GET', `/automations/${args.automation_id}/actions`));
283
+ }
284
+ case 'update_automation_action': {
285
+ const { automation_id, action_id, ...body } = args;
286
+ return formatResponse(await apiRequest('PATCH', `/automations/${automation_id}/actions/${action_id}`, body));
287
+ }
288
+ case 'delete_automation_action': {
289
+ return formatResponse(await apiRequest('DELETE', `/automations/${args.automation_id}/actions/${args.action_id}`));
290
+ }
291
+ case 'update_automation_trigger': {
292
+ const { automation_id, trigger_id, ...body } = args;
293
+ return formatResponse(await apiRequest('PATCH', `/automations/${automation_id}/triggers/${trigger_id}`, body));
294
+ }
295
+ case 'delete_automation_trigger': {
296
+ return formatResponse(await apiRequest('DELETE', `/automations/${args.automation_id}/triggers/${args.trigger_id}`));
297
+ }
298
+ case 'reorder_automation_actions': {
299
+ return formatResponse(await apiRequest('POST', `/automations/${args.automation_id}/actions/reorder`, { action_ids: args.action_ids }, generateIdempotencyKey()));
300
+ }
301
+ case 'get_automation_run': {
302
+ return formatResponse(await apiRequest('GET', `/automations/runs/${args.run_id}`));
303
+ }
186
304
  default:
187
305
  return { text: `Unknown automation tool: ${name}`, isError: true };
188
306
  }
@@ -1 +1 @@
1
- {"version":3,"file":"automations.js","sourceRoot":"","sources":["../../src/tools/automations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAExG,MAAM,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":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,kBAAkB,EAAE,IAAI,EAyFpC,CAAC;AAEF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;GAgDxF"}
1
+ {"version":3,"file":"communications.d.ts","sourceRoot":"","sources":["../../src/tools/communications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,kBAAkB,EAAE,IAAI,EA8RpC,CAAC;AAEF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;GA0HxF"}
@@ -2,7 +2,7 @@ import { apiRequest, formatResponse, buildQuery, generateIdempotencyKey } from '
2
2
  export const communicationTools = [
3
3
  {
4
4
  name: 'send_email',
5
- description: 'Send an email. Costs 3 credits.',
5
+ description: 'Send an email to a recipient with HTML body content. Costs 3 credits. Can link to a contact and deal for CRM tracking. Requires html_body (not plain text).',
6
6
  inputSchema: {
7
7
  type: 'object',
8
8
  properties: {
@@ -18,7 +18,7 @@ export const communicationTools = [
18
18
  },
19
19
  {
20
20
  name: 'send_sms',
21
- description: 'Send an SMS. Costs 2 credits.',
21
+ description: 'Send an SMS text message to a phone number. Costs 2 credits. Requires a phone_number_id (use list_phone_numbers to find available sender numbers). Phone must be in E.164 format.',
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -31,7 +31,7 @@ export const communicationTools = [
31
31
  },
32
32
  {
33
33
  name: 'list_email_threads',
34
- description: 'List email threads with optional pagination.',
34
+ description: 'List all email threads browse, view, or get all email conversations, inbox messages, and sent emails. Use this to see email history or find a conversation.',
35
35
  inputSchema: {
36
36
  type: 'object',
37
37
  properties: {
@@ -42,7 +42,7 @@ export const communicationTools = [
42
42
  },
43
43
  {
44
44
  name: 'get_email_thread',
45
- description: 'Get a single email thread by ID with all messages.',
45
+ description: 'Get a single email thread by ID with all messages in the conversation, including sender, recipient, subject, body, and timestamps.',
46
46
  inputSchema: {
47
47
  type: 'object',
48
48
  properties: {
@@ -53,7 +53,7 @@ export const communicationTools = [
53
53
  },
54
54
  {
55
55
  name: 'list_sms_conversations',
56
- description: 'List SMS conversations.',
56
+ description: 'List all SMS conversations — browse, view, or get all text message threads and SMS chats. Use this to see SMS history or find a text conversation.',
57
57
  inputSchema: {
58
58
  type: 'object',
59
59
  properties: {},
@@ -61,7 +61,7 @@ export const communicationTools = [
61
61
  },
62
62
  {
63
63
  name: 'list_phone_numbers',
64
- description: 'List phone numbers configured for the company.',
64
+ description: 'List all phone numbers — browse, view, or get all configured phone lines, telephony numbers, and their capabilities. Use this to find a phone_number_id for sending SMS or making calls.',
65
65
  inputSchema: {
66
66
  type: 'object',
67
67
  properties: {},
@@ -69,15 +69,26 @@ export const communicationTools = [
69
69
  },
70
70
  {
71
71
  name: 'list_voice_agents',
72
- description: 'List AI voice agents configured for the company.',
72
+ description: 'List all AI voice agents — browse, view, or get all voice bots, AI call agents, and phone agents configured for the company.',
73
73
  inputSchema: {
74
74
  type: 'object',
75
75
  properties: {},
76
76
  },
77
77
  },
78
+ {
79
+ name: 'get_voice_agent',
80
+ description: 'Get a single voice agent by ID with full configuration including prompt, knowledge base, voice settings, and assigned phone number.',
81
+ inputSchema: {
82
+ type: 'object',
83
+ properties: {
84
+ id: { type: 'string', description: 'Voice agent UUID' },
85
+ },
86
+ required: ['id'],
87
+ },
88
+ },
78
89
  {
79
90
  name: 'initiate_voice_call',
80
- description: 'Initiate an AI voice call. Costs 10 credits.',
91
+ description: 'Initiate an outbound AI voice call using a voice agent. Costs 10 credits. The AI agent will call the specified number and handle the conversation autonomously.',
81
92
  inputSchema: {
82
93
  type: 'object',
83
94
  properties: {
@@ -88,6 +99,192 @@ export const communicationTools = [
88
99
  required: ['agentId', 'to_number'],
89
100
  },
90
101
  },
102
+ {
103
+ name: 'reply_to_email',
104
+ description: 'Reply to an existing email thread with HTML body content. Costs 3 credits. Maintains the conversation thread for proper email threading.',
105
+ inputSchema: {
106
+ type: 'object',
107
+ properties: {
108
+ thread_id: { type: 'string', description: 'Email thread UUID (required)' },
109
+ html_body: { type: 'string', description: 'Reply body as HTML (required)' },
110
+ subject: { type: 'string', description: 'Override subject line' },
111
+ },
112
+ required: ['thread_id', 'html_body'],
113
+ },
114
+ },
115
+ {
116
+ name: 'list_email_configs',
117
+ description: 'List all email configs — browse, view, or get all email sending settings, SMTP configurations, Postmark identities, and branding. Use this to see configured email senders.',
118
+ inputSchema: {
119
+ type: 'object',
120
+ properties: {},
121
+ },
122
+ },
123
+ {
124
+ name: 'get_email_config',
125
+ description: 'Get a single email config by ID with full details including sending identity (from_email, from_name), branding (logo, colors), staff notifications, and CRM auto-deal settings.',
126
+ inputSchema: {
127
+ type: 'object',
128
+ properties: {
129
+ id: { type: 'string', description: 'Email config UUID (required)' },
130
+ },
131
+ required: ['id'],
132
+ },
133
+ },
134
+ {
135
+ name: 'create_email_config',
136
+ description: 'Create an email sending configuration with sender identity, branding, notification settings, and optional CRM auto-deal creation. Links to a website for contextual sending.',
137
+ inputSchema: {
138
+ type: 'object',
139
+ properties: {
140
+ from_email: { type: 'string', description: 'Sender email address (required)' },
141
+ from_name: { type: 'string', description: 'Sender display name (required)' },
142
+ staff_email: { type: 'string', description: 'Staff notification email (required)' },
143
+ website_id: { type: 'string', description: 'Website UUID to link to' },
144
+ is_default: { type: 'boolean', description: 'Set as default email config' },
145
+ logo_url: { type: 'string', description: 'Logo URL for email branding' },
146
+ primary_color: { type: 'string', description: 'Primary brand colour hex code' },
147
+ secondary_color: { type: 'string', description: 'Secondary brand colour hex code' },
148
+ send_to_user: { type: 'boolean', description: 'Send confirmation email to user' },
149
+ send_to_staff: { type: 'boolean', description: 'Send notification email to staff' },
150
+ crm_auto_create_deal: { type: 'boolean', description: 'Auto-create a CRM deal on email' },
151
+ crm_pipeline_id: { type: 'string', description: 'Pipeline UUID for auto-created deals' },
152
+ crm_initial_stage_id: { type: 'string', description: 'Initial stage UUID for auto-created deals' },
153
+ },
154
+ required: ['from_email', 'from_name', 'staff_email'],
155
+ },
156
+ },
157
+ {
158
+ name: 'update_email_config',
159
+ description: 'Update an email sending configuration. Only include fields you want to change. Can modify sender identity, branding, notifications, and CRM settings.',
160
+ inputSchema: {
161
+ type: 'object',
162
+ properties: {
163
+ id: { type: 'string', description: 'Email config UUID (required)' },
164
+ from_email: { type: 'string', description: 'Sender email address' },
165
+ from_name: { type: 'string', description: 'Sender display name' },
166
+ staff_email: { type: 'string', description: 'Staff notification email' },
167
+ website_id: { type: 'string', description: 'Website UUID to link to' },
168
+ is_default: { type: 'boolean', description: 'Set as default email config' },
169
+ logo_url: { type: 'string', description: 'Logo URL for email branding' },
170
+ primary_color: { type: 'string', description: 'Primary brand colour hex code' },
171
+ secondary_color: { type: 'string', description: 'Secondary brand colour hex code' },
172
+ send_to_user: { type: 'boolean', description: 'Send confirmation email to user' },
173
+ send_to_staff: { type: 'boolean', description: 'Send notification email to staff' },
174
+ crm_auto_create_deal: { type: 'boolean', description: 'Auto-create a CRM deal on email' },
175
+ crm_pipeline_id: { type: 'string', description: 'Pipeline UUID for auto-created deals' },
176
+ crm_initial_stage_id: { type: 'string', description: 'Initial stage UUID for auto-created deals' },
177
+ },
178
+ required: ['id'],
179
+ },
180
+ },
181
+ {
182
+ name: 'delete_email_config',
183
+ description: 'Permanently delete an email sending configuration. This action cannot be undone.',
184
+ inputSchema: {
185
+ type: 'object',
186
+ properties: {
187
+ id: { type: 'string', description: 'Email config UUID (required)' },
188
+ },
189
+ required: ['id'],
190
+ },
191
+ },
192
+ {
193
+ name: 'list_email_logs',
194
+ description: 'List email send history — browse, view, or get email delivery logs with status (sent, delivered, bounced, failed). Filter by status, contact, or deal.',
195
+ inputSchema: {
196
+ type: 'object',
197
+ properties: {
198
+ limit: { type: 'number', description: 'Items per page (default 25, max 100)' },
199
+ after: { type: 'string', description: 'Cursor: get items after this ID' },
200
+ status: { type: 'string', description: 'Filter by status' },
201
+ contact_id: { type: 'string', description: 'Filter by contact UUID' },
202
+ deal_id: { type: 'string', description: 'Filter by deal UUID' },
203
+ },
204
+ },
205
+ },
206
+ {
207
+ name: 'get_sms_conversation',
208
+ description: 'Get a single SMS conversation by ID with message history, contact info, and phone number details.',
209
+ inputSchema: {
210
+ type: 'object',
211
+ properties: {
212
+ id: { type: 'string', description: 'SMS conversation UUID (required)' },
213
+ },
214
+ required: ['id'],
215
+ },
216
+ },
217
+ {
218
+ name: 'get_sms_messages',
219
+ description: 'Get all messages in an SMS conversation — view the full text message history with timestamps, direction (inbound/outbound), and delivery status.',
220
+ inputSchema: {
221
+ type: 'object',
222
+ properties: {
223
+ conversation_id: { type: 'string', description: 'SMS conversation UUID (required)' },
224
+ },
225
+ required: ['conversation_id'],
226
+ },
227
+ },
228
+ {
229
+ name: 'search_phone_numbers',
230
+ description: 'Search for available phone numbers to purchase — find numbers by country (AU, US), area code, or pattern. Use this before buy_phone_number to see what is available.',
231
+ inputSchema: {
232
+ type: 'object',
233
+ properties: {
234
+ country_code: { type: 'string', description: 'Country code (e.g. AU, US)' },
235
+ area_code: { type: 'string', description: 'Area code to search' },
236
+ contains: { type: 'string', description: 'Number pattern to search for' },
237
+ capabilities: { type: 'string', description: 'Required capabilities' },
238
+ },
239
+ },
240
+ },
241
+ {
242
+ name: 'buy_phone_number',
243
+ description: 'Purchase and provision a phone number for the company. Use search_phone_numbers first to find available numbers. The number will be ready for SMS and voice calls.',
244
+ inputSchema: {
245
+ type: 'object',
246
+ properties: {
247
+ phone_number: { type: 'string', description: 'Phone number to buy in E.164 format (required)' },
248
+ },
249
+ required: ['phone_number'],
250
+ },
251
+ },
252
+ {
253
+ name: 'release_phone_number',
254
+ description: 'Release and deprovision a phone number — stop paying for it and remove it from the company. This action cannot be undone.',
255
+ inputSchema: {
256
+ type: 'object',
257
+ properties: {
258
+ id: { type: 'string', description: 'Phone number UUID (required)' },
259
+ },
260
+ required: ['id'],
261
+ },
262
+ },
263
+ {
264
+ name: 'list_phone_call_logs',
265
+ description: 'List phone call logs — browse, view, or get call history and call records. Filter by phone number, direction (inbound/outbound), and call status.',
266
+ inputSchema: {
267
+ type: 'object',
268
+ properties: {
269
+ limit: { type: 'number', description: 'Items per page (default 25, max 100)' },
270
+ after: { type: 'string', description: 'Cursor: get items after this ID' },
271
+ phone_number_id: { type: 'string', description: 'Filter by phone number UUID' },
272
+ direction: { type: 'string', description: 'Filter by direction (inbound/outbound)' },
273
+ status: { type: 'string', description: 'Filter by call status' },
274
+ },
275
+ },
276
+ },
277
+ {
278
+ name: 'resend_signing_email',
279
+ description: 'Resend the e-signature email for a signing envelope — use this if the original signing email was missed, lost, or expired.',
280
+ inputSchema: {
281
+ type: 'object',
282
+ properties: {
283
+ envelope_id: { type: 'string', description: 'Signing envelope UUID (required)' },
284
+ },
285
+ required: ['envelope_id'],
286
+ },
287
+ },
91
288
  ];
92
289
  export async function handleCommunicationTool(name, args) {
93
290
  switch (name) {
@@ -127,6 +324,8 @@ export async function handleCommunicationTool(name, args) {
127
324
  const res = await apiRequest('GET', '/voice-agents');
128
325
  return formatResponse(res);
129
326
  }
327
+ case 'get_voice_agent':
328
+ return formatResponse(await apiRequest('GET', `/voice-agents/${args.id}`));
130
329
  case 'initiate_voice_call': {
131
330
  const { agentId, to_number, from_number } = args;
132
331
  const res = await apiRequest('POST', `/voice-agents/${agentId}/call`, {
@@ -134,6 +333,78 @@ export async function handleCommunicationTool(name, args) {
134
333
  }, generateIdempotencyKey());
135
334
  return formatResponse(res);
136
335
  }
336
+ case 'reply_to_email': {
337
+ const { thread_id, html_body, subject } = args;
338
+ const res = await apiRequest('POST', '/email/reply', {
339
+ thread_id, html_body, subject,
340
+ }, generateIdempotencyKey());
341
+ return formatResponse(res);
342
+ }
343
+ case 'list_email_configs': {
344
+ const res = await apiRequest('GET', '/email/configs');
345
+ return formatResponse(res);
346
+ }
347
+ case 'get_email_config': {
348
+ const res = await apiRequest('GET', `/email/configs/${args.id}`);
349
+ return formatResponse(res);
350
+ }
351
+ case 'create_email_config': {
352
+ const { from_email, from_name, staff_email, website_id, is_default, logo_url, primary_color, secondary_color, send_to_user, send_to_staff, crm_auto_create_deal, crm_pipeline_id, crm_initial_stage_id } = args;
353
+ const res = await apiRequest('POST', '/email/configs', {
354
+ from_email, from_name, staff_email, website_id, is_default, logo_url, primary_color, secondary_color, send_to_user, send_to_staff, crm_auto_create_deal, crm_pipeline_id, crm_initial_stage_id,
355
+ }, generateIdempotencyKey());
356
+ return formatResponse(res);
357
+ }
358
+ case 'update_email_config': {
359
+ const { id, ...body } = args;
360
+ const res = await apiRequest('PATCH', `/email/configs/${id}`, body);
361
+ return formatResponse(res);
362
+ }
363
+ case 'delete_email_config': {
364
+ const res = await apiRequest('DELETE', `/email/configs/${args.id}`);
365
+ return formatResponse(res);
366
+ }
367
+ case 'list_email_logs': {
368
+ const { limit, after, status, contact_id, deal_id } = args;
369
+ const query = buildQuery({ limit: limit, after: after, status: status, contact_id: contact_id, deal_id: deal_id });
370
+ const res = await apiRequest('GET', `/email/logs${query}`);
371
+ return formatResponse(res);
372
+ }
373
+ case 'get_sms_conversation': {
374
+ const res = await apiRequest('GET', `/sms/conversations/${args.id}`);
375
+ return formatResponse(res);
376
+ }
377
+ case 'get_sms_messages': {
378
+ const res = await apiRequest('GET', `/sms/conversations/${args.conversation_id}/messages`);
379
+ return formatResponse(res);
380
+ }
381
+ case 'search_phone_numbers': {
382
+ const { country_code, area_code, contains, capabilities } = args;
383
+ const res = await apiRequest('POST', '/phone/numbers/search', {
384
+ country_code, area_code, contains, capabilities,
385
+ }, generateIdempotencyKey());
386
+ return formatResponse(res);
387
+ }
388
+ case 'buy_phone_number': {
389
+ const res = await apiRequest('POST', '/phone/numbers/buy', {
390
+ phone_number: args.phone_number,
391
+ }, generateIdempotencyKey());
392
+ return formatResponse(res);
393
+ }
394
+ case 'release_phone_number': {
395
+ const res = await apiRequest('POST', `/phone/numbers/${args.id}/release`, {}, generateIdempotencyKey());
396
+ return formatResponse(res);
397
+ }
398
+ case 'list_phone_call_logs': {
399
+ const { limit, after, phone_number_id, direction, status } = args;
400
+ const query = buildQuery({ limit: limit, after: after, phone_number_id: phone_number_id, direction: direction, status: status });
401
+ const res = await apiRequest('GET', `/phone/call-logs${query}`);
402
+ return formatResponse(res);
403
+ }
404
+ case 'resend_signing_email': {
405
+ const res = await apiRequest('POST', `/signing/envelopes/${args.envelope_id}/resend`, {}, generateIdempotencyKey());
406
+ return formatResponse(res);
407
+ }
137
408
  default:
138
409
  return { text: `Unknown communication tool: ${name}`, isError: true };
139
410
  }