Skip to main content
Glama
samihalawa

SMTP MCP Server

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 [];
      }
    } 
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets logs' but doesn't describe key behaviors: whether this is a read-only operation (implied but not explicit), how logs are structured (e.g., format, fields), if there are rate limits, authentication requirements, or pagination details. For a log retrieval tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—'Get logs of all email sending activity' directly conveys the core function without fluff. It's appropriately sized for a simple tool and front-loaded with the essential action, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (log retrieval with filtering), lack of annotations, and no output schema, the description is incomplete. It doesn't cover return values (e.g., log format, fields), error handling, or behavioral constraints like ordering (implied 'most recent first' in schema but not in description). For a tool with two parameters and no structured output, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters (limit and filterBySuccess). The description adds no additional meaning beyond what's in the schema—it doesn't explain parameter interactions, default values, or usage examples. With high schema coverage, the baseline is 3, and the description doesn't compensate with extra insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('logs of all email sending activity'), making the purpose unambiguous. It distinguishes from siblings like send-email or get-email-templates by focusing on logs rather than templates, configs, or sending operations. However, it doesn't explicitly contrast with all siblings (e.g., get-smtp-configs also retrieves data), so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing logs to exist), exclusions (e.g., not for real-time monitoring), or comparisons to other tools (e.g., how it differs from get-email-templates for template-related logs). This leaves the agent with minimal context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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