carlyemail-toolkit 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -42,7 +42,7 @@ Plain ES modules with no build step; types ship with it. `ai` and
42
42
 
43
43
  ## What is in it
44
44
 
45
- The 25 tools the hosted [MCP server](https://docs.carlyemail.com/mcp) serves —
45
+ The 26 tools the hosted [MCP server](https://docs.carlyemail.com/mcp) serves —
46
46
  inboxes, threads, messages, drafts, attachments, labels, and account
47
47
  verification — with the same names, descriptions and parameter schemas, called
48
48
  over the REST API. Pass names to take only some:
package/core.js CHANGED
@@ -180,7 +180,7 @@ async function deleteInbox(client, a) {
180
180
 
181
181
  async function listThreads(client, a) {
182
182
  const scope = await resolveScope(client, a.inbox_id);
183
- const q = query(a, ...PAGE, ...WINDOW, "labels", "ascending", "senders", "recipients", "subject");
183
+ const q = query(a, ...PAGE, ...WINDOW, "labels", "ascending", "senders", "recipients", "subject", "assignee");
184
184
  if (scope.inbox) return client.threads.list(scope.inbox, q);
185
185
  return guided(await client.threads.listOrg(q), scope);
186
186
  }
@@ -200,7 +200,7 @@ async function getThread(client, a) {
200
200
 
201
201
  async function updateThread(client, a) {
202
202
  const scope = await resolveScope(client, a.inbox_id);
203
- const body = pick(a, "add_labels", "remove_labels");
203
+ const body = pick(a, "add_labels", "remove_labels", "assignee_id");
204
204
  if (scope.inbox) return client.threads.update(scope.inbox, a.thread_id, body);
205
205
  return client.threads.updateOrg(a.thread_id, body);
206
206
  }
@@ -299,6 +299,11 @@ async function deleteDraft(client, a) {
299
299
  return { deleted: true, draft_id: a.draft_id };
300
300
  }
301
301
 
302
+ async function addNote(client, a) {
303
+ const inbox = await oneInbox(client, a.inbox_id);
304
+ return client.threads.addNote(inbox, a.thread_id, { text: a.text });
305
+ }
306
+
302
307
  async function authMe(client) {
303
308
  const out = { ...(await client.auth.whoami()) };
304
309
  // The first call a connected client makes, and so the earliest place a
@@ -315,6 +320,7 @@ async function verifyAccount(client, a) {
315
320
  }
316
321
 
317
322
  export const FUNCTIONS = {
323
+ add_note: addNote,
318
324
  auth_me: authMe,
319
325
  create_draft: createDraft,
320
326
  create_inbox: createInbox,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlyemail-toolkit",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "CarlyEmail's email tools for the Vercel AI SDK, LangChain, and any other agent framework.",
5
5
  "keywords": [
6
6
  "carlyemail",
@@ -54,7 +54,7 @@
54
54
  "node": ">=18"
55
55
  },
56
56
  "dependencies": {
57
- "carlyemail": "^0.6.0"
57
+ "carlyemail": "^0.6.6"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@langchain/core": ">=0.3",
package/tools.js CHANGED
@@ -1,8 +1,39 @@
1
1
  // Written by tools/gen_toolkit_tools.py in the API repository. Do not edit.
2
2
  export default {
3
- "source": "app/mcp/tools.py, written by tools/gen_toolkit_tools.py",
3
+ "source": "app/mcp/tools/, written by tools/gen_toolkit_tools.py",
4
4
  "first_inbox": "Ask the person what they want their email address to be \u2014 the part before the @ \u2014 then call create_inbox with it as `username`.",
5
5
  "tools": [
6
+ {
7
+ "name": "add_note",
8
+ "title": "Note on a conversation",
9
+ "description": "Leave a note on a conversation for the team. It is never sent to anyone outside the organization.",
10
+ "input_schema": {
11
+ "type": "object",
12
+ "properties": {
13
+ "thread_id": {
14
+ "type": "string",
15
+ "description": "Identifier of the conversation, as returned by list_threads."
16
+ },
17
+ "inbox_id": {
18
+ "type": "string",
19
+ "description": "Address of the inbox to act on, like agent@carlyemail.com. Optional when this key is scoped to one inbox or the organization has only one; required otherwise."
20
+ },
21
+ "text": {
22
+ "type": "string",
23
+ "description": "The note."
24
+ }
25
+ },
26
+ "required": [
27
+ "thread_id",
28
+ "text"
29
+ ],
30
+ "additionalProperties": false
31
+ },
32
+ "read_only": false,
33
+ "destructive": false,
34
+ "idempotent": false,
35
+ "open_world": false
36
+ },
6
37
  {
7
38
  "name": "auth_me",
8
39
  "title": "Check my access",
@@ -370,8 +401,8 @@ export default {
370
401
  },
371
402
  {
372
403
  "name": "get_attachment",
373
- "title": "Download an attachment",
374
- "description": "Get a download URL for an attachment.",
404
+ "title": "Read an attachment",
405
+ "description": "Read an attachment. Returns a download URL and extracted text for PDF and DOCX files. Use extracted_text to read the document; check text_status, text_truncated and text_warning for limits. Scanned images are not transcribed (no OCR).",
375
406
  "input_schema": {
376
407
  "type": "object",
377
408
  "properties": {
@@ -448,7 +479,7 @@ export default {
448
479
  {
449
480
  "name": "get_thread",
450
481
  "title": "Read a conversation",
451
- "description": "Get one thread with every message in it.",
482
+ "description": "Get one thread with every message in it, the team's notes on it, and any reply someone has started.",
452
483
  "input_schema": {
453
484
  "type": "object",
454
485
  "properties": {
@@ -645,6 +676,10 @@ export default {
645
676
  "type": "string",
646
677
  "description": "Only messages whose subject contains this text."
647
678
  },
679
+ "assignee": {
680
+ "type": "string",
681
+ "description": "Only conversations assigned to this member_id or api_key_id, to \"me\", or \"none\" for unassigned."
682
+ },
648
683
  "before": {
649
684
  "type": "string",
650
685
  "description": "Only items older than this ISO 8601 timestamp."
@@ -1200,7 +1235,7 @@ export default {
1200
1235
  {
1201
1236
  "name": "update_thread",
1202
1237
  "title": "Label a conversation",
1203
- "description": "Add or remove labels on a thread.",
1238
+ "description": "Add or remove labels on a thread, or hand it to a teammate or an agent.",
1204
1239
  "input_schema": {
1205
1240
  "type": "object",
1206
1241
  "properties": {
@@ -1225,6 +1260,10 @@ export default {
1225
1260
  "type": "string"
1226
1261
  },
1227
1262
  "description": "Labels to remove. Ones not present are ignored."
1263
+ },
1264
+ "assignee_id": {
1265
+ "type": "string",
1266
+ "description": "Who handles it: a member_id (from list_members), an api_key_id, or \"me\". Pass \"\" to unassign; leave it out to keep it."
1228
1267
  }
1229
1268
  },
1230
1269
  "required": [