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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/requestHandler.ts:220-235 (handler)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' }; }
- src/tools.ts:178-186 (schema)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: [] } },
- src/config.ts:168-176 (helper)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; } }
- src/requestHandler.ts:75-76 (registration)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();
- src/config.ts:7-18 (schema)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; }