You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text: z.string().describe('Plain text email content'),
50
50
html: z
51
51
.string()
52
52
.optional()
53
53
.describe(
54
-
"HTML email content. When provided, the plain text argument MUST be provided as well."
54
+
'HTML email content. When provided, the plain text argument MUST be provided as well.',
55
55
),
56
56
cc: z
57
57
.string()
58
58
.email()
59
59
.array()
60
60
.optional()
61
-
.describe("Optional array of CC email addresses. You MUST ask the user for this parameter. Under no circumstance provide it yourself"),
61
+
.describe(
62
+
'Optional array of CC email addresses. You MUST ask the user for this parameter. Under no circumstance provide it yourself',
63
+
),
62
64
bcc: z
63
65
.string()
64
66
.email()
65
67
.array()
66
68
.optional()
67
-
.describe("Optional array of BCC email addresses. You MUST ask the user for this parameter. Under no circumstance provide it yourself"),
69
+
.describe(
70
+
'Optional array of BCC email addresses. You MUST ask the user for this parameter. Under no circumstance provide it yourself',
71
+
),
68
72
scheduledAt: z
69
73
.string()
70
74
.optional()
71
75
.describe(
72
-
"Optional parameter to schedule the email. This uses natural language. Examples would be 'tomorrow at 10am' or 'in 2 hours' or 'next day at 9am PST' or 'Friday at 3pm ET'."
76
+
"Optional parameter to schedule the email. This uses natural language. Examples would be 'tomorrow at 10am' or 'in 2 hours' or 'next day at 9am PST' or 'Friday at 3pm ET'.",
73
77
),
74
78
// If sender email address is not provided, the tool requires it as an argument
75
79
...(!senderEmailAddress
@@ -79,7 +83,7 @@ server.tool(
79
83
.email()
80
84
.nonempty()
81
85
.describe(
82
-
"Sender email address. You MUST ask the user for this parameter. Under no circumstance provide it yourself"
86
+
'Sender email address. You MUST ask the user for this parameter. Under no circumstance provide it yourself',
83
87
),
84
88
}
85
89
: {}),
@@ -91,7 +95,7 @@ server.tool(
91
95
.array()
92
96
.optional()
93
97
.describe(
94
-
"Optional email addresses for the email readers to reply to. You MUST ask the user for this parameter. Under no circumstance provide it yourself"
98
+
'Optional email addresses for the email readers to reply to. You MUST ask the user for this parameter. Under no circumstance provide it yourself',
95
99
),
96
100
}
97
101
: {}),
@@ -102,20 +106,20 @@ server.tool(
102
106
103
107
// Type check on from, since "from" is optionally included in the arguments schema
104
108
// This should never happen.
105
-
if(typeoffromEmailAddress!=="string"){
106
-
thrownewError("from argument must be provided.");
109
+
if(typeoffromEmailAddress!=='string'){
110
+
thrownewError('from argument must be provided.');
107
111
}
108
112
109
113
// Similar type check for "reply-to" email addresses.
110
114
if(
111
-
typeofreplyToEmailAddresses!=="string"&&
115
+
typeofreplyToEmailAddresses!=='string'&&
112
116
!Array.isArray(replyToEmailAddresses)
113
117
){
114
-
thrownewError("replyTo argument must be provided.");
118
+
thrownewError('replyTo argument must be provided.');
115
119
}
116
120
117
121
console.error(`Debug - Sending email with from: ${fromEmailAddress}`);
118
-
122
+
119
123
// Explicitly structure the request with all parameters to ensure they're passed correctly
`Email failed to send: ${JSON.stringify(response.error)}`
165
+
`Email failed to send: ${JSON.stringify(response.error)}`,
162
166
);
163
167
}
164
168
165
169
return{
166
170
content: [
167
171
{
168
-
type: "text",
172
+
type: 'text',
169
173
text: `Email sent successfully! ${JSON.stringify(response.data)}`,
170
174
},
171
175
],
172
176
};
173
-
}
177
+
},
178
+
);
179
+
180
+
server.tool(
181
+
'list-audiences',
182
+
'List all audiences from Resend. This tool is useful for getting the audience ID to help the user find the audience they want to use for other tools. If you need an audience ID, you MUST use this tool to get all available audiences and then ask the user to select the audience they want to use.',
183
+
{},
184
+
async()=>{
185
+
console.error('Debug - Listing audiences');
186
+
187
+
constresponse=awaitresend.audiences.list();
188
+
189
+
if(response.error){
190
+
thrownewError(
191
+
`Failed to list audiences: ${JSON.stringify(response.error)}`,
0 commit comments