Skip to main content
Glama
samihalawa

SMTP MCP Server

get-smtp-configs

Retrieve all SMTP server configurations for email sending, including connection details and authentication settings.

Instructions

Get all SMTP configurations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'get-smtp-configs' tool. Calls getSmtpConfigs() from config.ts and returns the SMTP configurations wrapped in a success object or an error message.
    async function handleGetSmtpConfigs() {
      try {
        const configs = await getSmtpConfigs();
        
        return {
          success: true,
          configs: configs
        };
      } catch (error) {
        logToFile('Error in handleGetSmtpConfigs:');
        logToFile(error instanceof Error ? error.message : 'Unknown error');
        return {
          success: false,
          message: error instanceof Error ? error.message : 'Unknown error'
        };
      }
  • Tool schema definition for 'get-smtp-configs', including name, description, and empty input schema (no parameters required). This is part of createToolDefinitions() used for MCP tool registration.
    "get-smtp-configs": {
      name: "get-smtp-configs",
      description: "Get all SMTP configurations",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • Core helper function that reads and returns the list of SMTP server configurations from the JSON config file, falling back to defaults on error.
    export async function getSmtpConfigs(): Promise<SmtpServerConfig[]> {
      try {
        const config = await fs.readJson(SMTP_CONFIG_FILE) as SmtpConfig;
        return config.smtpServers || [];
      } catch (error) {
        logToFile('Error reading SMTP config:');
        return DEFAULT_SMTP_CONFIG.smtpServers;
      }
    }
  • Registration/dispatch case in the main CallToolRequestSchema handler switch statement that routes 'get-smtp-configs' tool calls to the specific handler function.
    case "get-smtp-configs":
      return await handleGetSmtpConfigs();
  • Type definition for SMTP server configuration objects returned by the tool.
    export interface SmtpServerConfig {
      id: string;
      name: string;
      host: string;
      port: number;
      secure: boolean;
      auth: {
        user: string;
        pass: string;
      };
      isDefault: boolean;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Get all SMTP configurations' implies a read operation, but it doesn't specify whether this requires authentication, returns paginated results, includes error handling, or provides metadata. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 no wasted words. It's front-loaded with the core action ('Get all SMTP configurations'), making it immediately clear. Every word earns its place, and there's no redundant or verbose phrasing.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks context about return values (e.g., format, structure) or operational details. For a read-only tool with no output schema, more information on the response would improve completeness.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it correctly implies no inputs are required. A baseline of 4 is appropriate for zero-parameter tools with complete schema coverage.

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 'Get all SMTP configurations' clearly states the verb ('Get') and resource ('SMTP configurations'), making the purpose immediately understandable. It distinguishes from siblings like 'add-smtp-config' or 'update-smtp-config' by specifying retrieval rather than modification. However, it doesn't explicitly mention that it returns ALL configurations without filtering, which would make it fully specific.

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 existing configurations), exclusions (e.g., not for filtering), or comparisons to siblings like 'get-email-logs' or 'get-email-templates'. The agent must infer usage from the name alone.

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