Skip to main content
Glama
samihalawa

SMTP MCP Server

delete-smtp-config

Remove an SMTP email configuration from the SMTP MCP Server to manage your email sending settings.

Instructions

Delete an SMTP configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the SMTP configuration to delete

Implementation Reference

  • The main handler function that executes the delete-smtp-config tool. It finds and removes the SMTP config by ID from storage, prevents deletion of the last config, handles default config promotion, and saves changes.
    async function handleDeleteSmtpConfig(parameters: any) {
      try {
        // Get existing configs
        const configs = await getSmtpConfigs();
        
        // Find the config to delete
        const configIndex = configs.findIndex(config => config.id === parameters.id);
        
        if (configIndex === -1) {
          return {
            success: false,
            message: `SMTP configuration with ID ${parameters.id} not found`
          };
        }
        
        // Check if trying to delete the only config
        if (configs.length === 1) {
          return {
            success: false,
            message: 'Cannot delete the only SMTP configuration'
          };
        }
        
        // Check if deleting the default config
        const isDefault = configs[configIndex].isDefault;
        
        // Remove the config from the list
        configs.splice(configIndex, 1);
        
        // If deleting the default config, set another one as default
        if (isDefault && configs.length > 0) {
          configs[0].isDefault = true;
        }
        
        // Save the updated configs
        await saveSmtpConfigs(configs);
        
        return {
          success: true,
          message: 'SMTP configuration deleted successfully'
        };
      } catch (error) {
        logToFile('Error in handleDeleteSmtpConfig:');
        logToFile(error instanceof Error ? error.message : 'Unknown error');
        return {
          success: false,
          message: error instanceof Error ? error.message : 'Unknown error'
        };
      }
  • Defines the input schema, name, and description for the delete-smtp-config tool.
    "delete-smtp-config": {
      name: "delete-smtp-config",
      description: "Delete an SMTP configuration",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "ID of the SMTP configuration to delete"
          }
        },
        required: ["id"]
      }
    },
  • Registers the handler for delete-smtp-config in the tool call switch statement.
    case "delete-smtp-config":
      return await handleDeleteSmtpConfig(toolParams);
  • src/index.ts:59-63 (registration)
    Creates the tools map (including delete-smtp-config) and sets up the MCP server request handlers that expose the tools.
    const TOOLS = createToolDefinitions();
    
    // Setup request handlers
    await setupRequestHandlers(server, TOOLS);
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. It states the action is 'Delete', implying a destructive mutation, but doesn't clarify if this is permanent, reversible, requires specific permissions, or has side effects (e.g., affecting email sending). This leaves significant gaps for a tool that performs deletion.

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, direct sentence with zero wasted words. It is front-loaded with the core action and resource, making it highly efficient and easy to parse at a glance.

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 destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like permanence, permissions, or error conditions, nor does it explain what happens upon success (e.g., confirmation message). For a deletion tool, this leaves critical context gaps.

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%, with the single parameter 'id' fully documented in the schema as 'ID of the SMTP configuration to delete'. The description adds no additional parameter details beyond what the schema provides, so it meets the baseline of 3 for adequate coverage without adding value.

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 ('Delete') and the resource ('an SMTP configuration'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'delete-email-template', but the specificity of 'SMTP configuration' provides enough context to distinguish it from other deletion tools in the set.

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 an existing SMTP configuration ID), when not to use it (e.g., if the configuration is in use), or refer to related tools like 'update-smtp-config' or 'get-smtp-configs' for context.

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