Skip to main content
Glama
samihalawa

SMTP MCP Server

add-smtp-config

Configure SMTP server settings for sending emails by specifying host, port, credentials, and security options. Add multiple configurations to manage email delivery through the SMTP MCP Server.

Instructions

Add a new SMTP configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the SMTP configuration
hostYesSMTP host
portYesSMTP port
secureNoWhether to use secure connection (SSL/TLS)
userYesSMTP username
passYesSMTP password
isDefaultNoWhether this configuration should be the default

Implementation Reference

  • The main handler function that executes the 'add-smtp-config' tool. It generates a unique ID, creates the SMTP config object from parameters, handles setting as default by unsetting others, appends to list, and saves.
    async function handleAddSmtpConfig(parameters: any) {
      try {
        // Get existing configs
        const configs = await getSmtpConfigs();
        
        // Create a new config
        const newConfig: SmtpServerConfig = {
          id: generateUUID(),
          name: parameters.name,
          host: parameters.host,
          port: parameters.port,
          secure: parameters.secure ?? false,
          auth: {
            user: parameters.user,
            pass: parameters.pass
          },
          isDefault: parameters.isDefault ?? false
        };
        
        // If this is set as default, update other configs
        if (newConfig.isDefault) {
          configs.forEach(config => {
            config.isDefault = false;
          });
        }
        
        // Add the new config to the list
        configs.push(newConfig);
        
        // Save the updated configs
        await saveSmtpConfigs(configs);
        
        return {
          success: true,
          config: newConfig
        };
      } catch (error) {
        logToFile('Error in handleAddSmtpConfig:');
        logToFile(error instanceof Error ? error.message : 'Unknown error');
        return {
          success: false,
          message: error instanceof Error ? error.message : 'Unknown error'
        };
      }
    }
  • The tool schema definition for 'add-smtp-config', including input schema with properties and required fields.
    "add-smtp-config": {
      name: "add-smtp-config",
      description: "Add a new SMTP configuration",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Name of the SMTP configuration"
          },
          host: {
            type: "string",
            description: "SMTP host"
          },
          port: {
            type: "number",
            description: "SMTP port"
          },
          secure: {
            type: "boolean",
            description: "Whether to use secure connection (SSL/TLS)"
          },
          user: {
            type: "string",
            description: "SMTP username"
          },
          pass: {
            type: "string",
            description: "SMTP password"
          },
          isDefault: {
            type: "boolean",
            description: "Whether this configuration should be the default"
          }
        },
        required: ["name", "host", "port", "user", "pass"]
      }
    },
  • The switch case registration in the CallToolRequestHandler that dispatches 'add-smtp-config' tool calls to the specific handler function.
    case "add-smtp-config":
      return await handleAddSmtpConfig(toolParams);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a write operation ('Add') but doesn't disclose critical traits like required permissions, whether it's idempotent, how conflicts are handled (e.g., duplicate names), or what happens on success/failure. This is inadequate for a mutation tool.

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 wasted words. It's front-loaded with the core action and resource, making it easy 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?

For a mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the tool returns, error conditions, or side effects (e.g., impact on email sending). Given the complexity of adding SMTP configurations, more context is needed for safe 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 fully documents all 7 parameters. The description adds no parameter-specific information beyond what's in the schema, such as format examples or constraints. Baseline 3 is appropriate when the schema does all the work.

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 ('Add') and resource ('SMTP configuration'), making the purpose immediately understandable. It distinguishes from siblings like 'update-smtp-config' by specifying 'new', though it doesn't explicitly contrast with all alternatives like 'get-smtp-configs'.

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 like 'update-smtp-config' or 'delete-smtp-config'. It lacks context about prerequisites, such as whether existing configurations must be managed first, or when adding a new configuration is appropriate.

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