neuron-mcp-server 1.0.0 → 1.1.0
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/.env +13 -0
- package/AI_PERSONALITY_DESIGN_RESEARCH.md +1020 -0
- package/Dockerfile +18 -0
- package/README.md +146 -131
- package/dist/client.d.ts +6 -0
- package/dist/client.js +50 -12
- package/dist/client.js.map +1 -1
- package/dist/index.js +51 -7
- package/dist/index.js.map +1 -1
- package/dist/tools/ai.js +9 -3
- package/dist/tools/ai.js.map +1 -1
- package/dist/tools/approvals.d.ts +2 -0
- package/dist/tools/approvals.js +181 -0
- package/dist/tools/approvals.js.map +1 -0
- package/dist/tools/audit.js +7 -4
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/auth.js +119 -19
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/billing.js +22 -6
- package/dist/tools/billing.js.map +1 -1
- package/dist/tools/blog.js +98 -34
- package/dist/tools/blog.js.map +1 -1
- package/dist/tools/bot-api-keys.js +27 -12
- package/dist/tools/bot-api-keys.js.map +1 -1
- package/dist/tools/bot-api.js +53 -27
- package/dist/tools/bot-api.js.map +1 -1
- package/dist/tools/bots.js +116 -68
- package/dist/tools/bots.js.map +1 -1
- package/dist/tools/broadcasts.js +78 -38
- package/dist/tools/broadcasts.js.map +1 -1
- package/dist/tools/builtin-tools.js +19 -12
- package/dist/tools/builtin-tools.js.map +1 -1
- package/dist/tools/campaigns.js +149 -61
- package/dist/tools/campaigns.js.map +1 -1
- package/dist/tools/channels.js +163 -53
- package/dist/tools/channels.js.map +1 -1
- package/dist/tools/contact-lists.js +111 -51
- package/dist/tools/contact-lists.js.map +1 -1
- package/dist/tools/contacts.js +117 -44
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/conversations.js +95 -50
- package/dist/tools/conversations.js.map +1 -1
- package/dist/tools/flows.d.ts +2 -0
- package/dist/tools/flows.js +242 -0
- package/dist/tools/flows.js.map +1 -0
- package/dist/tools/group-management.d.ts +2 -0
- package/dist/tools/group-management.js +239 -0
- package/dist/tools/group-management.js.map +1 -0
- package/dist/tools/leads.d.ts +2 -0
- package/dist/tools/leads.js +100 -0
- package/dist/tools/leads.js.map +1 -0
- package/dist/tools/list-campaigns.d.ts +2 -0
- package/dist/tools/list-campaigns.js +152 -0
- package/dist/tools/list-campaigns.js.map +1 -0
- package/dist/tools/list-pool.js +250 -33
- package/dist/tools/list-pool.js.map +1 -1
- package/dist/tools/media.js +12 -7
- package/dist/tools/media.js.map +1 -1
- package/dist/tools/newsletters.js +106 -26
- package/dist/tools/newsletters.js.map +1 -1
- package/dist/tools/organizations.js +76 -35
- package/dist/tools/organizations.js.map +1 -1
- package/dist/tools/outbound-webhooks.js +32 -20
- package/dist/tools/outbound-webhooks.js.map +1 -1
- package/dist/tools/payouts.js +44 -17
- package/dist/tools/payouts.js.map +1 -1
- package/dist/tools/personas.d.ts +2 -0
- package/dist/tools/personas.js +141 -0
- package/dist/tools/personas.js.map +1 -0
- package/dist/tools/polls.d.ts +2 -0
- package/dist/tools/polls.js +30 -0
- package/dist/tools/polls.js.map +1 -0
- package/dist/tools/pool.js +101 -43
- package/dist/tools/pool.js.map +1 -1
- package/dist/tools/products.d.ts +2 -0
- package/dist/tools/products.js +277 -0
- package/dist/tools/products.js.map +1 -0
- package/dist/tools/profile-privacy.d.ts +2 -0
- package/dist/tools/profile-privacy.js +195 -0
- package/dist/tools/profile-privacy.js.map +1 -0
- package/dist/tools/reflections.js +25 -13
- package/dist/tools/reflections.js.map +1 -1
- package/dist/tools/scheduled-messages.d.ts +2 -0
- package/dist/tools/scheduled-messages.js +124 -0
- package/dist/tools/scheduled-messages.js.map +1 -0
- package/dist/tools/social-channels.d.ts +2 -0
- package/dist/tools/social-channels.js +318 -0
- package/dist/tools/social-channels.js.map +1 -0
- package/dist/tools/tasks.d.ts +2 -0
- package/dist/tools/tasks.js +155 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/tools.js +86 -40
- package/dist/tools/tools.js.map +1 -1
- package/dist/tools/wallets.js +34 -12
- package/dist/tools/wallets.js.map +1 -1
- package/dist/tools/webhooks.js +35 -20
- package/dist/tools/webhooks.js.map +1 -1
- package/dist/tools/whatsapp-actions.d.ts +2 -0
- package/dist/tools/whatsapp-actions.js +186 -0
- package/dist/tools/whatsapp-actions.js.map +1 -0
- package/package.json +4 -31
- package/scripts/setup-delivahere-bot.ts +804 -0
- package/scripts/test-delivahere-bot.ts +128 -0
- package/scripts/update-letschop-prompt.ts +194 -0
- package/server.json +26 -0
- package/smithery.yaml +19 -0
- package/src/client.ts +169 -0
- package/src/index.ts +256 -0
- package/src/tools/ai.ts +35 -0
- package/src/tools/approvals.ts +231 -0
- package/src/tools/audit.ts +49 -0
- package/src/tools/auth.ts +536 -0
- package/src/tools/billing.ts +79 -0
- package/src/tools/blog.ts +264 -0
- package/src/tools/bot-api-keys.ts +87 -0
- package/src/tools/bot-api.ts +193 -0
- package/src/tools/bots.ts +320 -0
- package/src/tools/broadcasts.ts +224 -0
- package/src/tools/builtin-tools.ts +108 -0
- package/src/tools/campaigns.ts +429 -0
- package/src/tools/channels.ts +520 -0
- package/src/tools/contact-lists.ts +320 -0
- package/src/tools/contacts.ts +395 -0
- package/src/tools/conversations.ts +349 -0
- package/src/tools/flows.ts +298 -0
- package/src/tools/group-management.ts +265 -0
- package/src/tools/knowledge-bases.ts +451 -0
- package/src/tools/leads.ts +104 -0
- package/src/tools/list-campaigns.ts +190 -0
- package/src/tools/list-pool.ts +389 -0
- package/src/tools/media.ts +50 -0
- package/src/tools/newsletters.ts +271 -0
- package/src/tools/organizations.ts +287 -0
- package/src/tools/outbound-webhooks.ts +181 -0
- package/src/tools/payouts.ts +133 -0
- package/src/tools/personas.ts +145 -0
- package/src/tools/polls.ts +32 -0
- package/src/tools/pool.ts +293 -0
- package/src/tools/products.ts +280 -0
- package/src/tools/profile-privacy.ts +215 -0
- package/src/tools/reflections.ts +124 -0
- package/src/tools/scheduled-messages.ts +144 -0
- package/src/tools/social-channels.ts +396 -0
- package/src/tools/tasks.ts +198 -0
- package/src/tools/tools.ts +255 -0
- package/src/tools/wallets.ts +107 -0
- package/src/tools/webhooks.ts +166 -0
- package/src/tools/whatsapp-actions.ts +203 -0
- package/tsconfig.json +20 -0
- package/LICENSE +0 -21
|
@@ -3,14 +3,19 @@ import { api, jsonResult, errorResult } from "../client.js";
|
|
|
3
3
|
export function registerContactListsTools(server) {
|
|
4
4
|
server.registerTool("neuron_list_contact_lists", {
|
|
5
5
|
title: "List Contact Lists",
|
|
6
|
-
description: "
|
|
6
|
+
description: "Retrieve all contact lists for the current organization with optional filtering by search term, type, and pagination.",
|
|
7
7
|
inputSchema: z.object({
|
|
8
|
-
search: z.string().optional().describe("Search by name or slug"),
|
|
9
|
-
type: z.string().optional().describe("Filter by type: static, dynamic, merged"),
|
|
10
|
-
page: z.number().int().positive().optional().describe("Page number"),
|
|
11
|
-
limit: z.number().int().positive().optional().describe("
|
|
8
|
+
search: z.string().optional().describe("Search term to filter lists by name or slug"),
|
|
9
|
+
type: z.string().optional().describe("Filter by list type: 'static', 'dynamic', or 'merged'"),
|
|
10
|
+
page: z.number().int().positive().optional().describe("Page number for pagination (default: 1)"),
|
|
11
|
+
limit: z.number().int().positive().optional().describe("Number of items per page (default: 20)"),
|
|
12
12
|
}),
|
|
13
|
-
annotations: {
|
|
13
|
+
annotations: {
|
|
14
|
+
readOnlyHint: true,
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
idempotentHint: true,
|
|
17
|
+
openWorldHint: false,
|
|
18
|
+
},
|
|
14
19
|
}, async (params) => {
|
|
15
20
|
try {
|
|
16
21
|
const result = await api("GET", "/contact-lists", undefined, {
|
|
@@ -27,11 +32,16 @@ export function registerContactListsTools(server) {
|
|
|
27
32
|
});
|
|
28
33
|
server.registerTool("neuron_get_contact_list", {
|
|
29
34
|
title: "Get Contact List",
|
|
30
|
-
description: "
|
|
35
|
+
description: "Retrieve detailed information about a specific contact list, including member count and configuration.",
|
|
31
36
|
inputSchema: z.object({
|
|
32
|
-
idOrSlug: z.string().describe("
|
|
37
|
+
idOrSlug: z.string().describe("Unique identifier (UUID) or URL-friendly slug of the contact list"),
|
|
33
38
|
}),
|
|
34
|
-
annotations: {
|
|
39
|
+
annotations: {
|
|
40
|
+
readOnlyHint: true,
|
|
41
|
+
destructiveHint: false,
|
|
42
|
+
idempotentHint: true,
|
|
43
|
+
openWorldHint: false,
|
|
44
|
+
},
|
|
35
45
|
}, async (params) => {
|
|
36
46
|
try {
|
|
37
47
|
const result = await api("GET", `/contact-lists/${params.idOrSlug}`);
|
|
@@ -43,15 +53,21 @@ export function registerContactListsTools(server) {
|
|
|
43
53
|
});
|
|
44
54
|
server.registerTool("neuron_create_contact_list", {
|
|
45
55
|
title: "Create Contact List",
|
|
46
|
-
description: "Create a new contact list. Slug is auto-generated from name if not provided. For dynamic lists, provide criteria with rules and/or
|
|
56
|
+
description: "Create a new contact list. Slug is auto-generated from name if not provided. For dynamic lists, provide criteria with rules and/or an AI prompt.",
|
|
47
57
|
inputSchema: z.object({
|
|
48
|
-
name: z.string().describe("Display name for the list"),
|
|
49
|
-
slug: z.string().optional().describe("URL-friendly identifier (auto-generated if omitted)"),
|
|
50
|
-
description: z.string().optional().describe("
|
|
51
|
-
type: z.enum(["static", "dynamic", "merged"]).optional().describe("List type (default: static)"),
|
|
52
|
-
criteria: z.record(z.unknown()).optional().describe("
|
|
53
|
-
refreshSchedule: z.enum(["manual", "daily", "weekly", "on_access"]).optional().describe("Refresh schedule for dynamic lists (default: manual)"),
|
|
58
|
+
name: z.string().describe("Display name for the contact list"),
|
|
59
|
+
slug: z.string().optional().describe("URL-friendly identifier (auto-generated from name if omitted)"),
|
|
60
|
+
description: z.string().optional().describe("Human-readable description of the list's purpose"),
|
|
61
|
+
type: z.enum(["static", "dynamic", "merged"]).optional().describe("List type (default: 'static')"),
|
|
62
|
+
criteria: z.record(z.unknown()).optional().describe("Dynamic list criteria object: { rules?: { operator, conditions }, aiPrompt?, aiMaxResults? }"),
|
|
63
|
+
refreshSchedule: z.enum(["manual", "daily", "weekly", "on_access"]).optional().describe("Refresh schedule for dynamic lists (default: 'manual')"),
|
|
54
64
|
}),
|
|
65
|
+
annotations: {
|
|
66
|
+
readOnlyHint: false,
|
|
67
|
+
destructiveHint: false,
|
|
68
|
+
idempotentHint: false,
|
|
69
|
+
openWorldHint: false,
|
|
70
|
+
},
|
|
55
71
|
}, async (params) => {
|
|
56
72
|
try {
|
|
57
73
|
const result = await api("POST", "/contact-lists", params);
|
|
@@ -63,15 +79,21 @@ export function registerContactListsTools(server) {
|
|
|
63
79
|
});
|
|
64
80
|
server.registerTool("neuron_update_contact_list", {
|
|
65
81
|
title: "Update Contact List",
|
|
66
|
-
description: "Update
|
|
82
|
+
description: "Update an existing contact list's name, slug, description, criteria, or refresh schedule.",
|
|
67
83
|
inputSchema: z.object({
|
|
68
|
-
idOrSlug: z.string().describe("
|
|
69
|
-
name: z.string().optional().describe("
|
|
70
|
-
slug: z.string().optional().describe("
|
|
71
|
-
description: z.string().optional().describe("
|
|
72
|
-
criteria: z.record(z.unknown()).optional().nullable().describe("
|
|
73
|
-
refreshSchedule: z.enum(["manual", "daily", "weekly", "on_access"]).optional().describe("
|
|
84
|
+
idOrSlug: z.string().describe("Unique identifier (UUID) or URL-friendly slug of the contact list to update"),
|
|
85
|
+
name: z.string().optional().describe("Updated display name for the list"),
|
|
86
|
+
slug: z.string().optional().describe("Updated URL-friendly slug for the list"),
|
|
87
|
+
description: z.string().optional().describe("Updated description of the list's purpose"),
|
|
88
|
+
criteria: z.record(z.unknown()).optional().nullable().describe("Updated dynamic list criteria. Set to null to clear existing criteria."),
|
|
89
|
+
refreshSchedule: z.enum(["manual", "daily", "weekly", "on_access"]).optional().describe("Updated refresh schedule for dynamic lists"),
|
|
74
90
|
}),
|
|
91
|
+
annotations: {
|
|
92
|
+
readOnlyHint: false,
|
|
93
|
+
destructiveHint: false,
|
|
94
|
+
idempotentHint: true,
|
|
95
|
+
openWorldHint: false,
|
|
96
|
+
},
|
|
75
97
|
}, async (params) => {
|
|
76
98
|
try {
|
|
77
99
|
const { idOrSlug, ...body } = params;
|
|
@@ -84,11 +106,16 @@ export function registerContactListsTools(server) {
|
|
|
84
106
|
});
|
|
85
107
|
server.registerTool("neuron_delete_contact_list", {
|
|
86
108
|
title: "Delete Contact List",
|
|
87
|
-
description: "
|
|
109
|
+
description: "Permanently delete a contact list. System-protected lists (e.g., 'Do Not Contact') cannot be deleted.",
|
|
88
110
|
inputSchema: z.object({
|
|
89
|
-
idOrSlug: z.string().describe("
|
|
111
|
+
idOrSlug: z.string().describe("Unique identifier (UUID) or URL-friendly slug of the contact list to delete"),
|
|
90
112
|
}),
|
|
91
|
-
annotations: {
|
|
113
|
+
annotations: {
|
|
114
|
+
readOnlyHint: false,
|
|
115
|
+
destructiveHint: true,
|
|
116
|
+
idempotentHint: true,
|
|
117
|
+
openWorldHint: false,
|
|
118
|
+
},
|
|
92
119
|
}, async (params) => {
|
|
93
120
|
try {
|
|
94
121
|
const result = await api("DELETE", `/contact-lists/${params.idOrSlug}`);
|
|
@@ -100,14 +127,19 @@ export function registerContactListsTools(server) {
|
|
|
100
127
|
});
|
|
101
128
|
server.registerTool("neuron_get_contact_list_members", {
|
|
102
129
|
title: "Get Contact List Members",
|
|
103
|
-
description: "
|
|
130
|
+
description: "Retrieve the members of a specific contact list with optional search filtering and pagination.",
|
|
104
131
|
inputSchema: z.object({
|
|
105
|
-
idOrSlug: z.string().describe("
|
|
106
|
-
search: z.string().optional().describe("Search members by name or phone"),
|
|
107
|
-
page: z.number().int().positive().optional().describe("Page number"),
|
|
108
|
-
limit: z.number().int().positive().optional().describe("
|
|
132
|
+
idOrSlug: z.string().describe("Unique identifier (UUID) or URL-friendly slug of the contact list"),
|
|
133
|
+
search: z.string().optional().describe("Search term to filter members by name or phone number"),
|
|
134
|
+
page: z.number().int().positive().optional().describe("Page number for pagination (default: 1)"),
|
|
135
|
+
limit: z.number().int().positive().optional().describe("Number of items per page (default: 20)"),
|
|
109
136
|
}),
|
|
110
|
-
annotations: {
|
|
137
|
+
annotations: {
|
|
138
|
+
readOnlyHint: true,
|
|
139
|
+
destructiveHint: false,
|
|
140
|
+
idempotentHint: true,
|
|
141
|
+
openWorldHint: false,
|
|
142
|
+
},
|
|
111
143
|
}, async (params) => {
|
|
112
144
|
try {
|
|
113
145
|
const result = await api("GET", `/contact-lists/${params.idOrSlug}/members`, undefined, {
|
|
@@ -123,14 +155,20 @@ export function registerContactListsTools(server) {
|
|
|
123
155
|
});
|
|
124
156
|
server.registerTool("neuron_add_to_contact_list", {
|
|
125
157
|
title: "Add to Contact List",
|
|
126
|
-
description: "Add contacts to a list by contact ID or phone number. Phone numbers without existing contacts are auto-created as minimal
|
|
158
|
+
description: "Add one or more contacts to a list by contact ID or phone number. Phone numbers without existing contacts are auto-created as minimal contact records.",
|
|
127
159
|
inputSchema: z.object({
|
|
128
|
-
idOrSlug: z.string().describe("
|
|
160
|
+
idOrSlug: z.string().describe("Unique identifier (UUID) or URL-friendly slug of the target contact list"),
|
|
129
161
|
entries: z.array(z.object({
|
|
130
|
-
contactId: z.string().optional().describe("
|
|
131
|
-
phone: z.string().optional().describe("Phone number (
|
|
132
|
-
})).describe("
|
|
162
|
+
contactId: z.string().optional().describe("Unique identifier (UUID) of an existing contact"),
|
|
163
|
+
phone: z.string().optional().describe("Phone number in E.164 format (e.g., +2348012345678). Creates a new contact if no match exists."),
|
|
164
|
+
})).describe("Array of contacts to add, each identified by contactId or phone number"),
|
|
133
165
|
}),
|
|
166
|
+
annotations: {
|
|
167
|
+
readOnlyHint: false,
|
|
168
|
+
destructiveHint: false,
|
|
169
|
+
idempotentHint: false,
|
|
170
|
+
openWorldHint: false,
|
|
171
|
+
},
|
|
134
172
|
}, async (params) => {
|
|
135
173
|
try {
|
|
136
174
|
const result = await api("POST", `/contact-lists/${params.idOrSlug}/members`, {
|
|
@@ -144,12 +182,17 @@ export function registerContactListsTools(server) {
|
|
|
144
182
|
});
|
|
145
183
|
server.registerTool("neuron_remove_from_contact_list", {
|
|
146
184
|
title: "Remove from Contact List",
|
|
147
|
-
description: "Remove contacts from a list by their contact IDs",
|
|
185
|
+
description: "Remove one or more contacts from a list by their contact IDs. Does not delete the contacts themselves.",
|
|
148
186
|
inputSchema: z.object({
|
|
149
|
-
idOrSlug: z.string().describe("
|
|
150
|
-
contactIds: z.array(z.string()).describe("
|
|
187
|
+
idOrSlug: z.string().describe("Unique identifier (UUID) or URL-friendly slug of the contact list"),
|
|
188
|
+
contactIds: z.array(z.string()).describe("Array of contact UUIDs to remove from the list"),
|
|
151
189
|
}),
|
|
152
|
-
annotations: {
|
|
190
|
+
annotations: {
|
|
191
|
+
readOnlyHint: false,
|
|
192
|
+
destructiveHint: true,
|
|
193
|
+
idempotentHint: true,
|
|
194
|
+
openWorldHint: false,
|
|
195
|
+
},
|
|
153
196
|
}, async (params) => {
|
|
154
197
|
try {
|
|
155
198
|
const result = await api("DELETE", `/contact-lists/${params.idOrSlug}/members`, {
|
|
@@ -163,13 +206,19 @@ export function registerContactListsTools(server) {
|
|
|
163
206
|
});
|
|
164
207
|
server.registerTool("neuron_merge_contact_lists", {
|
|
165
208
|
title: "Merge Contact Lists",
|
|
166
|
-
description: "
|
|
209
|
+
description: "Merge two or more contact lists into a single unified list, deduplicating entries. Window merge creates a virtual union; materialized merge creates a static copy.",
|
|
167
210
|
inputSchema: z.object({
|
|
168
|
-
name: z.string().describe("
|
|
169
|
-
sourceListIds: z.array(z.string()).min(2).describe("
|
|
170
|
-
mergeType: z.enum(["window", "materialized"]).describe("Merge
|
|
171
|
-
slug: z.string().optional().describe("
|
|
211
|
+
name: z.string().describe("Display name for the resulting merged list"),
|
|
212
|
+
sourceListIds: z.array(z.string()).min(2).describe("UUIDs or slugs of the source lists to merge (minimum 2)"),
|
|
213
|
+
mergeType: z.enum(["window", "materialized"]).describe("Merge strategy: 'window' (virtual union, stays in sync) or 'materialized' (static copy at merge time)"),
|
|
214
|
+
slug: z.string().optional().describe("URL-friendly slug for the merged list (auto-generated if omitted)"),
|
|
172
215
|
}),
|
|
216
|
+
annotations: {
|
|
217
|
+
readOnlyHint: false,
|
|
218
|
+
destructiveHint: false,
|
|
219
|
+
idempotentHint: false,
|
|
220
|
+
openWorldHint: false,
|
|
221
|
+
},
|
|
173
222
|
}, async (params) => {
|
|
174
223
|
try {
|
|
175
224
|
const result = await api("POST", "/contact-lists/merge", params);
|
|
@@ -181,11 +230,16 @@ export function registerContactListsTools(server) {
|
|
|
181
230
|
});
|
|
182
231
|
server.registerTool("neuron_find_contact_lists_for_contact", {
|
|
183
232
|
title: "Find Contact Lists for Contact",
|
|
184
|
-
description: "
|
|
233
|
+
description: "Retrieve all contact lists that a specific contact belongs to.",
|
|
185
234
|
inputSchema: z.object({
|
|
186
|
-
contactId: z.string().describe("
|
|
235
|
+
contactId: z.string().describe("Unique identifier (UUID) of the contact to look up"),
|
|
187
236
|
}),
|
|
188
|
-
annotations: {
|
|
237
|
+
annotations: {
|
|
238
|
+
readOnlyHint: true,
|
|
239
|
+
destructiveHint: false,
|
|
240
|
+
idempotentHint: true,
|
|
241
|
+
openWorldHint: false,
|
|
242
|
+
},
|
|
189
243
|
}, async (params) => {
|
|
190
244
|
try {
|
|
191
245
|
const result = await api("GET", `/contact-lists/by-contact/${params.contactId}`);
|
|
@@ -197,10 +251,16 @@ export function registerContactListsTools(server) {
|
|
|
197
251
|
});
|
|
198
252
|
server.registerTool("neuron_refresh_contact_list", {
|
|
199
253
|
title: "Refresh Contact List",
|
|
200
|
-
description: "Trigger a refresh of a dynamic contact list. Re-evaluates criteria rules and/or AI prompt
|
|
254
|
+
description: "Trigger a refresh of a dynamic contact list. Re-evaluates criteria rules and/or AI prompt and materializes updated members.",
|
|
201
255
|
inputSchema: z.object({
|
|
202
|
-
idOrSlug: z.string().describe("
|
|
256
|
+
idOrSlug: z.string().describe("Unique identifier (UUID) or URL-friendly slug of the dynamic list to refresh"),
|
|
203
257
|
}),
|
|
258
|
+
annotations: {
|
|
259
|
+
readOnlyHint: false,
|
|
260
|
+
destructiveHint: false,
|
|
261
|
+
idempotentHint: true,
|
|
262
|
+
openWorldHint: false,
|
|
263
|
+
},
|
|
204
264
|
}, async (params) => {
|
|
205
265
|
try {
|
|
206
266
|
const result = await api("POST", `/contact-lists/${params.idOrSlug}/refresh`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-lists.js","sourceRoot":"","sources":["../../src/tools/contact-lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,2BAA2B,EAC3B;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"contact-lists.js","sourceRoot":"","sources":["../../src/tools/contact-lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,CACjB,2BAA2B,EAC3B;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,uHAAuH;QACpI,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YACrF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;YAC7F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC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CAAC,QAAQ,UAAU,CAAC,CAAC;YAC9E,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/contacts.js
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { api, jsonResult, errorResult, getAuthToken } from "../client.js";
|
|
2
|
+
import { api, jsonResult, errorResult, getAuthToken, getBaseUrl } from "../client.js";
|
|
3
3
|
export function registerContactsTools(server) {
|
|
4
4
|
// List contacts
|
|
5
5
|
server.registerTool("neuron_list_contacts", {
|
|
6
6
|
title: "List Contacts",
|
|
7
|
-
description: "
|
|
7
|
+
description: "Retrieve all contacts for the current organization with optional filtering by search term, tag, and pagination.",
|
|
8
8
|
inputSchema: z.object({
|
|
9
|
-
search: z.string().optional().describe("Search term to filter contacts by name, phone, or email"),
|
|
10
|
-
tag: z.string().optional().describe("
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
search: z.string().optional().describe("Search term to filter contacts by name, phone number, or email address"),
|
|
10
|
+
tag: z.string().optional().describe("Tag name to filter contacts by category"),
|
|
11
|
+
doNotBroadcast: z.boolean().optional().describe("Filter to contacts that are (true) or are not (false) excluded from broadcasts"),
|
|
12
|
+
doNotAutoRespond: z.boolean().optional().describe("Filter to contacts the bot will never (true) / may (false) auto-respond to"),
|
|
13
|
+
page: z.number().int().positive().optional().describe("Page number for pagination (default: 1)"),
|
|
14
|
+
limit: z.number().int().positive().optional().describe("Number of contacts per page (default: 20)"),
|
|
13
15
|
}),
|
|
14
|
-
annotations: {
|
|
16
|
+
annotations: {
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
destructiveHint: false,
|
|
19
|
+
idempotentHint: true,
|
|
20
|
+
openWorldHint: false,
|
|
21
|
+
},
|
|
15
22
|
}, async (params) => {
|
|
16
23
|
try {
|
|
17
24
|
const result = await api("GET", "/contacts", undefined, {
|
|
18
25
|
search: params.search,
|
|
19
26
|
tag: params.tag,
|
|
27
|
+
doNotBroadcast: params.doNotBroadcast === undefined ? undefined : String(params.doNotBroadcast),
|
|
28
|
+
doNotAutoRespond: params.doNotAutoRespond === undefined ? undefined : String(params.doNotAutoRespond),
|
|
20
29
|
page: params.page,
|
|
21
30
|
limit: params.limit,
|
|
22
31
|
});
|
|
@@ -29,11 +38,16 @@ export function registerContactsTools(server) {
|
|
|
29
38
|
// Search contacts
|
|
30
39
|
server.registerTool("neuron_search_contacts", {
|
|
31
40
|
title: "Search Contacts",
|
|
32
|
-
description: "Search contacts by a query string across name, phone, and email fields",
|
|
41
|
+
description: "Search contacts by a query string across name, phone number, and email fields. Returns matching contacts ranked by relevance.",
|
|
33
42
|
inputSchema: z.object({
|
|
34
|
-
q: z.string().describe("Search query string"),
|
|
43
|
+
q: z.string().describe("Search query string to match against contact name, phone, or email"),
|
|
35
44
|
}),
|
|
36
|
-
annotations: {
|
|
45
|
+
annotations: {
|
|
46
|
+
readOnlyHint: true,
|
|
47
|
+
destructiveHint: false,
|
|
48
|
+
idempotentHint: true,
|
|
49
|
+
openWorldHint: false,
|
|
50
|
+
},
|
|
37
51
|
}, async (params) => {
|
|
38
52
|
try {
|
|
39
53
|
const result = await api("GET", "/contacts/search", undefined, { q: params.q });
|
|
@@ -46,11 +60,16 @@ export function registerContactsTools(server) {
|
|
|
46
60
|
// Get contact
|
|
47
61
|
server.registerTool("neuron_get_contact", {
|
|
48
62
|
title: "Get Contact",
|
|
49
|
-
description: "
|
|
63
|
+
description: "Retrieve detailed information about a specific contact including their tags, notes, and associated lists.",
|
|
50
64
|
inputSchema: z.object({
|
|
51
|
-
id: z.string().describe("
|
|
65
|
+
id: z.string().describe("Unique identifier (UUID) of the contact"),
|
|
52
66
|
}),
|
|
53
|
-
annotations: {
|
|
67
|
+
annotations: {
|
|
68
|
+
readOnlyHint: true,
|
|
69
|
+
destructiveHint: false,
|
|
70
|
+
idempotentHint: true,
|
|
71
|
+
openWorldHint: false,
|
|
72
|
+
},
|
|
54
73
|
}, async (params) => {
|
|
55
74
|
try {
|
|
56
75
|
const result = await api("GET", `/contacts/${params.id}`);
|
|
@@ -63,14 +82,22 @@ export function registerContactsTools(server) {
|
|
|
63
82
|
// Create contact
|
|
64
83
|
server.registerTool("neuron_create_contact", {
|
|
65
84
|
title: "Create Contact",
|
|
66
|
-
description: "Create a new contact. If notes are provided, they are saved as a structured note entry with source tracking.",
|
|
85
|
+
description: "Create a new contact in the organization's address book. If notes are provided, they are saved as a structured note entry with source tracking.",
|
|
67
86
|
inputSchema: z.object({
|
|
68
87
|
name: z.string().describe("Full name of the contact"),
|
|
69
|
-
phone: z.string().describe("
|
|
88
|
+
phone: z.string().describe("Contact phone number in E.164 format (e.g., +2348012345678)"),
|
|
70
89
|
email: z.string().optional().describe("Email address of the contact"),
|
|
71
|
-
tags: z.array(z.string()).optional().describe("Tags to categorize the contact"),
|
|
72
|
-
notes: z.string().optional().describe("Additional notes about the contact"),
|
|
90
|
+
tags: z.array(z.string()).optional().describe("Tags to categorize the contact (e.g., ['vendor', 'lagos'])"),
|
|
91
|
+
notes: z.string().optional().describe("Additional notes about the contact, saved as a structured entry"),
|
|
92
|
+
doNotBroadcast: z.boolean().optional().describe("If true, this contact is permanently excluded from all broadcasts"),
|
|
93
|
+
doNotAutoRespond: z.boolean().optional().describe("If true, the bot will never auto-respond to this contact (manual/API and human sends still work)"),
|
|
73
94
|
}),
|
|
95
|
+
annotations: {
|
|
96
|
+
readOnlyHint: false,
|
|
97
|
+
destructiveHint: false,
|
|
98
|
+
idempotentHint: false,
|
|
99
|
+
openWorldHint: false,
|
|
100
|
+
},
|
|
74
101
|
}, async (params) => {
|
|
75
102
|
try {
|
|
76
103
|
const result = await api("POST", "/contacts", params);
|
|
@@ -83,15 +110,23 @@ export function registerContactsTools(server) {
|
|
|
83
110
|
// Update contact
|
|
84
111
|
server.registerTool("neuron_update_contact", {
|
|
85
112
|
title: "Update Contact",
|
|
86
|
-
description: "Update an existing contact. If notes are provided, they are
|
|
113
|
+
description: "Update an existing contact's details. If notes are provided, they are appended as a new structured note entry without overwriting existing notes.",
|
|
87
114
|
inputSchema: z.object({
|
|
88
|
-
id: z.string().describe("
|
|
89
|
-
name: z.string().optional().describe("
|
|
90
|
-
phone: z.string().optional().describe("
|
|
91
|
-
email: z.string().optional().describe("
|
|
92
|
-
tags: z.array(z.string()).optional().describe("
|
|
93
|
-
notes: z.string().optional().describe("New
|
|
115
|
+
id: z.string().describe("Unique identifier (UUID) of the contact to update"),
|
|
116
|
+
name: z.string().optional().describe("Updated full name for the contact"),
|
|
117
|
+
phone: z.string().optional().describe("Updated phone number in E.164 format (e.g., +2348012345678)"),
|
|
118
|
+
email: z.string().optional().describe("Updated email address for the contact"),
|
|
119
|
+
tags: z.array(z.string()).optional().describe("Updated tags for the contact (replaces existing tags)"),
|
|
120
|
+
notes: z.string().optional().describe("New note to append to the contact's existing notes"),
|
|
121
|
+
doNotBroadcast: z.boolean().optional().describe("Set true to exclude this contact from all broadcasts, false to allow"),
|
|
122
|
+
doNotAutoRespond: z.boolean().optional().describe("Set true so the bot never auto-responds to this contact, false to allow (manual/API and human sends are unaffected either way)"),
|
|
94
123
|
}),
|
|
124
|
+
annotations: {
|
|
125
|
+
readOnlyHint: false,
|
|
126
|
+
destructiveHint: false,
|
|
127
|
+
idempotentHint: true,
|
|
128
|
+
openWorldHint: false,
|
|
129
|
+
},
|
|
95
130
|
}, async (params) => {
|
|
96
131
|
try {
|
|
97
132
|
const { id, ...body } = params;
|
|
@@ -105,11 +140,16 @@ export function registerContactsTools(server) {
|
|
|
105
140
|
// Delete contact
|
|
106
141
|
server.registerTool("neuron_delete_contact", {
|
|
107
142
|
title: "Delete Contact",
|
|
108
|
-
description: "Permanently delete a contact. This action cannot be undone.",
|
|
143
|
+
description: "Permanently delete a contact and remove them from all contact lists. This action cannot be undone.",
|
|
109
144
|
inputSchema: z.object({
|
|
110
|
-
id: z.string().describe("
|
|
145
|
+
id: z.string().describe("Unique identifier (UUID) of the contact to delete"),
|
|
111
146
|
}),
|
|
112
|
-
annotations: {
|
|
147
|
+
annotations: {
|
|
148
|
+
readOnlyHint: false,
|
|
149
|
+
destructiveHint: true,
|
|
150
|
+
idempotentHint: true,
|
|
151
|
+
openWorldHint: false,
|
|
152
|
+
},
|
|
113
153
|
}, async (params) => {
|
|
114
154
|
try {
|
|
115
155
|
const result = await api("DELETE", `/contacts/${params.id}`);
|
|
@@ -122,9 +162,14 @@ export function registerContactsTools(server) {
|
|
|
122
162
|
// Export contacts
|
|
123
163
|
server.registerTool("neuron_export_contacts", {
|
|
124
164
|
title: "Export Contacts",
|
|
125
|
-
description: "Export all contacts
|
|
165
|
+
description: "Export all contacts as a downloadable dataset for the current organization.",
|
|
126
166
|
inputSchema: z.object({}),
|
|
127
|
-
annotations: {
|
|
167
|
+
annotations: {
|
|
168
|
+
readOnlyHint: true,
|
|
169
|
+
destructiveHint: false,
|
|
170
|
+
idempotentHint: true,
|
|
171
|
+
openWorldHint: false,
|
|
172
|
+
},
|
|
128
173
|
}, async () => {
|
|
129
174
|
try {
|
|
130
175
|
const result = await api("GET", "/contacts/export");
|
|
@@ -137,16 +182,22 @@ export function registerContactsTools(server) {
|
|
|
137
182
|
// Import contacts
|
|
138
183
|
server.registerTool("neuron_import_contacts", {
|
|
139
184
|
title: "Import Contacts",
|
|
140
|
-
description: "
|
|
185
|
+
description: "Bulk import multiple contacts into the organization's address book. Accepts an array of contact objects with name, phone, and optional fields.",
|
|
141
186
|
inputSchema: z.object({
|
|
142
187
|
contacts: z.array(z.object({
|
|
143
188
|
name: z.string().describe("Full name of the contact"),
|
|
144
|
-
phone: z.string().describe("
|
|
145
|
-
email: z.string().optional().describe("Email address"),
|
|
189
|
+
phone: z.string().describe("Contact phone number in E.164 format (e.g., +2348012345678)"),
|
|
190
|
+
email: z.string().optional().describe("Email address of the contact"),
|
|
146
191
|
tags: z.array(z.string()).optional().describe("Tags to categorize the contact"),
|
|
147
|
-
notes: z.string().optional().describe("Additional notes"),
|
|
148
|
-
})).describe("Array of
|
|
192
|
+
notes: z.string().optional().describe("Additional notes about the contact"),
|
|
193
|
+
})).describe("Array of contact objects to import into the organization"),
|
|
149
194
|
}),
|
|
195
|
+
annotations: {
|
|
196
|
+
readOnlyHint: false,
|
|
197
|
+
destructiveHint: false,
|
|
198
|
+
idempotentHint: false,
|
|
199
|
+
openWorldHint: false,
|
|
200
|
+
},
|
|
150
201
|
}, async (params) => {
|
|
151
202
|
try {
|
|
152
203
|
const result = await api("POST", "/contacts/import", { contacts: params.contacts });
|
|
@@ -159,8 +210,14 @@ export function registerContactsTools(server) {
|
|
|
159
210
|
// Populate contacts
|
|
160
211
|
server.registerTool("neuron_populate_contacts", {
|
|
161
212
|
title: "Populate Contacts",
|
|
162
|
-
description: "
|
|
213
|
+
description: "Enrich existing contacts with additional data from connected messaging channels. Syncs profile information from linked platforms.",
|
|
163
214
|
inputSchema: z.object({}),
|
|
215
|
+
annotations: {
|
|
216
|
+
readOnlyHint: false,
|
|
217
|
+
destructiveHint: false,
|
|
218
|
+
idempotentHint: true,
|
|
219
|
+
openWorldHint: false,
|
|
220
|
+
},
|
|
164
221
|
}, async () => {
|
|
165
222
|
try {
|
|
166
223
|
const result = await api("POST", "/contacts/populate");
|
|
@@ -173,8 +230,14 @@ export function registerContactsTools(server) {
|
|
|
173
230
|
// Sync WhatsApp contacts
|
|
174
231
|
server.registerTool("neuron_sync_whatsapp_contacts", {
|
|
175
232
|
title: "Sync WhatsApp Contacts",
|
|
176
|
-
description: "Synchronize contacts from connected WhatsApp channels into the contacts
|
|
233
|
+
description: "Synchronize contacts from all connected WhatsApp channels into the organization's contact database. Creates new contacts for unseen numbers.",
|
|
177
234
|
inputSchema: z.object({}),
|
|
235
|
+
annotations: {
|
|
236
|
+
readOnlyHint: false,
|
|
237
|
+
destructiveHint: false,
|
|
238
|
+
idempotentHint: true,
|
|
239
|
+
openWorldHint: false,
|
|
240
|
+
},
|
|
178
241
|
}, async () => {
|
|
179
242
|
try {
|
|
180
243
|
const result = await api("POST", "/contacts/sync-whatsapp");
|
|
@@ -189,10 +252,15 @@ export function registerContactsTools(server) {
|
|
|
189
252
|
title: "Semantic Search Contacts",
|
|
190
253
|
description: "Search contacts using natural language AI-powered semantic search. Finds contacts based on the meaning of their notes — skills, services, schedules, preferences, etc. Returns ranked results with relevance scores and AI-generated match reasons.",
|
|
191
254
|
inputSchema: z.object({
|
|
192
|
-
query: z.string().describe("Natural language search query (e.g
|
|
193
|
-
limit: z.number().int().positive().max(20).optional().describe("Maximum number of results to return (default 10, max 20)"),
|
|
255
|
+
query: z.string().describe("Natural language search query (e.g., 'who can deliver to Lagos on Monday?')"),
|
|
256
|
+
limit: z.number().int().positive().max(20).optional().describe("Maximum number of results to return (default: 10, max: 20)"),
|
|
194
257
|
}),
|
|
195
|
-
annotations: {
|
|
258
|
+
annotations: {
|
|
259
|
+
readOnlyHint: true,
|
|
260
|
+
destructiveHint: false,
|
|
261
|
+
idempotentHint: true,
|
|
262
|
+
openWorldHint: false,
|
|
263
|
+
},
|
|
196
264
|
}, async (params) => {
|
|
197
265
|
try {
|
|
198
266
|
const queryParams = { q: params.query };
|
|
@@ -209,15 +277,21 @@ export function registerContactsTools(server) {
|
|
|
209
277
|
server.registerTool("neuron_audio_contact", {
|
|
210
278
|
title: "Extract Contact from Audio",
|
|
211
279
|
description: "Transcribe an audio recording and extract contact information (name, phone, email, notes, tags). " +
|
|
212
|
-
"
|
|
280
|
+
"Automatically saves the extracted contact to the organization's address book.",
|
|
213
281
|
inputSchema: z.object({
|
|
214
|
-
audioBase64: z.string().describe("Base64-encoded audio data"),
|
|
282
|
+
audioBase64: z.string().describe("Base64-encoded audio data containing spoken contact information"),
|
|
215
283
|
audioFormat: z
|
|
216
284
|
.string()
|
|
217
285
|
.optional()
|
|
218
286
|
.default("webm")
|
|
219
|
-
.describe("Audio format hint (default: webm)"),
|
|
287
|
+
.describe("Audio format hint for decoding (default: 'webm')"),
|
|
220
288
|
}),
|
|
289
|
+
annotations: {
|
|
290
|
+
readOnlyHint: false,
|
|
291
|
+
destructiveHint: false,
|
|
292
|
+
idempotentHint: false,
|
|
293
|
+
openWorldHint: false,
|
|
294
|
+
},
|
|
221
295
|
}, async (params) => {
|
|
222
296
|
try {
|
|
223
297
|
// Decode base64 to buffer and create a File-like object for the API
|
|
@@ -227,8 +301,7 @@ export function registerContactsTools(server) {
|
|
|
227
301
|
const formData = new FormData();
|
|
228
302
|
formData.append("audio", blob, `recording.${params.audioFormat || "webm"}`);
|
|
229
303
|
// Use raw fetch since api() doesn't handle FormData
|
|
230
|
-
const
|
|
231
|
-
const response = await fetch(`${baseUrl}/api/v1/contacts/extract-audio`, {
|
|
304
|
+
const response = await fetch(`${getBaseUrl()}/contacts/extract-audio`, {
|
|
232
305
|
method: "POST",
|
|
233
306
|
headers: {
|
|
234
307
|
Authorization: `Bearer ${getAuthToken()}`,
|