list_emails
Retrieve sent emails with delivery status and pagination support for monitoring transactional email performance.
Instructions
List sent emails with status information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of emails to return (default: 20) | |
| cursor | No | Pagination cursor for next page |
Implementation Reference
- src/index.ts:370-378 (handler)Handler for the 'list_emails' tool that constructs query parameters from input arguments (limit and cursor), makes an API request to '/api/emails', and returns the result as formatted JSON text.case 'list_emails': { const params = new URLSearchParams(); if (args?.limit) params.set('limit', String(args.limit)); if (args?.cursor) params.set('cursor', String(args.cursor)); const result = await apiRequest(`/api/emails?${params}`); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; }
- src/index.ts:122-134 (schema)Input schema defining optional parameters 'limit' (number) and 'cursor' (string) for the list_emails tool.inputSchema: { type: 'object' as const, properties: { limit: { type: 'number', description: 'Number of emails to return (default: 20)', }, cursor: { type: 'string', description: 'Pagination cursor for next page', }, }, },
- src/index.ts:119-135 (registration)Registration of the 'list_emails' tool in the tools list provided by the ListToolsRequestSchema handler, including name, description, and input schema.{ name: 'list_emails', description: 'List sent emails with status information', inputSchema: { type: 'object' as const, properties: { limit: { type: 'number', description: 'Number of emails to return (default: 20)', }, cursor: { type: 'string', description: 'Pagination cursor for next page', }, }, }, },