carlyemail-toolkit 0.1.3 → 0.1.5
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 +1 -1
- package/core.js +9 -1
- package/package.json +2 -2
- package/tools.js +32 -1
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
|
|
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
|
@@ -245,7 +245,9 @@ async function updateMessage(client, a) {
|
|
|
245
245
|
|
|
246
246
|
async function getAttachment(client, a) {
|
|
247
247
|
const inbox = await oneInbox(client, a.inbox_id);
|
|
248
|
-
|
|
248
|
+
// A draft's id where a message's is asked for, as the hosted tool takes it.
|
|
249
|
+
const owner = String(a.message_id).startsWith("draft_") ? client.drafts : client.messages;
|
|
250
|
+
return owner.getAttachment(inbox, a.message_id, a.attachment_id);
|
|
249
251
|
}
|
|
250
252
|
|
|
251
253
|
async function createDraft(client, a) {
|
|
@@ -299,6 +301,11 @@ async function deleteDraft(client, a) {
|
|
|
299
301
|
return { deleted: true, draft_id: a.draft_id };
|
|
300
302
|
}
|
|
301
303
|
|
|
304
|
+
async function addNote(client, a) {
|
|
305
|
+
const inbox = await oneInbox(client, a.inbox_id);
|
|
306
|
+
return client.threads.addNote(inbox, a.thread_id, { text: a.text });
|
|
307
|
+
}
|
|
308
|
+
|
|
302
309
|
async function authMe(client) {
|
|
303
310
|
const out = { ...(await client.auth.whoami()) };
|
|
304
311
|
// The first call a connected client makes, and so the earliest place a
|
|
@@ -315,6 +322,7 @@ async function verifyAccount(client, a) {
|
|
|
315
322
|
}
|
|
316
323
|
|
|
317
324
|
export const FUNCTIONS = {
|
|
325
|
+
add_note: addNote,
|
|
318
326
|
auth_me: authMe,
|
|
319
327
|
create_draft: createDraft,
|
|
320
328
|
create_inbox: createInbox,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carlyemail-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
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.
|
|
57
|
+
"carlyemail": "^0.6.6"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@langchain/core": ">=0.3",
|
package/tools.js
CHANGED
|
@@ -3,6 +3,37 @@ export default {
|
|
|
3
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",
|
|
@@ -371,7 +402,7 @@ export default {
|
|
|
371
402
|
{
|
|
372
403
|
"name": "get_attachment",
|
|
373
404
|
"title": "Read an attachment",
|
|
374
|
-
"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).",
|
|
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). To read a file on a draft, pass its draft_id as message_id.",
|
|
375
406
|
"input_schema": {
|
|
376
407
|
"type": "object",
|
|
377
408
|
"properties": {
|