@anychat-ai/mcp 0.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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/dist/bin.d.ts +2 -0
  4. package/dist/bin.js +98 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/client.d.ts +91 -0
  7. package/dist/client.js +154 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/docs.d.ts +60 -0
  10. package/dist/docs.js +238 -0
  11. package/dist/docs.js.map +1 -0
  12. package/dist/format.d.ts +19 -0
  13. package/dist/format.js +67 -0
  14. package/dist/format.js.map +1 -0
  15. package/dist/index.d.ts +21 -0
  16. package/dist/index.js +35 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/server.d.ts +26 -0
  19. package/dist/server.js +72 -0
  20. package/dist/server.js.map +1 -0
  21. package/dist/tool.d.ts +43 -0
  22. package/dist/tool.js +8 -0
  23. package/dist/tool.js.map +1 -0
  24. package/dist/tools/activity.d.ts +1 -0
  25. package/dist/tools/activity.js +153 -0
  26. package/dist/tools/activity.js.map +1 -0
  27. package/dist/tools/agents.d.ts +1 -0
  28. package/dist/tools/agents.js +309 -0
  29. package/dist/tools/agents.js.map +1 -0
  30. package/dist/tools/capabilities.d.ts +1 -0
  31. package/dist/tools/capabilities.js +325 -0
  32. package/dist/tools/capabilities.js.map +1 -0
  33. package/dist/tools/channels.d.ts +1 -0
  34. package/dist/tools/channels.js +208 -0
  35. package/dist/tools/channels.js.map +1 -0
  36. package/dist/tools/definition.d.ts +1 -0
  37. package/dist/tools/definition.js +531 -0
  38. package/dist/tools/definition.js.map +1 -0
  39. package/dist/tools/docs.d.ts +1 -0
  40. package/dist/tools/docs.js +67 -0
  41. package/dist/tools/docs.js.map +1 -0
  42. package/dist/tools/index.d.ts +8 -0
  43. package/dist/tools/index.js +30 -0
  44. package/dist/tools/index.js.map +1 -0
  45. package/dist/tools/me.d.ts +1 -0
  46. package/dist/tools/me.js +17 -0
  47. package/dist/tools/me.js.map +1 -0
  48. package/dist/tools/org.d.ts +1 -0
  49. package/dist/tools/org.js +178 -0
  50. package/dist/tools/org.js.map +1 -0
  51. package/dist/tools/people.d.ts +1 -0
  52. package/dist/tools/people.js +411 -0
  53. package/dist/tools/people.js.map +1 -0
  54. package/dist/version.d.ts +1 -0
  55. package/dist/version.js +6 -0
  56. package/dist/version.js.map +1 -0
  57. package/package.json +77 -0
@@ -0,0 +1,411 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.peopleTools = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_1 = require("../tool");
6
+ /**
7
+ * People (the built-in CRM) + People segments — a 1:1 projection of the
8
+ * "People" and "People segments" sections of the API reference.
9
+ *
10
+ * Left out deliberately (documented routes, not exposed here to keep the
11
+ * table tight): `restore` (undo a soft delete) and `dismissDuplicate`.
12
+ */
13
+ const PERSON_STATUS = ['new', 'contacted', 'qualified', 'converted', 'lost'];
14
+ const REACHABILITY = ['rcs', 'unreachable'];
15
+ /**
16
+ * The shared People filter vocabulary (list + export). Filters AND
17
+ * together; `segmentId` stands alone and cannot be combined with any
18
+ * individual filter.
19
+ */
20
+ const filterShape = {
21
+ status: zod_1.z
22
+ .enum(PERSON_STATUS)
23
+ .optional()
24
+ .describe('Exact funnel status: new | contacted | qualified | converted | lost'),
25
+ q: zod_1.z
26
+ .string()
27
+ .optional()
28
+ .describe('Case-insensitive substring of name, email, phone, or company'),
29
+ tags: zod_1.z.array(zod_1.z.string()).optional().describe('People carrying ANY of these tags'),
30
+ source: zod_1.z.string().optional().describe('Exact acquisition-source value'),
31
+ lastImportBatchId: zod_1.z
32
+ .string()
33
+ .optional()
34
+ .describe('Only people created/updated by one import call (the importBatchId returned by import_people)'),
35
+ hasPhone: zod_1.z
36
+ .boolean()
37
+ .optional()
38
+ .describe('true: a phone number is on file; false: missing or empty'),
39
+ outreachReachability: zod_1.z
40
+ .enum(REACHABILITY)
41
+ .optional()
42
+ .describe("Result of the most recent outreach attempt's capability check: 'rcs' or 'unreachable'"),
43
+ createdAfter: zod_1.z
44
+ .string()
45
+ .optional()
46
+ .describe('Record created on or after this ISO-8601 instant (inclusive)'),
47
+ createdBefore: zod_1.z
48
+ .string()
49
+ .optional()
50
+ .describe('Record created on or before this ISO-8601 instant (inclusive)'),
51
+ lastInboundAfter: zod_1.z
52
+ .string()
53
+ .optional()
54
+ .describe('Most recent inbound message on or after this ISO-8601 instant'),
55
+ lastInboundBefore: zod_1.z
56
+ .string()
57
+ .optional()
58
+ .describe('Most recent inbound message on or before this ISO-8601 instant'),
59
+ cf: zod_1.z
60
+ .record(zod_1.z.string(), zod_1.z.string())
61
+ .optional()
62
+ .describe('Exact-match conditions on declared custom People fields, keyed by field key, e.g. {"targetMarket": "medspa"} → cf.targetMarket=medspa. Undeclared keys are a 400.'),
63
+ segmentId: zod_1.z
64
+ .string()
65
+ .optional()
66
+ .describe('Apply a saved People segment (see list_segments). Mutually exclusive with every other filter — combining is a 400; unknown id is a 404.'),
67
+ };
68
+ /** Turn the filter args into query params (`tags` comma-joined, `cf` flattened to `cf.<key>`). */
69
+ function filterQuery(f) {
70
+ const { tags, cf, ...scalars } = f;
71
+ const query = { ...scalars };
72
+ if (tags && tags.length)
73
+ query.tags = tags.join(',');
74
+ for (const [k, v] of Object.entries(cf ?? {}))
75
+ query[`cf.${k}`] = v;
76
+ return query;
77
+ }
78
+ /** The writable Person fields (POST + PATCH accept exactly these). */
79
+ const personWritableShape = {
80
+ fullName: zod_1.z.string().max(200).optional().describe('Full display name (≤ 200)'),
81
+ firstName: zod_1.z.string().max(100).optional().describe('First name (≤ 100)'),
82
+ lastName: zod_1.z.string().max(100).optional().describe('Last name (≤ 100)'),
83
+ email: zod_1.z.string().max(300).optional().describe('Email address (≤ 300)'),
84
+ phone: zod_1.z
85
+ .string()
86
+ .max(50)
87
+ .optional()
88
+ .describe('Phone number; normalized to E.164 on write. Only needed for outreach — channel identity is otherwise tracked by ASID (read-only channelUserIds).'),
89
+ company: zod_1.z.string().max(200).optional().describe('Company (≤ 200)'),
90
+ title: zod_1.z.string().max(200).optional().describe('Job title (≤ 200)'),
91
+ productInterest: zod_1.z
92
+ .string()
93
+ .max(200)
94
+ .optional()
95
+ .describe('Product of interest; reconciled against the product catalog at use time'),
96
+ source: zod_1.z.string().max(200).optional().describe('Acquisition source label (≤ 200)'),
97
+ status: zod_1.z
98
+ .enum(PERSON_STATUS)
99
+ .optional()
100
+ .describe('Funnel status: new | contacted | qualified | converted | lost'),
101
+ notes: zod_1.z.string().max(5000).optional().describe('Free-form operator notes (≤ 5,000)'),
102
+ tags: zod_1.z.array(zod_1.z.string()).optional().describe('Free-form labels'),
103
+ externalId: zod_1.z
104
+ .string()
105
+ .max(200)
106
+ .optional()
107
+ .describe('Correlation id for an external system; exact-matched by import'),
108
+ lockedFields: zod_1.z
109
+ .array(zod_1.z.string())
110
+ .optional()
111
+ .describe('Field paths the agent may never write, e.g. ["email", "customFields.budget"]'),
112
+ customFields: zod_1.z
113
+ .record(zod_1.z.string(), zod_1.z.string())
114
+ .optional()
115
+ .describe("String values (≤ 1,000 each) keyed by declared People field key; values are validated against each field's declared type"),
116
+ assignedRepresentativeId: zod_1.z
117
+ .string()
118
+ .optional()
119
+ .describe("Must reference one of the agent's representatives"),
120
+ scheduledCallAt: zod_1.z
121
+ .string()
122
+ .optional()
123
+ .describe('ISO-8601; normally maintained by scheduling — writable only as an operator override'),
124
+ scheduledCallTimezone: zod_1.z
125
+ .string()
126
+ .optional()
127
+ .describe('IANA timezone for scheduledCallAt (operator override)'),
128
+ };
129
+ /** Segment body shared by create + replace. */
130
+ const segmentBodyShape = {
131
+ name: zod_1.z.string().min(1).max(100).describe('Segment name (≤ 100); required'),
132
+ description: zod_1.z.string().max(500).optional().describe('Optional description (≤ 500)'),
133
+ filter: zod_1.z
134
+ .object({
135
+ status: filterShape.status,
136
+ q: filterShape.q,
137
+ tags: filterShape.tags,
138
+ source: filterShape.source,
139
+ lastImportBatchId: filterShape.lastImportBatchId,
140
+ hasPhone: filterShape.hasPhone,
141
+ outreachReachability: filterShape.outreachReachability,
142
+ createdAfter: filterShape.createdAfter,
143
+ createdBefore: filterShape.createdBefore,
144
+ lastInboundAfter: filterShape.lastInboundAfter,
145
+ lastInboundBefore: filterShape.lastInboundBefore,
146
+ cf: filterShape.cf,
147
+ })
148
+ .describe('The saved filter as a JSON object using the People filter vocabulary: scalar params by name, tags as a string array, custom-field conditions nested under cf. Keys outside the vocabulary or undeclared cf keys are a 422.'),
149
+ };
150
+ const peoplePath = (agentId, rest = '') => `/agents/${encodeURIComponent(agentId)}/people${rest}`;
151
+ const personPath = (agentId, personId, rest = '') => peoplePath(agentId, `/${encodeURIComponent(personId)}${rest}`);
152
+ const segmentPath = (agentId, segmentId) => peoplePath(agentId, `/segments/${encodeURIComponent(segmentId)}`);
153
+ exports.peopleTools = [
154
+ (0, tool_1.defineTool)({
155
+ name: 'list_people',
156
+ title: 'List people',
157
+ description: "List an agent's People (the built-in CRM), newest first, with optional filters (status, q, tags, source, hasPhone, outreachReachability, date ranges, custom fields via cf, or a saved segmentId) that AND together. Paginate with limit (max 200) and startingAfter (the last person id of the previous page); the response is { data: Person[], hasMore }. Maps to GET /v1/orgs/{org}/agents/{agent}/people.",
158
+ kind: 'read',
159
+ scope: 'people:read',
160
+ roleFloor: 'viewer',
161
+ input: {
162
+ agentId: zod_1.z.string().describe('Agent id'),
163
+ limit: zod_1.z
164
+ .number()
165
+ .int()
166
+ .min(1)
167
+ .max(200)
168
+ .optional()
169
+ .describe('Page size (max 200). Always pass one — omitting every parameter returns the deprecated full array.'),
170
+ startingAfter: zod_1.z
171
+ .string()
172
+ .optional()
173
+ .describe('Person id of the last item on the previous page (cursor)'),
174
+ ...filterShape,
175
+ },
176
+ run: async ({ client }, { agentId, limit, startingAfter, ...filter }) => client.get(await client.orgPath(peoplePath(agentId)), {
177
+ limit,
178
+ startingAfter,
179
+ ...filterQuery(filter),
180
+ }),
181
+ }),
182
+ (0, tool_1.defineTool)({
183
+ name: 'get_person',
184
+ title: 'Get a person',
185
+ description: 'Fetch one Person record in full: profile fields, status, tags, custom fields, provenance (fieldMeta), duplicate candidates, journal, channel identities (ASIDs), outreach / follow-up / scheduling state. Maps to GET /v1/orgs/{org}/agents/{agent}/people/{personId}.',
186
+ kind: 'read',
187
+ scope: 'people:read',
188
+ roleFloor: 'viewer',
189
+ input: {
190
+ agentId: zod_1.z.string().describe('Agent id'),
191
+ personId: zod_1.z.string().describe('Person id'),
192
+ },
193
+ run: async ({ client }, { agentId, personId }) => client.get(await client.orgPath(personPath(agentId, personId))),
194
+ }),
195
+ (0, tool_1.defineTool)({
196
+ name: 'create_person',
197
+ title: 'Create a person',
198
+ description: 'Create a Person on the agent from operator-supplied fields (name, email, phone, company, status, tags, externalId, customFields …). The person is bound to the agent in the path; runtime-owned fields (channel identity, outreach state, journal) cannot be set. Returns the created Person. Maps to POST /v1/orgs/{org}/agents/{agent}/people.',
199
+ kind: 'write',
200
+ scope: 'people:write',
201
+ roleFloor: 'editor',
202
+ input: {
203
+ agentId: zod_1.z.string().describe('Agent id'),
204
+ ...personWritableShape,
205
+ },
206
+ run: async ({ client }, { agentId, ...body }) => client.post(await client.orgPath(peoplePath(agentId)), body),
207
+ }),
208
+ (0, tool_1.defineTool)({
209
+ name: 'update_person',
210
+ title: 'Update a person',
211
+ description: 'Partially update a Person (PATCH): only the writable fields supplied are changed, e.g. move status along the funnel, add tags, set customFields, or lock fields against agent writes. At least one field is required. Returns the updated Person. Maps to PATCH /v1/orgs/{org}/agents/{agent}/people/{personId}.',
212
+ kind: 'write',
213
+ scope: 'people:write',
214
+ roleFloor: 'editor',
215
+ input: {
216
+ agentId: zod_1.z.string().describe('Agent id'),
217
+ personId: zod_1.z.string().describe('Person id'),
218
+ ...personWritableShape,
219
+ },
220
+ run: async ({ client }, { agentId, personId, ...body }) => client.patch(await client.orgPath(personPath(agentId, personId)), body),
221
+ }),
222
+ (0, tool_1.defineTool)({
223
+ name: 'delete_person',
224
+ title: 'Delete a person',
225
+ description: 'Soft-delete a Person: it disappears from every list, lookup, and export, and is purged after 30 days (POST …/restore can undo it before then; records consumed by a merge cannot be restored). Maps to DELETE /v1/orgs/{org}/agents/{agent}/people/{personId}.',
226
+ kind: 'destructive',
227
+ scope: 'people:write',
228
+ roleFloor: 'editor',
229
+ input: {
230
+ agentId: zod_1.z.string().describe('Agent id'),
231
+ personId: zod_1.z.string().describe('Person id to delete'),
232
+ },
233
+ run: async ({ client }, { agentId, personId }) => {
234
+ await client.delete(await client.orgPath(personPath(agentId, personId)));
235
+ return { ok: true, deleted: personId };
236
+ },
237
+ }),
238
+ (0, tool_1.defineTool)({
239
+ name: 'merge_people',
240
+ title: 'Merge two people',
241
+ description: 'Merge a source Person into a target Person and retire the source (used to resolve duplicateCandidates). Defaults are target-wins with the source filling empty fields; fieldChoices overrides per field ("source" | "target"). Conflicting externalIds are a 409 unless a choice is supplied. Returns { success, person }. Maps to POST /v1/orgs/{org}/agents/{agent}/people/{personId}/merge.',
242
+ kind: 'write',
243
+ scope: 'people:write',
244
+ roleFloor: 'editor',
245
+ input: {
246
+ agentId: zod_1.z.string().describe('Agent id'),
247
+ personId: zod_1.z.string().describe('Target person id (survives the merge)'),
248
+ sourceId: zod_1.z.string().describe('Source person id (retired by the merge)'),
249
+ fieldChoices: zod_1.z
250
+ .record(zod_1.z.string(), zod_1.z.enum(['source', 'target']))
251
+ .optional()
252
+ .describe('Per-field winner overrides keyed by field path, e.g. {"email": "source"}'),
253
+ },
254
+ run: async ({ client }, { agentId, personId, sourceId, fieldChoices }) => client.post(await client.orgPath(personPath(agentId, personId, '/merge')), {
255
+ sourceId,
256
+ ...(fieldChoices ? { fieldChoices } : {}),
257
+ }),
258
+ }),
259
+ (0, tool_1.defineTool)({
260
+ name: 'export_people',
261
+ title: 'Export people (bulk)',
262
+ description: 'Bulk-export the CRM as text — WARNING: returns bulk personally identifiable information (names, emails, phones) for every matching person; only use when the operator explicitly wants an export, and prefer list_people for browsing. Accepts the same filters as list_people (or a segmentId). format=csv (default) gives one row per person with columns matching the import template; format=ndjson gives one full JSON record per line including journal and fieldMeta. Large results are truncated in the tool output. Requires the people:export scope. Maps to GET /v1/orgs/{org}/agents/{agent}/people/export.',
263
+ kind: 'read',
264
+ scope: 'people:export',
265
+ roleFloor: 'editor',
266
+ input: {
267
+ agentId: zod_1.z.string().describe('Agent id'),
268
+ format: zod_1.z.enum(['csv', 'ndjson']).optional().describe('csv (default) or ndjson'),
269
+ ...filterShape,
270
+ },
271
+ run: async ({ client }, { agentId, format, ...filter }) => client.get(await client.orgPath(peoplePath(agentId, '/export')), {
272
+ format,
273
+ ...filterQuery(filter),
274
+ }),
275
+ }),
276
+ (0, tool_1.defineTool)({
277
+ name: 'import_people',
278
+ title: 'Import people',
279
+ description: 'Bulk import/upsert People from rows (each row a header-to-value object using the import template columns, e.g. "email", "full name", "external id", or any declared People field). Rows matching an existing person by externalId or email update it: mode "fill" (default) writes only empty fields, "update" overwrites with non-empty incoming values; locked fields are never overwritten. Returns imported / updated / skipped / duplicatesFlagged / unmatchedColumns / rowErrors and an importBatchId usable as the lastImportBatchId filter. Maps to POST /v1/orgs/{org}/agents/{agent}/people/import.',
280
+ kind: 'write',
281
+ scope: 'people:write',
282
+ roleFloor: 'editor',
283
+ input: {
284
+ agentId: zod_1.z.string().describe('Agent id'),
285
+ rows: zod_1.z
286
+ .array(zod_1.z.record(zod_1.z.string(), zod_1.z.string()))
287
+ .min(1)
288
+ .describe('Non-empty array of header-to-value row objects'),
289
+ mode: zod_1.z
290
+ .enum(['fill', 'update'])
291
+ .optional()
292
+ .describe('fill (default): only empty fields; update: overwrite with non-empty values'),
293
+ },
294
+ run: async ({ client }, { agentId, rows, mode }) => client.post(await client.orgPath(peoplePath(agentId, '/import')), {
295
+ rows,
296
+ ...(mode ? { mode } : {}),
297
+ }),
298
+ }),
299
+ (0, tool_1.defineTool)({
300
+ name: 'list_person_appointments',
301
+ title: "List a person's appointments",
302
+ description: "List one person's scheduled calls (appointments), newest first, including cancelled ones — each with startUtc, durationMinutes, prospectTimezone, status (scheduled | rescheduled | cancelled | completed), representative, notes and history. Returns { data: Appointment[] }. Maps to GET /v1/orgs/{org}/agents/{agent}/people/{personId}/appointments.",
303
+ kind: 'read',
304
+ scope: 'people:read',
305
+ roleFloor: 'viewer',
306
+ input: {
307
+ agentId: zod_1.z.string().describe('Agent id'),
308
+ personId: zod_1.z.string().describe('Person id'),
309
+ },
310
+ run: async ({ client }, { agentId, personId }) => client.get(await client.orgPath(personPath(agentId, personId, '/appointments'))),
311
+ }),
312
+ (0, tool_1.defineTool)({
313
+ name: 'list_appointments',
314
+ title: 'List appointments (all people)',
315
+ description: "List every appointment across the agent's people (the console Calls view), newest start first, each annotated with personId and personName when the linked person resolves. Filter by status (scheduled | completed | cancelled; completed means the scheduled time has elapsed) and cap with limit (default 200, max 500). Returns { data: Appointment[] }. Maps to GET /v1/orgs/{org}/agents/{agent}/appointments.",
316
+ kind: 'read',
317
+ scope: 'people:read',
318
+ roleFloor: 'viewer',
319
+ input: {
320
+ agentId: zod_1.z.string().describe('Agent id'),
321
+ status: zod_1.z
322
+ .enum(['scheduled', 'completed', 'cancelled'])
323
+ .optional()
324
+ .describe('Only appointments in this status'),
325
+ limit: zod_1.z
326
+ .number()
327
+ .int()
328
+ .min(1)
329
+ .max(500)
330
+ .optional()
331
+ .describe('Max appointments to return (default 200, max 500)'),
332
+ },
333
+ run: async ({ client }, { agentId, status, limit }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/appointments`), { status, limit }),
334
+ }),
335
+ (0, tool_1.defineTool)({
336
+ name: 'list_segments',
337
+ title: 'List people segments',
338
+ description: "List the agent's saved People segments (named, persisted filters; up to 50 per agent). Returns { data: PeopleSegment[] } with id, name, description, filter. Pass a segment's id as segmentId to list_people / export_people. Maps to GET /v1/orgs/{org}/agents/{agent}/people/segments.",
339
+ kind: 'read',
340
+ scope: 'people:read',
341
+ roleFloor: 'viewer',
342
+ input: {
343
+ agentId: zod_1.z.string().describe('Agent id'),
344
+ },
345
+ run: async ({ client }, { agentId }) => client.get(await client.orgPath(peoplePath(agentId, '/segments'))),
346
+ }),
347
+ (0, tool_1.defineTool)({
348
+ name: 'get_segment',
349
+ title: 'Get a people segment',
350
+ description: 'Fetch one saved People segment (id, name, description, filter). Maps to GET /v1/orgs/{org}/agents/{agent}/people/segments/{segmentId}.',
351
+ kind: 'read',
352
+ scope: 'people:read',
353
+ roleFloor: 'viewer',
354
+ input: {
355
+ agentId: zod_1.z.string().describe('Agent id'),
356
+ segmentId: zod_1.z.string().describe('Segment id (per-agent slug)'),
357
+ },
358
+ run: async ({ client }, { agentId, segmentId }) => client.get(await client.orgPath(segmentPath(agentId, segmentId))),
359
+ }),
360
+ (0, tool_1.defineTool)({
361
+ name: 'create_segment',
362
+ title: 'Create a people segment',
363
+ description: 'Save a named People filter as a segment on the agent. The id is slugified from name (stable through later renames) unless an explicit id is given. A segment stores the filter, not its results. Returns the created PeopleSegment. Maps to POST /v1/orgs/{org}/agents/{agent}/people/segments.',
364
+ kind: 'write',
365
+ scope: 'people:write',
366
+ roleFloor: 'editor',
367
+ input: {
368
+ agentId: zod_1.z.string().describe('Agent id'),
369
+ id: zod_1.z
370
+ .string()
371
+ .optional()
372
+ .describe('Optional explicit segment id; defaults to a slug of name. Duplicate ids are a 422.'),
373
+ ...segmentBodyShape,
374
+ },
375
+ run: async ({ client }, { agentId, id, ...body }) => client.post(await client.orgPath(peoplePath(agentId, '/segments')), {
376
+ ...(id ? { id } : {}),
377
+ ...body,
378
+ }),
379
+ }),
380
+ (0, tool_1.defineTool)({
381
+ name: 'update_segment',
382
+ title: 'Replace a people segment',
383
+ description: 'Replace a saved People segment wholesale (PUT): name, description and filter under the id in the path — send the complete segment, not a diff (read it first with get_segment). Replacing an unknown id upserts a new segment with that id (201). Returns the PeopleSegment. Maps to PUT /v1/orgs/{org}/agents/{agent}/people/segments/{segmentId}.',
384
+ kind: 'write',
385
+ scope: 'people:write',
386
+ roleFloor: 'editor',
387
+ input: {
388
+ agentId: zod_1.z.string().describe('Agent id'),
389
+ segmentId: zod_1.z.string().describe('Segment id to replace'),
390
+ ...segmentBodyShape,
391
+ },
392
+ run: async ({ client }, { agentId, segmentId, ...body }) => client.put(await client.orgPath(segmentPath(agentId, segmentId)), body),
393
+ }),
394
+ (0, tool_1.defineTool)({
395
+ name: 'delete_segment',
396
+ title: 'Delete a people segment',
397
+ description: 'Delete a saved People segment. Only the saved filter is removed — no Person records are affected. Maps to DELETE /v1/orgs/{org}/agents/{agent}/people/segments/{segmentId}.',
398
+ kind: 'destructive',
399
+ scope: 'people:write',
400
+ roleFloor: 'editor',
401
+ input: {
402
+ agentId: zod_1.z.string().describe('Agent id'),
403
+ segmentId: zod_1.z.string().describe('Segment id to delete'),
404
+ },
405
+ run: async ({ client }, { agentId, segmentId }) => {
406
+ await client.delete(await client.orgPath(segmentPath(agentId, segmentId)));
407
+ return { ok: true, deleted: segmentId };
408
+ },
409
+ }),
410
+ ];
411
+ //# sourceMappingURL=people.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"people.js","sourceRoot":"","sources":["../../src/tools/people.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,kCAAqC;AAErC;;;;;;GAMG;AAEH,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,CAAU,CAAC;AACtF,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,aAAa,CAAU,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,OAAC;SACN,IAAI,CAAC,aAAa,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CAAC,qEAAqE,CAAC;IAClF,CAAC,EAAE,OAAC;SACD,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,8DAA8D,CAAC;I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AAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;KAC1E,CAAC;IAEF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACT,6KAA6K;QAC/K,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE;YACL,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;YACxC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;SACvD;QACD,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;YAChD,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;YAC3E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;QAC1C,CAAC;KACF,CAAC;CACH,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const VERSION: string;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VERSION = void 0;
4
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
5
+ exports.VERSION = require('../package.json').version;
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,iEAAiE;AACpD,QAAA,OAAO,GAAW,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@anychat-ai/mcp",
3
+ "version": "0.1.0",
4
+ "description": "Anychat MCP server — drive your Anychat workspace (agents, playbooks, channels, people, outreach) from Claude Code, Claude Desktop, Cursor, or any MCP host.",
5
+ "keywords": [
6
+ "anychat",
7
+ "mcp",
8
+ "model-context-protocol",
9
+ "rcs",
10
+ "whatsapp",
11
+ "messaging",
12
+ "agents"
13
+ ],
14
+ "homepage": "https://docs.anychat.ai/",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/AnyChat-ai/mcp.git"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/AnyChat-ai/mcp/issues"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Anychat.ai (Redirect Ventures Inc.)",
24
+ "main": "dist/index.js",
25
+ "types": "dist/index.d.ts",
26
+ "bin": {
27
+ "anychat-mcp": "dist/bin.js"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "README.md",
32
+ "LICENSE"
33
+ ],
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "registry": "https://registry.npmjs.org/"
40
+ },
41
+ "scripts": {
42
+ "build": "rm -rf dist && tsc -p tsconfig.json",
43
+ "prepublishOnly": "npm run build && npm run lint && npm run prettier && npm test",
44
+ "start": "node dist/bin.js",
45
+ "dev": "ts-node src/bin.ts",
46
+ "lint": "eslint . --ext .ts",
47
+ "lint-fix": "eslint . --fix --ext .ts",
48
+ "prettier": "prettier --list-different \"**/*.{ts,json,md}\"",
49
+ "prettier-fix": "prettier --write \"**/*.{ts,json,md}\"",
50
+ "test": "TS_NODE_PROJECT=tsconfig.test.json TS_NODE_TRANSPILE_ONLY=true mocha",
51
+ "tools:md": "node scripts/tool-table.js",
52
+ "test:e2e": "ANYCHAT_E2E=1 TS_NODE_PROJECT=tsconfig.test.json TS_NODE_TRANSPILE_ONLY=true mocha 'test/e2e/**/*.spec.ts'"
53
+ },
54
+ "dependencies": {
55
+ "@modelcontextprotocol/sdk": "^1.30.0",
56
+ "zod": "^4.4.3"
57
+ },
58
+ "devDependencies": {
59
+ "@eslint/eslintrc": "^3.3.0",
60
+ "@eslint/js": "^9.21.0",
61
+ "@types/chai": "^4.3.20",
62
+ "@types/mocha": "^10.0.10",
63
+ "@types/node": "^22.13.13",
64
+ "@types/sinon": "^17.0.3",
65
+ "@typescript-eslint/eslint-plugin": "^8.26.0",
66
+ "@typescript-eslint/parser": "^8.26.0",
67
+ "chai": "^4.5.0",
68
+ "eslint": "^9.21.0",
69
+ "eslint-config-prettier": "^9.1.0",
70
+ "globals": "^16.0.0",
71
+ "mocha": "^11.1.0",
72
+ "prettier": "^3.5.3",
73
+ "sinon": "^19.0.2",
74
+ "ts-node": "^10.9.2",
75
+ "typescript": "^5.8.2"
76
+ }
77
+ }