carlyemail-toolkit 0.1.4 → 0.1.6

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 (3) hide show
  1. package/core.js +5 -3
  2. package/package.json +1 -1
  3. package/tools.js +4 -4
package/core.js CHANGED
@@ -113,7 +113,7 @@ export async function oneInbox(client, inboxId) {
113
113
  `This organization has ${scope.candidates.length} inboxes, so inbox_id is required.`,
114
114
  {
115
115
  code: "inbox_id_required",
116
- fix: `Ask the person which one to use — ${shown}${more} — and pass it as inbox_id. Do not pick for them.`,
116
+ fix: `Pass the one that fits this mail as inbox_id: ${shown}${more}.`,
117
117
  },
118
118
  );
119
119
  }
@@ -173,7 +173,7 @@ async function updateInbox(client, a) {
173
173
  async function deleteInbox(client, a) {
174
174
  const inbox = await oneInbox(client, a.inbox_id);
175
175
  // Only sent when true, so a refusal (`inbox_in_use`) reaches the model and
176
- // it has to ask the person before trying again with `force`.
176
+ // it decides whether to try again with `force`.
177
177
  await client.inboxes.delete(inbox, a.force === true ? { force: true } : {});
178
178
  return { deleted: true, inbox_id: inbox };
179
179
  }
@@ -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
- return client.messages.getAttachment(inbox, a.message_id, a.attachment_id);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carlyemail-toolkit",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "CarlyEmail's email tools for the Vercel AI SDK, LangChain, and any other agent framework.",
5
5
  "keywords": [
6
6
  "carlyemail",
package/tools.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Written by tools/gen_toolkit_tools.py in the API repository. Do not edit.
2
2
  export default {
3
3
  "source": "app/mcp/tools/, written by tools/gen_toolkit_tools.py",
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`.",
4
+ "first_inbox": "Create an inbox with create_inbox and carry on. Use the address the person asked for as `username` if they named one; otherwise choose it yourself.",
5
5
  "tools": [
6
6
  {
7
7
  "name": "add_note",
@@ -173,7 +173,7 @@ export default {
173
173
  {
174
174
  "name": "create_inbox",
175
175
  "title": "Create an inbox",
176
- "description": "Create a new inbox. Ask the person what they want the address to be before calling this; only omit `username` if they genuinely have no preference.",
176
+ "description": "Create a new inbox. Use the address the person asked for as `username`, or choose one yourself; omit it for a generated address.",
177
177
  "input_schema": {
178
178
  "type": "object",
179
179
  "properties": {
@@ -235,7 +235,7 @@ export default {
235
235
  {
236
236
  "name": "delete_inbox",
237
237
  "title": "Delete an inbox and its mail",
238
- "description": "Delete an inbox. Its messages go with it. An inbox that sent mail or whose key was used in the last 30 days is refused with `inbox_in_use`; ask the person before calling again with `force`.",
238
+ "description": "Delete an inbox. Its messages go with it. An inbox that sent mail or whose key was used in the last 30 days is refused with `inbox_in_use`; call again with `force` if you mean to delete it anyway.",
239
239
  "input_schema": {
240
240
  "type": "object",
241
241
  "properties": {
@@ -402,7 +402,7 @@ export default {
402
402
  {
403
403
  "name": "get_attachment",
404
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).",
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.",
406
406
  "input_schema": {
407
407
  "type": "object",
408
408
  "properties": {