mailosaur_messages_list
Retrieve summaries of messages from a Mailosaur server, with filtering by received date, pagination, and direction.
Instructions
List message summaries for a server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | Mailosaur server ID. | |
| options | No |
Implementation Reference
- src/index.ts:136-147 (handler)The tool handler for 'mailosaur_messages_list'. Calls mailosaur.messages.list(server, toMessageListOptions(options)) and returns the result.
server.tool( "mailosaur_messages_list", "List message summaries for a server.", { server: z.string().describe("Mailosaur server ID."), options: MessageListOptionsSchema.optional() }, async ({ server, options }) => { const result = await mailosaur.messages.list(server, toMessageListOptions(options)); return response(result); } ); - src/index.ts:31-36 (schema)Schema definition for MessageListOptions, used as the 'options' parameter of mailosaur_messages_list.
const MessageListOptionsSchema = z.object({ receivedAfter: z.string().datetime().optional(), page: z.number().int().min(0).optional(), itemsPerPage: z.number().int().min(1).max(1000).optional(), dir: z.enum(["Sent", "Received"]).optional() }); - src/index.ts:136-147 (registration)Registration of the tool via server.tool() with name 'mailosaur_messages_list', description, schema, and handler.
server.tool( "mailosaur_messages_list", "List message summaries for a server.", { server: z.string().describe("Mailosaur server ID."), options: MessageListOptionsSchema.optional() }, async ({ server, options }) => { const result = await mailosaur.messages.list(server, toMessageListOptions(options)); return response(result); } ); - src/index.ts:75-77 (helper)Helper function toMessageListOptions that converts the Zod schema options to the Mailosaur SDK's MessageListOptions type, including date parsing.
function toMessageListOptions(options: z.infer<typeof MessageListOptionsSchema> | undefined): MessageListOptions | undefined { return parseDateOptions(options) as MessageListOptions | undefined; }