@zaapi/open-api-mcp 1.2.0 → 1.4.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 (69) hide show
  1. package/dist/client.js +5 -0
  2. package/dist/client.js.map +1 -1
  3. package/dist/instructions.js +77 -0
  4. package/dist/instructions.js.map +1 -0
  5. package/dist/server.js +134 -12
  6. package/dist/server.js.map +1 -1
  7. package/dist/tools/accounts/list-accounts.js +8 -18
  8. package/dist/tools/accounts/list-accounts.js.map +1 -1
  9. package/dist/tools/accounts/list-whatsapp-templates.js +49 -0
  10. package/dist/tools/accounts/list-whatsapp-templates.js.map +1 -0
  11. package/dist/tools/common.js +48 -26
  12. package/dist/tools/common.js.map +1 -1
  13. package/dist/tools/contacts/create-contact.js +13 -7
  14. package/dist/tools/contacts/create-contact.js.map +1 -1
  15. package/dist/tools/contacts/get-contact-by-id.js +6 -7
  16. package/dist/tools/contacts/get-contact-by-id.js.map +1 -1
  17. package/dist/tools/contacts/list-contact-fields.js +5 -3
  18. package/dist/tools/contacts/list-contact-fields.js.map +1 -1
  19. package/dist/tools/contacts/list-contacts.js +11 -6
  20. package/dist/tools/contacts/list-contacts.js.map +1 -1
  21. package/dist/tools/contacts/search-contacts.js +20 -0
  22. package/dist/tools/contacts/search-contacts.js.map +1 -0
  23. package/dist/tools/contacts/update-contact-field.js +12 -7
  24. package/dist/tools/contacts/update-contact-field.js.map +1 -1
  25. package/dist/tools/conversations/filter-conversations.js +11 -7
  26. package/dist/tools/conversations/filter-conversations.js.map +1 -1
  27. package/dist/tools/conversations/mark-conversation-read.js +4 -6
  28. package/dist/tools/conversations/mark-conversation-read.js.map +1 -1
  29. package/dist/tools/conversations/update-conversation-labels.js +10 -9
  30. package/dist/tools/conversations/update-conversation-labels.js.map +1 -1
  31. package/dist/tools/index.js +14 -0
  32. package/dist/tools/index.js.map +1 -1
  33. package/dist/tools/labels/list-labels.js +7 -4
  34. package/dist/tools/labels/list-labels.js.map +1 -1
  35. package/dist/tools/messages/create-internal-comment.js +9 -8
  36. package/dist/tools/messages/create-internal-comment.js.map +1 -1
  37. package/dist/tools/messages/get-messages.js +9 -7
  38. package/dist/tools/messages/get-messages.js.map +1 -1
  39. package/dist/tools/messages/list-internal-comments.js +8 -8
  40. package/dist/tools/messages/list-internal-comments.js.map +1 -1
  41. package/dist/tools/messages/search-messages.js +20 -0
  42. package/dist/tools/messages/search-messages.js.map +1 -0
  43. package/dist/tools/messages/send-email.js +27 -0
  44. package/dist/tools/messages/send-email.js.map +1 -0
  45. package/dist/tools/messages/send-new-email.js +27 -0
  46. package/dist/tools/messages/send-new-email.js.map +1 -0
  47. package/dist/tools/messages/send-new-whatsapp-template.js +35 -0
  48. package/dist/tools/messages/send-new-whatsapp-template.js.map +1 -0
  49. package/dist/tools/messages/send-plain-text-message.js +9 -8
  50. package/dist/tools/messages/send-plain-text-message.js.map +1 -1
  51. package/dist/tools/messages/send-whatsapp-template.js +32 -0
  52. package/dist/tools/messages/send-whatsapp-template.js.map +1 -0
  53. package/dist/tools/responses.js +303 -0
  54. package/dist/tools/responses.js.map +1 -0
  55. package/dist/tools/teams/list-teams.js +10 -5
  56. package/dist/tools/teams/list-teams.js.map +1 -1
  57. package/dist/tools/tickets/close-ticket.js +17 -10
  58. package/dist/tools/tickets/close-ticket.js.map +1 -1
  59. package/dist/tools/tickets/get-ticket-by-id.js +8 -8
  60. package/dist/tools/tickets/get-ticket-by-id.js.map +1 -1
  61. package/dist/tools/tickets/list-ticket-fields.js +7 -4
  62. package/dist/tools/tickets/list-ticket-fields.js.map +1 -1
  63. package/dist/tools/tickets/list-tickets.js +22 -22
  64. package/dist/tools/tickets/list-tickets.js.map +1 -1
  65. package/dist/tools/tickets/update-ticket-field.js +15 -8
  66. package/dist/tools/tickets/update-ticket-field.js.map +1 -1
  67. package/dist/tools/users/list-users.js +8 -5
  68. package/dist/tools/users/list-users.js.map +1 -1
  69. package/package.json +1 -1
@@ -1,19 +1,18 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest } from '../common.js';
2
+ import { contact, envelope } from '../responses.js';
3
3
  const queryKeys = ['contactId'];
4
4
  export const getContactById = {
5
5
  name: 'getContactById',
6
6
  title: 'Get a contact by ID',
7
- description: `Required scope: contacts:read. ${describeHttpRequest('GET', '/v1/contacts', queryKeys)} Fetch a single contact, including custom field values.`,
7
+ description: 'Fetch one contact in full, including custom field values and the customFieldsUpdatedAt that updateContactField must echo back. Read this before writing a field. To see the contact’s threads, pass the same id to filterConversations. Requires the contacts:read scope.',
8
+ scope: 'contacts:read',
8
9
  method: 'GET',
9
10
  path: '/v1/contacts',
10
11
  queryKeys,
11
12
  inputSchema: z.object({
12
- contactId: z
13
- .string()
14
- .min(1)
15
- .describe('Query parameter. The ID of the contact.'),
13
+ contactId: z.string().min(1).describe('The ID of the contact.'),
16
14
  }),
17
- annotations: { readOnlyHint: true },
15
+ outputSchema: envelope(contact, 'The contact.'),
16
+ annotations: { readOnlyHint: true, openWorldHint: true },
18
17
  };
19
18
  //# sourceMappingURL=get-contact-by-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-contact-by-id.js","sourceRoot":"","sources":["../../../src/tools/contacts/get-contact-by-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,cAAc,CAAC;AAEtE,MAAM,SAAS,GAAG,CAAC,WAAW,CAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,kCAAkC,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,CAAC,yDAAyD;IAC7J,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,yCAAyC,CAAC;KACvD,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;CACpC,CAAC"}
1
+ {"version":3,"file":"get-contact-by-id.js","sourceRoot":"","sources":["../../../src/tools/contacts/get-contact-by-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,SAAS,GAAG,CAAC,WAAW,CAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,2QAA2Q;IAC7Q,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;KAChE,CAAC;IACF,YAAY,EAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAC/C,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -1,14 +1,16 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest } from '../common.js';
2
+ import { contactField, envelope } from '../responses.js';
3
3
  const queryKeys = [];
4
4
  export const listContactFields = {
5
5
  name: 'listContactFields',
6
6
  title: 'List contact fields',
7
- description: `Required scope: contacts:read. ${describeHttpRequest('GET', '/v1/contacts/fields', queryKeys)} Full catalog of contact field definitions for the store. Not paginated.`,
7
+ description: "Full catalog of the store's contact field definitions. Not paginated. Call this first whenever a request names a field by its label — the ids, data types and select options here are what updateContactField takes, and what the customFields map on a contact is keyed by. Requires the contacts:read scope.",
8
+ scope: 'contacts:read',
8
9
  method: 'GET',
9
10
  path: '/v1/contacts/fields',
10
11
  queryKeys,
11
12
  inputSchema: z.object({}),
12
- annotations: { readOnlyHint: true },
13
+ outputSchema: envelope(z.array(contactField), 'Every contact field definition on the store.'),
14
+ annotations: { readOnlyHint: true, openWorldHint: true },
13
15
  };
14
16
  //# sourceMappingURL=list-contact-fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-contact-fields.js","sourceRoot":"","sources":["../../../src/tools/contacts/list-contact-fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,cAAc,CAAC;AAEtE,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,iBAAiB,GAAiB;IAC7C,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,kCAAkC,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,CAAC,0EAA0E;IACrL,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;CACpC,CAAC"}
1
+ {"version":3,"file":"list-contact-fields.js","sourceRoot":"","sources":["../../../src/tools/contacts/list-contact-fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,iBAAiB,GAAiB;IAC7C,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,gTAAgT;IAClT,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EACrB,8CAA8C,CAC/C;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -1,10 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest, paginationFields, } from '../common.js';
2
+ import { paginationFields } from '../common.js';
3
+ import { contact, envelope } from '../responses.js';
3
4
  const queryKeys = ['pageSize', 'cursor'];
4
5
  export const listContacts = {
5
6
  name: 'listContacts',
6
7
  title: 'List contacts',
7
- description: `Required scope: contacts:read. ${describeHttpRequest('POST', '/v1/contacts/list', queryKeys)} Search and page through contacts, most recently updated first.`,
8
+ description: 'Page through contacts, optionally filtered by a free-text search or an updated-at window. Ordered by most recently updated, or by relevance then recency when search is set; a whitespace-only search is treated as omitted. Use this to walk or sync the book; for ranked lookup of one person by name, email or phone, searchContacts is the better tool. Requires the contacts:read scope.',
9
+ scope: 'contacts:read',
8
10
  method: 'POST',
9
11
  path: '/v1/contacts/list',
10
12
  queryKeys,
@@ -14,16 +16,19 @@ export const listContacts = {
14
16
  .string()
15
17
  .max(100)
16
18
  .optional()
17
- .describe('JSON body. Free-text search across name, email, and phone. Maximum 100 characters.'),
19
+ .describe('Free-text match across name, email and phone. Maximum 100 characters.'),
18
20
  updatedAfter: z
19
21
  .string()
20
22
  .optional()
21
- .describe('JSON body. ISO 8601 date-time. Return only contacts updated on or after this time.'),
23
+ .describe('ISO 8601 date-time. Only contacts updated on or after this time.'),
22
24
  updatedBefore: z
23
25
  .string()
24
26
  .optional()
25
- .describe('JSON body. ISO 8601 date-time. Return only contacts updated before this time.'),
27
+ .describe('ISO 8601 date-time. Only contacts updated before this time.'),
26
28
  }),
27
- annotations: { readOnlyHint: true },
29
+ outputSchema: envelope(z.array(contact), 'A page of contacts.', {
30
+ paginated: true,
31
+ }),
32
+ annotations: { readOnlyHint: true, openWorldHint: true },
28
33
  };
29
34
  //# sourceMappingURL=list-contacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-contacts.js","sourceRoot":"","sources":["../../../src/tools/contacts/list-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GAEjB,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAU,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kCAAkC,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,SAAS,CAAC,iEAAiE;IAC3K,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,mBAAmB;IACzB,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,GAAG,gBAAgB;QACnB,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,oFAAoF,CACrF;QACH,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,oFAAoF,CACrF;QACH,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,+EAA+E,CAChF;KACJ,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;CACpC,CAAC"}
1
+ {"version":3,"file":"list-contacts.js","sourceRoot":"","sources":["../../../src/tools/contacts/list-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAqB,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAU,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,+XAA+X;IACjY,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,mBAAmB;IACzB,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,GAAG,gBAAgB;QACnB,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uEAAuE,CACxE;QACH,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,kEAAkE,CACnE;QACH,aAAa,EAAE,CAAC;aACb,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;KAC3E,CAAC;IACF,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,qBAAqB,EAAE;QAC9D,SAAS,EAAE,IAAI;KAChB,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { cursor, searchQuery } from '../common.js';
3
+ import { contactSearchHit, envelope } from '../responses.js';
4
+ const queryKeys = ['query', 'cursor'];
5
+ export const searchContacts = {
6
+ name: 'searchContacts',
7
+ title: 'Search contacts',
8
+ description: 'Find contacts by name, email, phone, address or note when you do not have a contact id. Returns 10 hits per page, most relevant first, each listing the fields that matched. A hit is a summary, not the full record — call getContactById with the id for custom fields and the timestamps the write tools need. Page with cursor alone; this operation does not accept pageSize. Requires the contacts:read scope.',
9
+ scope: 'contacts:read',
10
+ method: 'GET',
11
+ path: '/v1/contacts/search',
12
+ queryKeys,
13
+ inputSchema: z.object({
14
+ query: searchQuery,
15
+ cursor,
16
+ }),
17
+ outputSchema: envelope(z.array(contactSearchHit), 'Matching contacts, most relevant first. Up to 10 per page.', { paginated: true }),
18
+ annotations: { readOnlyHint: true, openWorldHint: true },
19
+ };
20
+ //# sourceMappingURL=search-contacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-contacts.js","sourceRoot":"","sources":["../../../src/tools/contacts/search-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,sZAAsZ;IACxZ,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,WAAW;QAClB,MAAM;KACP,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,EACzB,4DAA4D,EAC5D,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -1,25 +1,30 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest, fieldValue, } from '../common.js';
2
+ import { fieldValue } from '../common.js';
3
3
  const queryKeys = [];
4
4
  export const updateContactField = {
5
5
  name: 'updateContactField',
6
6
  title: 'Update a contact field value',
7
- description: `Required scope: contacts:write. ${describeHttpRequest('PATCH', '/v1/contacts/fields', queryKeys)} Set or clear a custom field. Pass the customFieldsUpdatedAt you last read as updatedAt; a mismatch is rejected with 409.`,
7
+ description: 'Set or clear one custom field on a contact. Resolve contactFieldId with listContactFields and read the contact first: updatedAt must be the customFieldsUpdatedAt from that read, or the contact’s updatedAt when the contact has no custom field writes yet. A stale value is rejected with 409 — re-read and retry. Send null as value to clear. The response is only an acknowledgement, so re-read with getContactById to confirm. Requires the contacts:write scope.',
8
+ scope: 'contacts:write',
8
9
  method: 'PATCH',
9
10
  path: '/v1/contacts/fields',
10
11
  queryKeys,
11
12
  inputSchema: z.object({
12
- contactId: z.string().min(1).describe('JSON body. The ID of the contact.'),
13
+ contactId: z.string().min(1).describe('The ID of the contact.'),
13
14
  contactFieldId: z
14
15
  .string()
15
16
  .min(1)
16
- .describe('JSON body. The ID of the contact field to update.'),
17
- value: fieldValue.describe('JSON body. New value for the field. Send null to clear it. Must match the field definition.'),
17
+ .describe('The ID of the contact field, from listContactFields.'),
18
+ value: fieldValue.describe('New value, matching the field dataType and any select options. Send null to clear.'),
18
19
  updatedAt: z
19
20
  .string()
20
21
  .min(1)
21
- .describe('JSON body. ISO 8601 date-time. Pass customFieldsUpdatedAt from the last read, or the contact updatedAt when customFieldsUpdatedAt is absent.'),
22
+ .describe('ISO 8601 date-time. The customFieldsUpdatedAt from the last read, or the contact updatedAt when customFieldsUpdatedAt is absent.'),
22
23
  }),
23
- annotations: { readOnlyHint: false, destructiveHint: false },
24
+ annotations: {
25
+ readOnlyHint: false,
26
+ destructiveHint: false,
27
+ openWorldHint: true,
28
+ },
24
29
  };
25
30
  //# sourceMappingURL=update-contact-field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-contact-field.js","sourceRoot":"","sources":["../../../src/tools/contacts/update-contact-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,UAAU,GAEX,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,mCAAmC,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,SAAS,CAAC,2HAA2H;IACzO,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;QAC1E,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mDAAmD,CAAC;QAChE,KAAK,EAAE,UAAU,CAAC,QAAQ,CACxB,6FAA6F,CAC9F;QACD,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,8IAA8I,CAC/I;KACJ,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;CAC7D,CAAC"}
1
+ {"version":3,"file":"update-contact-field.js","sourceRoot":"","sources":["../../../src/tools/contacts/update-contact-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAC;AAE7D,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,2cAA2c;IAC7c,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAC/D,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,sDAAsD,CAAC;QACnE,KAAK,EAAE,UAAU,CAAC,QAAQ,CACxB,oFAAoF,CACrF;QACD,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kIAAkI,CACnI;KACJ,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest, expand, paginationFields, paginationQueryKeys, } from '../common.js';
2
+ import { expand, paginationFields, paginationQueryKeys, } from '../common.js';
3
+ import { conversation, envelope } from '../responses.js';
3
4
  const queryKeys = ['conversationId', 'contactId', ...paginationQueryKeys];
4
- const filterConversationsExpand = expand('Pass account to replace accountId with { id, name, channel }. assignee is not valid on conversations.');
5
5
  export const filterConversations = {
6
6
  name: 'filterConversations',
7
7
  title: 'Filter conversations by ID or contact',
8
- description: `Required scope: conversations:read. ${describeHttpRequest('GET', '/v1/conversations', queryKeys)} Send conversationId and/or contactId — at least one is required. Paginate with pageSize (max 100) and cursor. Pass expand=account to replace accountId.`,
8
+ description: 'Fetch conversations by id, or every conversation belonging to one contact. Returns the thread record itself: channel, contact, current labelIds, unread count and a last-message snippet. There is no way to list conversations without an id — to find one, start from listTickets, searchMessages or a contact. Requires the conversations:read scope.',
9
+ scope: 'conversations:read',
9
10
  method: 'GET',
10
11
  path: '/v1/conversations',
11
12
  queryKeys,
@@ -15,18 +16,21 @@ export const filterConversations = {
15
16
  .string()
16
17
  .min(1)
17
18
  .optional()
18
- .describe('Query parameter. The ID of the conversation.'),
19
+ .describe('The ID of the conversation.'),
19
20
  contactId: z
20
21
  .string()
21
22
  .min(1)
22
23
  .optional()
23
- .describe('Query parameter. The ID of the contact.'),
24
+ .describe('Return every conversation this contact has, across channels.'),
24
25
  ...paginationFields,
25
- expand: filterConversationsExpand,
26
+ expand: expand(['account'], 'Replace accountId with { id, name, channel }.'),
26
27
  })
27
28
  .refine((value) => Boolean(value.conversationId || value.contactId), {
28
29
  message: 'Send conversationId and/or contactId.',
29
30
  }),
30
- annotations: { readOnlyHint: true },
31
+ outputSchema: envelope(z.array(conversation), 'The matching conversations.', {
32
+ paginated: true,
33
+ }),
34
+ annotations: { readOnlyHint: true, openWorldHint: true },
31
35
  };
32
36
  //# sourceMappingURL=filter-conversations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter-conversations.js","sourceRoot":"","sources":["../../../src/tools/conversations/filter-conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,MAAM,EACN,gBAAgB,EAChB,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG,CAAC,gBAAgB,EAAE,WAAW,EAAE,GAAG,mBAAmB,CAAC,CAAC;AAE1E,MAAM,yBAAyB,GAAG,MAAM,CACtC,uGAAuG,CACxG,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC/C,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,uCAAuC;IAC9C,WAAW,EAAE,uCAAuC,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,EAAE,SAAS,CAAC,0JAA0J;IACxQ,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,mBAAmB;IACzB,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,8CAA8C,CAAC;QAC3D,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,yCAAyC,CAAC;QACtD,GAAG,gBAAgB;QACnB,MAAM,EAAE,yBAAyB;KAClC,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,EAAE;QACnE,OAAO,EAAE,uCAAuC;KACjD,CAAC;IACJ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;CACpC,CAAC"}
1
+ {"version":3,"file":"filter-conversations.js","sourceRoot":"","sources":["../../../src/tools/conversations/filter-conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,SAAS,GAAG,CAAC,gBAAgB,EAAE,WAAW,EAAE,GAAG,mBAAmB,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAC/C,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,uCAAuC;IAC9C,WAAW,EACT,0VAA0V;IAC5V,KAAK,EAAE,oBAAoB;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,mBAAmB;IACzB,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,6BAA6B,CAAC;QAC1C,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,8DAA8D,CAC/D;QACH,GAAG,gBAAgB;QACnB,MAAM,EAAE,MAAM,CACZ,CAAC,SAAS,CAAC,EACX,+CAA+C,CAChD;KACF,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,EAAE;QACnE,OAAO,EAAE,uCAAuC;KACjD,CAAC;IACJ,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,6BAA6B,EAAE;QAC3E,SAAS,EAAE,IAAI;KAChB,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -1,23 +1,21 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest } from '../common.js';
3
2
  const queryKeys = [];
4
3
  export const markConversationRead = {
5
4
  name: 'markConversationRead',
6
5
  title: 'Mark a conversation as read',
7
- description: `Required scope: conversations:write. ${describeHttpRequest('PATCH', '/v1/conversations/read', queryKeys)} Clears the unread count on the conversation's open ticket. Idempotent. A conversation with no open ticket returns 404.`,
6
+ description: "Clear the unread count on the conversation's open ticket. Idempotent, so it is safe to repeat. A conversation with no open ticket returns 404. Requires the conversations:write scope.",
7
+ scope: 'conversations:write',
8
8
  method: 'PATCH',
9
9
  path: '/v1/conversations/read',
10
10
  queryKeys,
11
11
  inputSchema: z.object({
12
- conversationId: z
13
- .string()
14
- .min(1)
15
- .describe('JSON body. The ID of the conversation.'),
12
+ conversationId: z.string().min(1).describe('The ID of the conversation.'),
16
13
  }),
17
14
  annotations: {
18
15
  readOnlyHint: false,
19
16
  destructiveHint: false,
20
17
  idempotentHint: true,
18
+ openWorldHint: true,
21
19
  },
22
20
  };
23
21
  //# sourceMappingURL=mark-conversation-read.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mark-conversation-read.js","sourceRoot":"","sources":["../../../src/tools/conversations/mark-conversation-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,cAAc,CAAC;AAEtE,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,6BAA6B;IACpC,WAAW,EAAE,wCAAwC,mBAAmB,CAAC,OAAO,EAAE,wBAAwB,EAAE,SAAS,CAAC,yHAAyH;IAC/O,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,wBAAwB;IAC9B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,wCAAwC,CAAC;KACtD,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;KACrB;CACF,CAAC"}
1
+ {"version":3,"file":"mark-conversation-read.js","sourceRoot":"","sources":["../../../src/tools/conversations/mark-conversation-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,6BAA6B;IACpC,WAAW,EACT,wLAAwL;IAC1L,KAAK,EAAE,qBAAqB;IAC5B,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,wBAAwB;IAC9B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;KAC1E,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
@@ -1,33 +1,34 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest } from '../common.js';
3
2
  const queryKeys = [];
4
3
  const MAX_LABELS_PER_REQUEST = 10;
5
4
  export const updateConversationLabels = {
6
5
  name: 'updateConversationLabels',
7
6
  title: 'Update conversation labels',
8
- description: `Required scope: conversations:write. ${describeHttpRequest('PATCH', '/v1/conversations/labels', queryKeys)} Add and/or remove up to 10 labels. At least one of addLabels or removeLabels is required. Labels already applied (or not applied) are ignored.`,
7
+ description: 'Add and/or remove labels on a conversation, up to 10 of each per call. Labels live on the conversation, not on its tickets, so this affects every ticket on the thread. Both lists take existing label ids from listLabels — this does not create labels. At least one of addLabels or removeLabels is required; labels already applied, or already absent, are ignored. The response is only an acknowledgement, so re-read with filterConversations to confirm labelIds. Requires the conversations:write scope.',
8
+ scope: 'conversations:write',
9
9
  method: 'PATCH',
10
10
  path: '/v1/conversations/labels',
11
11
  queryKeys,
12
12
  inputSchema: z
13
13
  .object({
14
- conversationId: z
15
- .string()
16
- .min(1)
17
- .describe('JSON body. The ID of the conversation.'),
14
+ conversationId: z.string().min(1).describe('The ID of the conversation.'),
18
15
  addLabels: z
19
16
  .array(z.string())
20
17
  .max(MAX_LABELS_PER_REQUEST)
21
18
  .optional()
22
- .describe('JSON body. Existing label IDs to add. Maximum 10.'),
19
+ .describe('Existing label IDs to add, from listLabels. Maximum 10.'),
23
20
  removeLabels: z
24
21
  .array(z.string())
25
22
  .max(MAX_LABELS_PER_REQUEST)
26
23
  .optional()
27
- .describe('JSON body. Existing label IDs to remove. Maximum 10.'),
24
+ .describe('Existing label IDs to remove, from listLabels. Maximum 10.'),
28
25
  })
29
26
  .refine((value) => (value.addLabels?.length ?? 0) > 0 ||
30
27
  (value.removeLabels?.length ?? 0) > 0, { message: 'Send addLabels and/or removeLabels.' }),
31
- annotations: { readOnlyHint: false, destructiveHint: false },
28
+ annotations: {
29
+ readOnlyHint: false,
30
+ destructiveHint: false,
31
+ openWorldHint: true,
32
+ },
32
33
  };
33
34
  //# sourceMappingURL=update-conversation-labels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-conversation-labels.js","sourceRoot":"","sources":["../../../src/tools/conversations/update-conversation-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,cAAc,CAAC;AAEtE,MAAM,SAAS,GAAG,EAAW,CAAC;AAC9B,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,wBAAwB,GAAiB;IACpD,IAAI,EAAE,0BAA0B;IAChC,KAAK,EAAE,4BAA4B;IACnC,WAAW,EAAE,wCAAwC,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,EAAE,SAAS,CAAC,iJAAiJ;IACzQ,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,0BAA0B;IAChC,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,wCAAwC,CAAC;QACrD,SAAS,EAAE,CAAC;aACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,sBAAsB,CAAC;aAC3B,QAAQ,EAAE;aACV,QAAQ,CAAC,mDAAmD,CAAC;QAChE,YAAY,EAAE,CAAC;aACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,sBAAsB,CAAC;aAC3B,QAAQ,EAAE;aACV,QAAQ,CAAC,sDAAsD,CAAC;KACpE,CAAC;SACD,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;QAClC,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EACvC,EAAE,OAAO,EAAE,qCAAqC,EAAE,CACnD;IACH,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;CAC7D,CAAC"}
1
+ {"version":3,"file":"update-conversation-labels.js","sourceRoot":"","sources":["../../../src/tools/conversations/update-conversation-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAC9B,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,wBAAwB,GAAiB;IACpD,IAAI,EAAE,0BAA0B;IAChC,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,ofAAof;IACtf,KAAK,EAAE,qBAAqB;IAC5B,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,0BAA0B;IAChC,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,SAAS,EAAE,CAAC;aACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,sBAAsB,CAAC;aAC3B,QAAQ,EAAE;aACV,QAAQ,CAAC,yDAAyD,CAAC;QACtE,YAAY,EAAE,CAAC;aACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;aACjB,GAAG,CAAC,sBAAsB,CAAC;aAC3B,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;KAC1E,CAAC;SACD,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CACR,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;QAClC,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EACvC,EAAE,OAAO,EAAE,qCAAqC,EAAE,CACnD;IACH,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
@@ -14,8 +14,15 @@ import { listTeams } from './teams/list-teams.js';
14
14
  import { listTicketFields } from './tickets/list-ticket-fields.js';
15
15
  import { listTickets } from './tickets/list-tickets.js';
16
16
  import { listUsers } from './users/list-users.js';
17
+ import { listWhatsappTemplates } from './accounts/list-whatsapp-templates.js';
17
18
  import { markConversationRead } from './conversations/mark-conversation-read.js';
19
+ import { searchContacts } from './contacts/search-contacts.js';
20
+ import { searchMessages } from './messages/search-messages.js';
21
+ import { sendEmail } from './messages/send-email.js';
22
+ import { sendNewEmail } from './messages/send-new-email.js';
23
+ import { sendNewWhatsappTemplate } from './messages/send-new-whatsapp-template.js';
18
24
  import { sendPlainTextMessage } from './messages/send-plain-text-message.js';
25
+ import { sendWhatsappTemplate } from './messages/send-whatsapp-template.js';
19
26
  import { updateContactField } from './contacts/update-contact-field.js';
20
27
  import { updateConversationLabels } from './conversations/update-conversation-labels.js';
21
28
  import { updateTicketField } from './tickets/update-ticket-field.js';
@@ -29,18 +36,25 @@ export const tools = [
29
36
  markConversationRead,
30
37
  updateConversationLabels,
31
38
  getContactById,
39
+ searchContacts,
32
40
  listContacts,
33
41
  listContactFields,
34
42
  createContact,
35
43
  updateContactField,
36
44
  getMessages,
45
+ searchMessages,
37
46
  listInternalComments,
38
47
  createInternalComment,
39
48
  sendPlainTextMessage,
49
+ sendNewEmail,
50
+ sendEmail,
51
+ sendWhatsappTemplate,
52
+ sendNewWhatsappTemplate,
40
53
  listUsers,
41
54
  listLabels,
42
55
  listTeams,
43
56
  listAccounts,
57
+ listWhatsappTemplates,
44
58
  ];
45
59
  export function splitInput(input, queryKeys) {
46
60
  const query = {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MA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,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC"}
@@ -1,10 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest, paginationFields, } from '../common.js';
2
+ import { paginationFields } from '../common.js';
3
+ import { envelope, label } from '../responses.js';
3
4
  const queryKeys = ['searchTerm', 'pageSize', 'cursor'];
4
5
  export const listLabels = {
5
6
  name: 'listLabels',
6
7
  title: 'List labels',
7
- description: `Required scope: labels:read. ${describeHttpRequest('GET', '/v1/labels', queryKeys)} Labels for the store, most recently updated first. searchTerm must be 3–100 characters. Whitespace-only searchTerm is treated as omitted.`,
8
+ description: 'Page through the labels defined on the store, most recently updated first. Labels are applied to conversations, not tickets — resolve a label name to its id here before calling updateConversationLabels, which only accepts ids that already exist. searchTerm must be 3 to 100 characters; a shorter one is rejected, and a whitespace-only one is treated as omitted. Requires the labels:read scope.',
9
+ scope: 'labels:read',
8
10
  method: 'GET',
9
11
  path: '/v1/labels',
10
12
  queryKeys,
@@ -14,9 +16,10 @@ export const listLabels = {
14
16
  .min(3)
15
17
  .max(100)
16
18
  .optional()
17
- .describe('Query parameter. Optional case-insensitive search on the label text. 3–100 characters.'),
19
+ .describe('Case-insensitive match on the label text. 3 to 100 characters. Omit to list everything.'),
18
20
  ...paginationFields,
19
21
  }),
20
- annotations: { readOnlyHint: true },
22
+ outputSchema: envelope(z.array(label), 'A page of labels, most recently updated first.', { paginated: true }),
23
+ annotations: { readOnlyHint: true, openWorldHint: true },
21
24
  };
22
25
  //# sourceMappingURL=list-labels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-labels.js","sourceRoot":"","sources":["../../../src/tools/labels/list-labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GAEjB,MAAM,cAAc,CAAC;AAEtB,MAA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ACR,QAAQ,EAAE;aACV,QAAQ,CACP,yFAAyF,CAC1F;QACH,GAAG,gBAAgB;KACpB,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACd,gDAAgD,EAChD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -1,23 +1,24 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest } from '../common.js';
3
2
  const queryKeys = [];
4
3
  export const createInternalComment = {
5
4
  name: 'createInternalComment',
6
5
  title: 'Add an internal comment',
7
- description: `Required scope: messages:write. ${describeHttpRequest('POST', '/v1/messages/internal-comments', queryKeys)} Add a seller-private note. Not sent to the customer.`,
6
+ description: 'Leave a seller-private note on a conversation. It is visible to the team only and is never delivered to the customer — use sendPlainTextMessage for anything the customer should see. The response is only an acknowledgement, so re-read with listInternalComments to confirm. Requires the messages:write scope.',
7
+ scope: 'messages:write',
8
8
  method: 'POST',
9
9
  path: '/v1/messages/internal-comments',
10
10
  queryKeys,
11
11
  inputSchema: z.object({
12
- conversationId: z
13
- .string()
14
- .min(1)
15
- .describe('JSON body. The ID of the conversation.'),
12
+ conversationId: z.string().min(1).describe('The ID of the conversation.'),
16
13
  text: z
17
14
  .string()
18
15
  .min(1)
19
- .describe('JSON body. Internal comment text. Not sent to the customer.'),
16
+ .describe('Internal comment text. Seller-private, not sent to the customer.'),
20
17
  }),
21
- annotations: { readOnlyHint: false, destructiveHint: false },
18
+ annotations: {
19
+ readOnlyHint: false,
20
+ destructiveHint: false,
21
+ openWorldHint: true,
22
+ },
22
23
  };
23
24
  //# sourceMappingURL=create-internal-comment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-internal-comment.js","sourceRoot":"","sources":["../../../src/tools/messages/create-internal-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,cAAc,CAAC;AAEtE,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,mCAAmC,mBAAmB,CAAC,MAAM,EAAE,gCAAgC,EAAE,SAAS,CAAC,uDAAuD;IAC/K,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,gCAAgC;IACtC,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,wCAAwC,CAAC;QACrD,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,6DAA6D,CAAC;KAC3E,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;CAC7D,CAAC"}
1
+ {"version":3,"file":"create-internal-comment.js","sourceRoot":"","sources":["../../../src/tools/messages/create-internal-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAW,CAAC;AAE9B,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,oTAAoT;IACtT,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,gCAAgC;IACtC,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACP,kEAAkE,CACnE;KACJ,CAAC;IACF,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { cursor, describeHttpRequest, expand, messagePageSize, } from '../common.js';
2
+ import { cursor, expand, messagePageSize, } from '../common.js';
3
+ import { envelope, message } from '../responses.js';
3
4
  const queryKeys = [
4
5
  'conversationId',
5
6
  'ticketId',
@@ -7,11 +8,11 @@ const queryKeys = [
7
8
  'cursor',
8
9
  'expand',
9
10
  ];
10
- const getMessagesExpand = expand('Pass sentBy,conversation,account to add related names. Those ids stay on the message.');
11
11
  export const getMessages = {
12
12
  name: 'getMessages',
13
13
  title: 'List messages',
14
- description: `Required scope: messages:read. ${describeHttpRequest('GET', '/v1/messages', queryKeys)} Customer-facing messages, newest first. Events and internal comments are excluded. Send conversationId and/or ticketId — at least one is required. When ticketId is set, results are limited to that ticket's time window. pageSize defaults to 15 and cannot exceed 15.`,
14
+ description: "Read the customer-facing messages on a thread, newest first. System events and internal comments are excluded — use listInternalComments for the private notes. Send conversationId for the whole thread, ticketId to narrow to one ticket's time window, or both. At least one is required. pageSize defaults to 15 and accepts up to 100, so ask for more in one call rather than walking the cursor. Requires the messages:read scope.",
15
+ scope: 'messages:read',
15
16
  method: 'GET',
16
17
  path: '/v1/messages',
17
18
  queryKeys,
@@ -21,19 +22,20 @@ export const getMessages = {
21
22
  .string()
22
23
  .min(1)
23
24
  .optional()
24
- .describe('Query parameter. The ID of the conversation.'),
25
+ .describe('The ID of the conversation.'),
25
26
  ticketId: z
26
27
  .string()
27
28
  .min(1)
28
29
  .optional()
29
- .describe("Query parameter. The ID of the ticket. When set, results are limited to that ticket's time window."),
30
+ .describe("The ID of the ticket. Narrows results to that ticket's time window."),
30
31
  pageSize: messagePageSize,
31
32
  cursor,
32
- expand: getMessagesExpand,
33
+ expand: expand(['sentBy', 'conversation', 'account'], 'Add the named object beside the message. The underlying ids stay on the message.'),
33
34
  })
34
35
  .refine((value) => Boolean(value.conversationId || value.ticketId), {
35
36
  message: 'Send conversationId and/or ticketId.',
36
37
  }),
37
- annotations: { readOnlyHint: true },
38
+ outputSchema: envelope(z.array(message), 'A page of customer-facing messages, newest first.', { paginated: true }),
39
+ annotations: { readOnlyHint: true, openWorldHint: true },
38
40
  };
39
41
  //# sourceMappingURL=get-messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-messages.js","sourceRoot":"","sources":["../../../src/tools/messages/get-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,eAAe,GAEhB,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG;IAChB,gBAAgB;IAChB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX,MAAM,iBAAiB,GAAG,MAAM,CAC9B,uFAAuF,CACxF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,kCAAkC,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,CAAC,2QAA2Q;IAC/W,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,8CAA8C,CAAC;QAC3D,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,oGAAoG,CACrG;QACH,QAAQ,EAAE,eAAe;QACzB,MAAM;QACN,MAAM,EAAE,iBAAiB;KAC1B,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE;QAClE,OAAO,EAAE,sCAAsC;KAChD,CAAC;IACJ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;CACpC,CAAC"}
1
+ {"version":3,"file":"get-messages.js","sourceRoot":"","sources":["../../../src/tools/messages/get-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,MAAM,EACN,eAAe,GAEhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,SAAS,GAAG;IAChB,gBAAgB;IAChB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;CACA,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,2aAA2a;IAC7a,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS;IACT,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,6BAA6B,CAAC;QAC1C,QAAQ,EAAE,CAAC;aACR,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,qEAAqE,CACtE;QACH,QAAQ,EAAE,eAAe;QACzB,MAAM;QACN,MAAM,EAAE,MAAM,CACZ,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,CAAC,EACrC,kFAAkF,CACnF;KACF,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE;QAClE,OAAO,EAAE,sCAAsC;KAChD,CAAC;IACJ,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAChB,mDAAmD,EACnD,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -1,21 +1,21 @@
1
1
  import { z } from 'zod';
2
- import { describeHttpRequest, expand, paginationFields, paginationQueryKeys, } from '../common.js';
2
+ import { expand, paginationFields, paginationQueryKeys, } from '../common.js';
3
+ import { envelope, internalComment } from '../responses.js';
3
4
  const queryKeys = ['conversationId', ...paginationQueryKeys];
4
5
  export const listInternalComments = {
5
6
  name: 'listInternalComments',
6
7
  title: 'List internal comments',
7
- description: `Required scope: messages:read. ${describeHttpRequest('GET', '/v1/messages/internal-comments', queryKeys)} Seller-private notes on a conversation, newest first. These do not reach the customer. Paginate with pageSize (max 100) and cursor.`,
8
+ description: 'Read the seller-private notes on a conversation, newest first. These never reached the customer and are not covered by searchMessages, so check them for context an agent left behind before answering. Requires the messages:read scope.',
9
+ scope: 'messages:read',
8
10
  method: 'GET',
9
11
  path: '/v1/messages/internal-comments',
10
12
  queryKeys,
11
13
  inputSchema: z.object({
12
- conversationId: z
13
- .string()
14
- .min(1)
15
- .describe('Query parameter. The ID of the conversation.'),
14
+ conversationId: z.string().min(1).describe('The ID of the conversation.'),
16
15
  ...paginationFields,
17
- expand: expand('Pass createdBy,conversation,account to resolve related names.'),
16
+ expand: expand(['createdBy', 'conversation', 'account'], 'Resolve the related names. createdBy replaces noteData.createdBy in place.'),
18
17
  }),
19
- annotations: { readOnlyHint: true },
18
+ outputSchema: envelope(z.array(internalComment), 'A page of internal comments, newest first.', { paginated: true }),
19
+ annotations: { readOnlyHint: true, openWorldHint: true },
20
20
  };
21
21
  //# sourceMappingURL=list-internal-comments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-internal-comments.js","sourceRoot":"","sources":["../../../src/tools/messages/list-internal-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,MAAM,EACN,gBAAgB,EAChB,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AAEtB,MAAM,SAAS,GAAG,CAAC,gBAAgB,EAAE,GAAG,mBAAmB,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,kCAAkC,mBAAmB,CAAC,KAAK,EAAE,gCAAgC,EAAE,SAAS,CAAC,sIAAsI;IAC5P,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,gCAAgC;IACtC,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,8CAA8C,CAAC;QAC3D,GAAG,gBAAgB;QACnB,MAAM,EAAE,MAAM,CACZ,+DAA+D,CAChE;KACF,CAAC;IACF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;CACpC,CAAC"}
1
+ {"version":3,"file":"list-internal-comments.js","sourceRoot":"","sources":["../../../src/tools/messages/list-internal-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,SAAS,GAAG,CAAC,gBAAgB,EAAE,GAAG,mBAAmB,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,2OAA2O;IAC7O,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,gCAAgC;IACtC,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,GAAG,gBAAgB;QACnB,MAAM,EAAE,MAAM,CACZ,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC,EACxC,4EAA4E,CAC7E;KACF,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,EACxB,4CAA4C,EAC5C,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { cursor, searchQuery } from '../common.js';
3
+ import { envelope, messageSearchHit } from '../responses.js';
4
+ const queryKeys = ['query', 'cursor'];
5
+ export const searchMessages = {
6
+ name: 'searchMessages',
7
+ title: 'Search messages',
8
+ description: 'Find conversations by what was said in them. This is the only way to reach a thread from message content, so start here when the request names a topic rather than a ticket, conversation or contact. Returns 10 hits per page, most relevant first; every hit carries conversationId, which getMessages reads in full and listTickets turns into the tickets on that thread. Searches customer-facing message text only — internal comments are not indexed. Page with cursor alone; this operation does not accept pageSize. Requires the messages:read scope.',
9
+ scope: 'messages:read',
10
+ method: 'GET',
11
+ path: '/v1/messages/search',
12
+ queryKeys,
13
+ inputSchema: z.object({
14
+ query: searchQuery,
15
+ cursor,
16
+ }),
17
+ outputSchema: envelope(z.array(messageSearchHit), 'Matching messages, most relevant first. Up to 10 per page.', { paginated: true }),
18
+ annotations: { readOnlyHint: true, openWorldHint: true },
19
+ };
20
+ //# sourceMappingURL=search-messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-messages.js","sourceRoot":"","sources":["../../../src/tools/messages/search-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,kiBAAkiB;IACpiB,KAAK,EAAE,eAAe;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,qBAAqB;IAC3B,SAAS;IACT,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,WAAW;QAClB,MAAM;KACP,CAAC;IACF,YAAY,EAAE,QAAQ,CACpB,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,EACzB,4DAA4D,EAC5D,EAAE,SAAS,EAAE,IAAI,EAAE,CACpB;IACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;CACzD,CAAC"}