Skip to main content
Glama
samihalawa

SMTP MCP Server

update-smtp-config

Modify SMTP server settings for email sending in the SMTP MCP Server. Change host, port, security, credentials, or default status of existing configurations.

Instructions

Update an existing SMTP configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the SMTP configuration to update
nameNoName of the SMTP configuration
hostNoSMTP host
portNoSMTP port
secureNoWhether to use secure connection (SSL/TLS)
userNoSMTP username
passNoSMTP password
isDefaultNoWhether this configuration should be the default

Implementation Reference

  • The main handler function that executes the update-smtp-config tool logic: finds the SMTP config by ID, applies provided updates to its properties, manages default status across configs, and persists the changes using saveSmtpConfigs.
     * Handle update-smtp-config tool call
     */
    async function handleUpdateSmtpConfig(parameters: any) {
      try {
        // Get existing configs
        const configs = await getSmtpConfigs();
        
        // Find the config to update
        const configIndex = configs.findIndex(config => config.id === parameters.id);
        
        if (configIndex === -1) {
          return {
            success: false,
            message: `SMTP configuration with ID ${parameters.id} not found`
          };
        }
        
        // Update the config
        const updatedConfig = { ...configs[configIndex] };
        
        if (parameters.name !== undefined) updatedConfig.name = parameters.name;
        if (parameters.host !== undefined) updatedConfig.host = parameters.host;
        if (parameters.port !== undefined) updatedConfig.port = parameters.port;
        if (parameters.secure !== undefined) updatedConfig.secure = parameters.secure;
        if (parameters.user !== undefined) updatedConfig.auth.user = parameters.user;
        if (parameters.pass !== undefined) updatedConfig.auth.pass = parameters.pass;
        
        // Handle default flag
        if (parameters.isDefault !== undefined) {
          updatedConfig.isDefault = parameters.isDefault;
          
          // If setting as default, update other configs
          if (updatedConfig.isDefault) {
            configs.forEach((config, index) => {
              if (index !== configIndex) {
                config.isDefault = false;
              }
            });
          }
        }
        
        // Update the config in the list
        configs[configIndex] = updatedConfig;
        
        // Save the updated configs
        await saveSmtpConfigs(configs);
        
        return {
          success: true,
          config: updatedConfig
        };
      } catch (error) {
        logToFile('Error in handleUpdateSmtpConfig:');
        logToFile(error instanceof Error ? error.message : 'Unknown error');
        return {
          success: false,
          message: error instanceof Error ? error.message : 'Unknown error'
        };
      }
    }
  • The Tool definition object including inputSchema for validating parameters of the update-smtp-config tool (requires 'id', optional fields for name, host, port, secure, user, pass, isDefault).
    "update-smtp-config": {
      name: "update-smtp-config",
      description: "Update an existing SMTP configuration",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "ID of the SMTP configuration to update"
          },
          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: ["id"]
      }
    },
  • The switch case in the call_tool request handler that registers and dispatches to the specific handlerUpdateSmtpConfig for the update-smtp-config tool.
    case "update-smtp-config":
      return await handleUpdateSmtpConfig(toolParams);
  • src/index.ts:59-59 (registration)
    Where the tools record (including update-smtp-config) is created via createToolDefinitions() and passed to setupRequestHandlers for MCP server registration.
    const TOOLS = createToolDefinitions();
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Update' implies a mutation operation, the description doesn't specify what permissions are required, whether changes are reversible, what happens to unspecified fields (partial vs full updates), or any rate limits/constraints. This leaves significant behavioral questions unanswered 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, focused sentence that communicates the essential purpose without any wasted words. It's appropriately sized for a tool with comprehensive schema documentation and gets straight to the point with efficient language.

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 8 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what constitutes a valid SMTP configuration, how partial updates work, what the response contains, or error conditions. The combination of mutation behavior and lack of structured metadata requires more descriptive context than provided.

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?

The schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter information beyond what's already in the schema properties. This meets the baseline expectation when schema coverage is complete, but doesn't provide extra value like explaining parameter interactions or constraints.

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 action ('Update') and resource ('existing SMTP configuration'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'update-email-template' or explain what distinguishes SMTP configuration updates from email template updates, which prevents a perfect score.

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 'add-smtp-config' or 'update-email-template'. There's no mention of prerequisites (e.g., needing an existing configuration ID) or contextual factors that would determine whether this is the appropriate tool for a given task.

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