Skip to main content
Glama

get-email-logs

Retrieve and filter email sending activity logs to monitor delivery status and troubleshoot issues.

Instructions

Get logs of all email sending activity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of log entries to return (most recent first)
filterBySuccessNoFilter logs by success status (true = successful emails, false = failed emails)

Implementation Reference

  • Executes the get-email-logs tool: calls getEmailLogs, applies optional filtering by success, sorts by timestamp descending, limits results, and returns them.
    case "get-email-logs": { const { limit, filterBySuccess } = toolParams as { limit?: number; filterBySuccess?: boolean; }; try { let logs = await getEmailLogs(); // Filter by success status if specified if (filterBySuccess !== undefined) { logs = logs.filter((log: EmailLogEntry) => log.success === filterBySuccess); } // Sort by timestamp in descending order (newest first) logs = logs.sort((a: EmailLogEntry, b: EmailLogEntry) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime() ); // Limit the number of results if specified if (limit && limit > 0) { logs = logs.slice(0, limit); } return { result: logs }; } catch (error) { logToFile(`Error getting email logs: ${error}`); throw new Error("Failed to retrieve email logs"); } }
  • Tool definition including name, description, and input schema for get-email-logs.
    "get-email-logs": { name: "get-email-logs", description: "Get logs of all email sending activity", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of log entries to return (most recent first)" }, filterBySuccess: { type: "boolean", description: "Filter logs by success status (true = successful emails, false = failed emails)" } } } }
  • Reads email log entries from the JSON log file, returns empty array if not found or on error.
    export async function getEmailLogs(): Promise<EmailLogEntry[]> { try { if (await fs.pathExists(LOG_FILE)) { return await fs.readJson(LOG_FILE) as EmailLogEntry[]; } return []; } catch (error) { logToFile('Error reading email logs:'); return []; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/samihalawa/mcp-server-smtp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server