mailosaur_messages_create
Create and send email messages to verified external addresses, supporting attachments, CC, and HTML content.
Instructions
Create a message and optionally send it to a verified external address.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | Mailosaur server ID. | |
| to | Yes | ||
| cc | No | ||
| from | No | ||
| send | No | ||
| subject | No | ||
| text | No | ||
| html | No | ||
| attachments | No |
Implementation Reference
- src/index.ts:175-193 (registration)Registration of the 'mailosaur_messages_create' tool using server.tool() with name, description, Zod schema for inputs, and handler function.
server.tool( "mailosaur_messages_create", "Create a message and optionally send it to a verified external address.", { server: z.string().describe("Mailosaur server ID."), to: z.string(), cc: z.string().optional(), from: z.string().optional(), send: z.boolean().optional(), subject: z.string().optional(), text: z.string().optional(), html: z.string().optional(), attachments: z.array(AttachmentSchema).optional() }, async ({ server, ...message }) => { const result = await mailosaur.messages.create(server, message); return response(result); } ); - src/index.ts:178-188 (schema)Input schema for mailosaur_messages_create: server (string), to (string), cc (optional string), from (optional string), send (optional boolean), subject (optional string), text (optional string), html (optional string), attachments (optional array of AttachmentSchema).
{ server: z.string().describe("Mailosaur server ID."), to: z.string(), cc: z.string().optional(), from: z.string().optional(), send: z.boolean().optional(), subject: z.string().optional(), text: z.string().optional(), html: z.string().optional(), attachments: z.array(AttachmentSchema).optional() }, - src/index.ts:189-192 (handler)Handler function that destructures 'server' from args, passes remaining properties to mailosaur.messages.create(), and returns the result via the response() helper.
async ({ server, ...message }) => { const result = await mailosaur.messages.create(server, message); return response(result); } - src/index.ts:43-49 (schema)AttachmentSchema used by the tool's input: id (string), contentType (optional), fileName (optional), content (optional), contentId (optional).
const AttachmentSchema = z.object({ id: z.string(), contentType: z.string().optional(), fileName: z.string().optional(), content: z.string().optional(), contentId: z.string().optional() }); - src/index.ts:79-88 (helper)The response() helper function used by the handler to format the result as MCP text content.
function response(value: unknown) { return { content: [ { type: "text" as const, text: JSON.stringify(value, null, 2) } ] }; }